#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    103
    Rep Power
    13

    javascript and php link issue


    hello all,
    I'm having problem sending email to the next page.
    I verified that the field hidden value does hold the email address but cant seem to send it to the next page. i can see the other data being sent, on my status bar but their's something wrong with line 4 and 5..

    this is what i have as of now but still not working..

    echo "<td width='15%'>",
    "<input type='hidden' name='ttoemail' value=$t_email >",
    "<a href=\"javascript:popup",
    "('classifiedmail.php?ecmd=",$ttoemail,"',", ///Problem area
    "'pagename','360','320','center','front')\">",
    "<font size='3'>Email:<img src='/images/friend.gif' border='0'> </font></a></td>";

    the receiving page code
    $_GET['ecmd'];
    $email_to = $ecmd;
    any help you can give me would be greatly appreciated.
    thanks all
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    20
    Rep Power
    0
    i did not understand, what's the problem? what errors are there on pages? is a field passes correctly

    give more information please
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    103
    Rep Power
    13
    Hi,
    looking at the code i posted... when a user/visiter clicks on the link it popups a window(email form) and at the sametime it should send an eamil address to the popup windown(email form).
    -the window does popup.
    -no! error message displayed anywhere, not even in the status bar.
    - on the bottom right corner(status bar), the following is displayed when the mouse, move over the link: javascript:popup('classifiedemail.php?ecmd=','pagename','360','320','center','front')..

    -as you can see between 'ecmd=' & 'pagename', shoud display email address. but in this case it's not..

    -the script is a classified ad script and if the user needs more info about an item they can click on the email link to get an email form to send an email.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    56
    Rep Power
    13
    let me see if i get this straight first...
    -when the user clicks on some link, a popup comes up filling in the email address as a PHP variable



    popups don't have a .php extension so they are not parsed by PHP. the popup doesn't understand what you are trying to do with PHP variables because it doesn't know it's PHP.
    PHP is fun
  8. #5
  9. Cobol Victim
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    Munich, GER
    Posts
    124
    Rep Power
    13
    i replaced your popup() function code with standard javascript should work:

    echo "<td width='15%'>
    <input type='hidden' name='ttoemail' value='".$t_email."' >
    <a href=\"javascript:window.open('classifiedmail.php?ecmd=".$ttoemail."','Popup','width=360,height=320' )\">
    <font size='3'>Email:<img src='/images/friend.gif' border='0'> </font></a></td>";




    the receiving page code

    $email_to = $_GET['ecmd']; // according to php 4.x standard

    Just copy and paste this!(No, vBulletin added a blank in java script, remove it :-))
    Should work
    Last edited by aumasta; December 28th, 2002 at 02:15 PM.
    Lebowski: Isn't that what makes a man?
    Dude: Mmm, sure. That and a pair of testicles.

IMN logo majestic logo threadwatch logo seochat tools logo