PDA

View Full Version : loading external file ref for dynamic script



fodo
02-28-2008, 03:59 PM
1) Script Title: Dynamic Ajax Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

3) Describe problem:
I would like to insert php variables into the link for this program.
I am getting parse errors. Is what i am doing possible with this script.
I want to load an external page reference from a db into the a href tag as follows


?>
<a href="javascript:ajaxpage('<?php ./$p1',' 'contentarea');"onmouseover="Tip('View Synopsis')"><img src=<?php './images/{$book['pix']}'?> border='0' width='80' height='100'/></a>"

<div id="contentarea"></div>
<?php

jscheuer1
02-28-2008, 04:08 PM
Looks like your PHP syntax is way off. There are two opening <?php tokens with no closing ?> between them. Single quote (') delimiters appear to be nested without the literal ones being escaped. I'm no PHP expert, but I know these things cannot be done. You might want to run this syntax by the folks in the PHP forum. But you should also include, in addition to your example, an example of how you want the server to serve one of these bits of code, once it has resolved the PHP variables.

fodo
02-28-2008, 04:22 PM
Right I spotted the errors in the php and will get that checked out.
To be clear re 'an example of how you want the server to serve one of these bits of code, once it has resolved the PHP variables.' the page requested is a simple html format the should be rendered in the div tags following the a href tag.
Is this not what you are asking?

jscheuer1
02-28-2008, 05:17 PM
I imagine that you want it served something like so:


<a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>

Just make that clear to folks in the PHP forum, as they may not be familiar with the script you are trying to power with your PHP code and the ordinary HTML syntax that script requires.