isset not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stealthmode666
    New Member
    • Nov 2008
    • 21

    isset not working

    Undefined Index: I have used this but the user still gets a page of notices, (about 70 in total) can someone help me with the coding here that will somehow check the empty string and still send it without the browser displaying a page of notices.
    I am at a serious loss this end and I can't learn this is mins what has taken some people years to understand.
    I have 2 problems with my script in PHP as I have tried to piece together bits.
    all i want it to do is take the field data and send it to an email and send a reply to the field that has the users email in it and display a page that says thank-you when they hit submit.
    I am so desperate this end as I'm so new to php and this was needed hours ago.
    Or have I to pay a developer to get this done?
    please help, I know people have read my posts but i'm not good enough to understand all this yet.
    [code=php]<?php
    $to = ( isset ($_REQUEST['sendto']) ? $_REQUEST['sendto'] : "default 'to' email goes here" );
    $from = ( isset ($_REQUEST['Email']) ? $_REQUEST['sendto'] : "default 'from' email goes here" ) ;
    $name = ( isset ($_REQUEST['Member_Name']) ? $_REQUEST['Member_Name'] : "Default member name goes here" ) ;
    $headers = "From: $from";
    $subject = "Members Data From RedSquareFinanc e.com";[/code]

    If someone who read my previous posts is working on my problem thank-you.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by stealthmode666
    Undefined Index: I have used this but the user still gets a page of notices, (about 70 in total) can someone help me with the coding here that will somehow check the empty string and still send it without the browser displaying a page of notices.
    I am at a serious loss this end and I can't learn this is mins what has taken some people years to understand.
    I have 2 problems with my script in PHP as I have tried to piece together bits.
    all i want it to do is take the field data and send it to an email and send a reply to the field that has the users email in it and display a page that says thank-you when they hit submit.
    I am so desperate this end as I'm so new to php and this was needed hours ago.
    Or have I to pay a developer to get this done?
    please help, I know people have read my posts but i'm not good enough to understand all this yet.
    [code=php]<?php
    $to = ( isset ($_REQUEST['sendto']) ? $_REQUEST['sendto'] : "default 'to' email goes here" );
    $from = ( isset ($_REQUEST['Email']) ? $_REQUEST['sendto'] : "default 'from' email goes here" ) ;
    $name = ( isset ($_REQUEST['Member_Name']) ? $_REQUEST['Member_Name'] : "Default member name goes here" ) ;
    $headers = "From: $from";
    $subject = "Members Data From RedSquareFinanc e.com";[/code]

    If someone who read my previous posts is working on my problem thank-you.
    I can see you've attempted some code and are trying to understand. I can code this with you.

    From what I see, you almost have the email variables complete. What you need to do is change the phrases like "default 'to' email goes here" , etc. to your own default value. If you don't have a default email value, just put "" (two double or single quotes with nothing in between) this means its an empty string.

    What you need to do now is use the mail function to send the email. The mail function can be found at php.net/mail

    Note, PHP must be configured with a mail server. That is the php.ini must know what to do with the mail command. Best thing for you to do is just execute a mail command like this at the top of your php page:

    Code:
    $result = mail("youremail@example.com","Testing Mail","Test Message","From: serveremail@example.com"); 
    
    die("the result of the mail test is: " . var_dump($result));
    That code will halt with that die statement and let you know if the mail worked, or it didn't. Make sure you replace the email with your actual email address. Please try that and post back the result and any errors (make sure error reporting and display errors are set).




    Dan

    Comment

    Working...