chizley Posted September 9, 2007 Share Posted September 9, 2007 Hey im just making this thing that receives from html, here's my code: <?php $noa = $_POST['noa']; $idea = $_POST['idea']; if($noa = Description){ $handle = fopen("descriptions.html", "a"); fwrite($handle, "<tr><td> if(desc == ){<br /> _root.descr = (".$idea.");<br /> }</td></tr>"); fclose($handle); $URL="http://h1.ripway.com/chizley1/ideamaker.html"; header ("Location: $URL"); } if($noa = Name){ $handle2 = fopen("names.html", "a"); fwrite($handle2, "<tr><td> if (name == ){<br /> _root.nam = (".$idea.");<br /> }</td></tr>"); fclose($handle2); $URL="http://h1.ripway.com/chizley1/ideamaker.html"; header ("Location: $URL"); } else{ $URL="http://h1.ripway.com/chizley1/error.html"; header ("Location: $URL"); } ?> And bassicly, its sending it to both the html's (Description and Name), Fast help please. -Chizley Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/ Share on other sites More sharing options...
wildteen88 Posted September 9, 2007 Share Posted September 9, 2007 Use == on your expressions and not a single equal singe. == means comparison = means asignment if($noa = Description){ should be if($noa == 'Description'){ Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/#findComment-344671 Share on other sites More sharing options...
chizley Posted September 9, 2007 Author Share Posted September 9, 2007 Thanks, but still does'nt work, now it just goes to my error page... Edit: Oh, and FYI, the $noa is defined by the drop down menu on, http://h1.ripway.com/chizley1/ideamaker.html. Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/#findComment-344673 Share on other sites More sharing options...
pranav_kavi Posted September 9, 2007 Share Posted September 9, 2007 if($noa == Name){ $handle2 = fopen("names.html", "a"); wat is Name...it doesnt luk like a variable nor a string constant? Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/#findComment-344676 Share on other sites More sharing options...
chizley Posted September 9, 2007 Author Share Posted September 9, 2007 I just added above: Oh, and FYI, the $noa is defined by the drop down menu on, http://h1.ripway.com/chizley1/ideamaker.html. So im pretty sure that's a string. sorry im not to famillier with the common terms. Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/#findComment-344678 Share on other sites More sharing options...
pranav_kavi Posted September 9, 2007 Share Posted September 9, 2007 checked out ur site.the select box-'noa' returns either 'noun' or 'adjective'.so ur code actually shud b: if($noa == 'adjective'){ and if($noa == 'noun'){ Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/#findComment-344680 Share on other sites More sharing options...
chizley Posted September 9, 2007 Author Share Posted September 9, 2007 Thanks alot man, you really need other people to point the little thing out to you. Thanks alot, i would have never found it -Chizley. Quote Link to comment https://forums.phpfreaks.com/topic/68568-solved-defieing-variables-unsolvedhelp/#findComment-344681 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.