jwilh Posted November 4, 2006 Share Posted November 4, 2006 I switched over to yahoo hosting and alot of the php I was using elsewhere now no longer works, if someone could take a look and tell me any problems they see that would be nice![code]<?phpecho date("4 November 2006"); echo "<br>"; $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; else echo "Have a nice day!"; echo "<BR>";?> <p style="color:White"><div ALIGN=CENTER><h3><?phpif (isset($_POST['name'])) echo "Welcome <B>$_POST[name] !</B>\n";?></p></div></h3>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/ Share on other sites More sharing options...
AbydosGater Posted November 4, 2006 Share Posted November 4, 2006 Your Problem lies in...if (isset($_POST['name'])) echo "Welcome <B>$_POST[name] !</B>\n";change that to[code]if (isset($_POST['name'])){ echo "Welcome <B>$_POST[name] !</B>\n";};[/code]You are missing the { } that surround the echo! Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119747 Share on other sites More sharing options...
jwilh Posted November 4, 2006 Author Share Posted November 4, 2006 that didnt work Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119752 Share on other sites More sharing options...
Zane Posted November 4, 2006 Share Posted November 4, 2006 you don't need brackets when you only have one statement after your IFif ($blah) echo "yep";else echo "nope";jwilh, are you getting any errors whatsoeverif not put this line at the top of your scripterror_reporting(E_ALL);and if it's not errors you getWhat not working the way you want it toand the first and only thing I see wrong with your code so far is this echo date("4 November 2006");it should beecho date("d M Y", strtotime("4 November 2006"));which is pointless cuz you might as well just sayecho "4 November 2006"; Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119753 Share on other sites More sharing options...
jwilh Posted November 4, 2006 Author Share Posted November 4, 2006 no errors and as for the format it was the new php designer that entered that in as is. Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119755 Share on other sites More sharing options...
jwilh Posted November 4, 2006 Author Share Posted November 4, 2006 As for what it is doing is just echoing part of the code out to the screen. This is just for testing purposes as is but if u want to see for yourself the check out http://www.sic-site.com/php/Ip.htm Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119757 Share on other sites More sharing options...
Zane Posted November 5, 2006 Share Posted November 5, 2006 rename your filename toIp.phpinstead ofIp.htmMost of the time people don't let the HTML and HTM extension parse PHPbut apparently you're old hosting company allowed you to do that which..is possible Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119761 Share on other sites More sharing options...
jwilh Posted November 5, 2006 Author Share Posted November 5, 2006 Your a frikkin GENIOUS lmao. That worked Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119772 Share on other sites More sharing options...
jwilh Posted November 5, 2006 Author Share Posted November 5, 2006 Now anyone have any idea why the color of the name isnt white, it is writtin the same as all the other code. Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119778 Share on other sites More sharing options...
Zane Posted November 5, 2006 Share Posted November 5, 2006 <p style="color: White;"></p><h3>Welcome <b>zane !</b></h3></div>Welcome <b>zane ! is not within your Styled P tagthat's why Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119780 Share on other sites More sharing options...
jwilh Posted November 5, 2006 Author Share Posted November 5, 2006 man i kept going over that I did not see that I closed it there. I think i may wanna check out some glasses :D !Anyways thank you for helping. Quote Link to comment https://forums.phpfreaks.com/topic/26185-what-is-wrong-with-this-code/#findComment-119788 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.