Welcome, Guest
  • Author Topic: How to FIX the PHP to get it working!!!  (Read 6729 times)

    kreatura

    • Server what's that
    • *
    • Posts: 3
    • $_REQUEST["money"];
      • View Profile
      • Email
    How to FIX the PHP to get it working!!!
    « on: 01/23/03, 17:56 »
    If your php.ini have "register_globals = off" you have to request the variables from flash by php in this mode:
    Add these lines at the begin of the php file:

    $ToEmail = $_REQUEST["toEmail"];
    $ToName = $_REQUEST["toName"];
    $ToSubject = $_REQUEST["ToSubject"];
    $FirstName = $_REQUEST["FirstName"];
    $Email = $_REQUEST["Email"];
    $Company = $_REQUEST["Company"];
    $ToComments = $_REQUEST["ToComments"];
    $HearAbout = $_REQUEST["HearAbout"];


    Also you can use $_POST["yourflashvariable"]; if the variables are sent in POST method or $_GET["yourflashvariable"]; if the variables was send by flash in GET method

    And your file should look like:

    <?
    $ToEmail = $_REQUEST["toEmail"];
    $ToName = $_REQUEST["toName"];
    $ToSubject = $_REQUEST["ToSubject"];
    $FirstName = $_REQUEST["FirstName"];
    $Email = $_REQUEST["Email"];
    $Company = $_REQUEST["Company"];
    $ToComments = $_REQUEST["ToComments"];
    $HearAbout = $_REQUEST["HearAbout"];

    $EmailBody = "Sent By: $FirstName \n Senders Email: $Email \n Senders Company: $Company \n \n Message Sent: \n $ToComments \n\n Sender Heard About Site From: $HearAbout \n";

    $EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If you feel that you recieved this e-mail by accident please contact us at www.dedaldesign.ro";

    $Message = $EmailBody.$EmailFooter;

    mail($ToEmail, $ToSubject, $Message, "From: ".$FirstName." <".$Email.">");


    Print "_root.Mail.EmailStatus=Complete - Your mail has been sent";

    ?>

    or set register_register_globals = on  but most servers worldwide use it to off by security reasons.

    For any question contact me at cristi@dedaldesign.ro beacause I'm not
    gonna check this forum again

    PS: jeffrey, be more relevant in your tutorials. You should say this
    thing to newbies. Or you are . . .   but you should know that will not work with
    register_globals off
    « Last Edit: 01/23/03, 18:19 by kreatura »
    kontakt the kreature at cristi@dedaldesign.ro

    Mohsin Sumar

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 1646
    • Mohsin Sumar, Extreme Web Technologies
      • MSN Messenger - mohsinsumar@hotmail.com
      • Yahoo Instant Messenger - mohsinsumar
      • View Profile
      • Extreme Web Technologies
      • Email
    Re: How to FIX the PHP to get it working!!!
    « Reply #1 on: 03/16/05, 08:03 »
    Hi,
    Thanks for your post.

    Most of the online tutorials were written before the register_globals were set to "off" by default, i.e. before the security vulnerabilities were discovered.

    Anyways - the contact form has been updated, please see http://www.flash-db.com/Tutorials/email/
    - Best Regards, Mohsin Sumar
    - Mohsin Sumar dot com is hosted by Extreme Web Technologies