Hi All, this is probably really simple - I've posted it into the PHP forum in a thread I had going there, but it's probably more suited to being in here...
At the moment I'm using a javascript/jquery combo to load pages into a container div on my site - The script looks something like this:
HTML Code:
HTML Code:
<script type="text/javascript">
function loadContent(elementSelector, sourceURL) {
$(""+elementSelector+"").load("http://www.website.com/test/"+sourceURL+"");
}
</script>
And a link looks like this:
HTML Code:
HTML Code:
<a href="javascript:loadContent('.content', 'test3.php');">Video</a>
Now, because of the Apostrophe's in this and the Apostrophes needed in my PHP code for the database field names I'm getting syntax errors, for example:
PHP Code:
PHP Code:
<a href="javascript:loadContent('.content', 'video.php?video={$info['title']}'');">{$info['title']}</a>
Does anyone know a way I can make this work?!
EDIT: I've just re-read my post and realised it's a bit vague.
What I now have is a dynamically generated page, that depending on the link that is clicked, passes the variables using $_GET to a new page.
I'm trying to open this page in my content DIV, but due to the apostrophe marks in the PHP array item names it's throwing up syntax errors/not working with the code...
Hopefully that makes it all a bit clearer in conjunction with the above!
Last edited by hj8ag; 11-08-2010 at 09:42 AM..
Reason: To clarify issue
|