What am I missing???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SavingFlorida
Forum Newbie
Posts: 1
Joined: Mon Jun 30, 2008 12:00 am

What am I missing???

Post by SavingFlorida »

The following code is giving me "Parse error Unexpected T_VARIABLE" on the line that says if $Valid='1' {.

Code: Select all

                <?php
                $email=$_POST["email"];
                $Valid='1';
                if (strlen($email)==0){
                    $Valid='0';
                    }else{
                    $Valid='1';
                    }
                    
                if $Valid=='1' {
                    ini_set("sendmail_from","info@SavingCentralFlorida.com");
                    ini_set("SMTP","smtp.secureserver.net");
                    $MyAddress="info@SavingCentralFlorida.com";
                    mail('$MyAddress',"Saving Central Florida Newsletter Subscription","$email","From: $MyAddress");
                    echo "Your email address $email has been successfully added to our database. Thank you for subscribing!!!";
                    }else{
                    echo "Your data was not processed successfully. Please re-submit your email address.";
                    }                   
                ?>
 
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: What am I missing???

Post by Christopher »

(#10850)
madan koshti
Forum Commoner
Posts: 50
Joined: Fri Jun 06, 2008 4:25 am

Re: What am I missing???

Post by madan koshti »

# <?php
# $email=$_POST["email"];
# $Valid='1';
# if (strlen($email)==0){
# $Valid='0';
# }else{
# $Valid='1';
# }
#
# if $Valid=='1' {
# ini_set("sendmail_from","info@SavingCentralFlorida.com");
# ini_set("SMTP","smtp.secureserver.net");
# $MyAddress="info@SavingCentralFlorida.com";
# mail('$MyAddress',"Saving Central Florida Newsletter Subscription","$email","From: $MyAddress");
# echo "Your email address $email has been successfully added to our database. Thank you for subscribing!!!";
# }else{
# echo "Your data was not processed successfully. Please re-submit your email address.";
# }
# ?>


this line should be if ($Valid=='1') {
Post Reply