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!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I was wondering if this would actually mail anything..
<?php
$email="testsup123@yahoo.com";
if (mail($email,"testsup","testsup"))
{
print "email sent to $email";
}
?>
I recently registed an account with imhosted.com and they told me my code is flawed so they gave me the above code to prove their servers are functioning properly.. Still haven't recieved anything. Am I wrong that the above code is completely worthless?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<HTML>
<script language="javascript">
function goback()
{
history.back();
}
</script>
<?php
$theDATE = strftime ("%a %B %d, %Y :: %I:%M %p, %Z");
$x = 0;
if ($NAME == "") $x = 1;
if ($PHONE == "") $x=1;
if ($EMAIL == "") $x=1;
if ($TAXRATE == "") $x=1;
if ($TYPE_OF_PROPERTY == "") $x=1;
if ($LOCATION_PREFERENCE == "") $x=1;
if ($AMOUNT_TO_INVEST == "") $x=1;
if ($MONEY_AVAILABLE == "") $x=1;
if ($RETURN_RATE == "") $x=1;
if ($INTEREST_WILLING == "") $x=1;
if ($READY == "") $x=1;
if ($x == 1) {
echo "<font face='Arial, Helvetica, sans-serif' size='2' color='#333333'>You did not complete the form, please go back, thank you.";
echo "<br><br><FORM><INPUT TYPE='button' VALUE='ok' style='background-color:#cccccc; border-style:1px; font-size: 10px; color: #000000; font-family: arial' onClick='goback();'></FORM>";
}
else {
mail ("kidstark@msn.com", "AMG Commercial Investment Inquery", "$theDATE\n\nNAME: $NAME\nE-MAIL:$EMAIL\nPHONE:$PHONE\nTAX RATE: $TAXRATE\n\nDO YOU HAVE A REASON FOR INVESTING THAT MIGHT IMPACT THE TRANSACTION?\n$IMPACT_THE_TRANSACTION\n\nWHAT TYPE OF OF PROPERTY ARE YOU LOOKING FOR?\n$TYPE_OF_PROPERTY\n\nLOCATION PREFERENCE: $LOCATION_PREFERENCE\n\nAMOUNT OF MONEY TO INVEST: $AMOUNT_TO_INVEST\n\nMONEY AVAILABLE: $MONEY_AVAILABLE\n\nARE YOU WILLING TO PUT UP EARNEST MONEY?\n$PUT_UP_EARNEST_MONEY\n\nRETURN RATE: $RETURN_RATE\n\nINTEREST WILLING TO PAY: $INTEREST_WILLING\n\nIS THERE ANYONE ELSE INVOLVED IN MAKING THE DECISION?\n$ANYONE_ELSE\n\nWHEN WILL YOU BE READY TO INVEST?\n$READY");
echo "<font face='Arial, Helvetica, sans-serif' size='2' color='#000000'>Form sent successfully. Thank you $NAME.</font>";
echo "<br><br><FORM><INPUT TYPE='button' VALUE='ok' style='background-color:#CCCCCC; border-style:1px; font-size: 10px; color: #000000; font-family: arial' onClick=parent.location='index.htm';return true;'></FORM>";
}
?>
</HTML>
It works fine on my old server, but they are going out of business.. Why wouldn't it work on the new server? I'm totally lost..
kidstark wrote:So you can use the mail function in a conditional statement? I didn't know that..
Well, the thing is, just be can doesn't mean you should. Putting the function in the conditional can save line space, but generally actions inside conditionals can be confusing.