i have a problem with my php script ...i need to pass an id ($id) to a page called pa

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jessy
    New Member
    • Oct 2006
    • 106

    i have a problem with my php script ...i need to pass an id ($id) to a page called pa

    this page opens in a pop up where it fetches an image from the Database ...everything works perfect except for passing the id part..
    i'm tired of trying and i kept 5 days googling but could not solve it !!
    any help would be appreciated .. here's the line that drove me crazy
    <A HREF='javascrip t:popup("page.p hp?id=$id"...
    this $id was sent to this page by another page and now i want to resent it to some other page (page.php) i assumed it's already known for this page so i used it directly $id

    its not coming via post Nor get
    i got this id from alink <a href='edit_news .php?id=$id'>
    okay..
    then in the second page i write $id=$_REQUEST[id]; so now i have this id on that second page and when i echo this id it gives me the correct one But on this second page i need to sent that SAME id to the pop up ????? that's my problem
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Jessy.

    Try this:
    [code=html]
    <a href="#" onclick="popup( 'page.php?id=<? php echo $id; ?>; return false;" ...
    [/code]

    Comment

    • jessy
      New Member
      • Oct 2006
      • 106

      #3
      Oh God
      God Bless You Admin .. it Works ...
      i can't beleive it ..i was getting sick

      but please can u tell me what is the difference between

      popup("page.php ?id=<? echo $id ;?>");
      and
      popup("page.php ?id=$id") ;
      what difference does it makes if the page already knows the value of $id

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Have a look at this document: http://php.net/string.

        The "page" is just an HTML document that the User's browser interprets. It never communicates with the PHP side directly.

        Comment

        Working...