kvarnerexpress 0 Report post Posted October 29, 2005 Im having a strange problem and Im sure its some thing that ive over looked. A fresh set of eyes and suggestions would be great.Simple form to pass data to a function.On submit the function is accessed, but the data doesnt seem to get in to the check_status()I know the check_status is working, when i type in the data ...PHP Code: $checkform = "<form method=\"post\" action=\"test.php\"> <table width=\"0%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"> <tr> <td><strong>Messenger Service : </strong></td> <td><select name=\"ms\"> <option selected>Select</option> <option value=\"yim\">YIM</option> <option value=\"msn\">MSN</option> <option value=\"aim\">AIM</option> </select></td> </tr> <tr> <td><strong>User ID : </strong></td> <td><input name=\"id\" type=\"text\"></td> </tr> <tr> <td> </td> <td><div align=\"right\"> <input type=\"hidden\" name=\"opi\" value=\"docheck\"> <input type=\"reset\" name=\"Reset\" value=\"Reset\"> <input type=\"submit\" name=\"Submit\" value=\"IM Check\"> </div></td> </tr> </table> </form>";if ($opi != "docheck") { echo "$checkform"; } elseif ($opi == "docheck") { check_status('$ms', '$id', 0);} If I doPHP Code:check_status('blah' , 'blah' 0);Everything is fine ...... ideas?Thanks,kvarnerexpress Share this post Link to post Share on other sites
xJedix 0 Report post Posted October 29, 2005 I don't really see a problem but what are you trying to do here? if ($opi != "docheck") { echo "$checkform"; } elseif ($opi == "docheck") { check_status('$ms', '$id', 0);} because the form is sending the data to "test.php" Though I might just be getting confuzed since I haven't done php in a while.If that stuff is fine, then there is one thing that might make your coding easier... and maybe might have effect on if it works but I don't think it will. When I do php, I hate doing html in php so I don't. All you have to do is simply do ?> then do the html, which then you don't have to use the slashes. Then once you need php again, you do <?phpJust a little something that makes php easier, you might have already known about it but I thought I would mention it.xJedix Share this post Link to post Share on other sites
exhale 0 Report post Posted October 29, 2005 wrong forum, this is the dating topic lol and i have NO idea about php. haha Share this post Link to post Share on other sites
gogoily 0 Report post Posted October 30, 2005 Try this: if ($opi == "docheck") check_status('$ms', '$id', 0);else echo "$checkform"; There maybe another reason: register_global is turn off. Share this post Link to post Share on other sites
arboc7 0 Report post Posted October 31, 2005 Try this: There maybe another reason: register_global is turn off. 199730[/snapback] That is possible. I suggest that you use the following: if ($opi != "docheck") { echo "$checkform";} elseif ($opi == "docheck") { check_status($_POST["ms"],'$_POST["id"], 0);} If register globals is not enabled, you can't just load the variables directly, you have so use the $_POST array. Also, the single quotes may have been giving you a problem... Good luck!! Share this post Link to post Share on other sites