Results 1 to 4 of 4

Thread: loading external file ref for dynamic script

  1. #1
    Join Date
    Feb 2008
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default loading external file ref for dynamic script

    1) Script Title: Dynamic Ajax Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.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
    PHP Code:
    ?>
        <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
    Last edited by jscheuer1; 02-28-2008 at 04:03 PM. Reason: put code in syntax highlighted php code tags

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2008
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I imagine that you want it served something like so:

    HTML Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •