|
|
|
|
![]() ![]() |
Oct 29 2005, 04:13 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
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: 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 do PHP Code: CODE check_status('blah' , 'blah' 0); Everything is fine ...... ideas? Thanks,kvarnerexpress |
|
|
|
Oct 29 2005, 05:57 PM
Post
#2
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 183 Joined: 27-June 05 From: Minnesota Member No.: 8,734 |
I don't really see a problem but what are you trying to do here?
CODE 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 <?php Just a little something that makes php easier, you might have already known about it but I thought I would mention it. xJedix |
|
|
|
Oct 29 2005, 10:42 PM
Post
#3
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 86 Joined: 28-September 05 Member No.: 12,320 |
wrong forum, this is the dating topic lol and i have NO idea about php. haha
|
|
|
|
Oct 30 2005, 09:42 AM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 100 Joined: 30-October 05 Member No.: 13,571 |
Try this:
CODE if ($opi == "docheck") check_status('$ms', '$id', 0); else echo "$checkform"; There maybe another reason: register_global is turn off. |
|
|
|
Oct 31 2005, 01:29 AM
Post
#5
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 123 Joined: 5-September 05 Member No.: 11,522 |
QUOTE(gogoily @ Oct 30 2005, 04:42 AM) That is possible. I suggest that you use the following: CODE 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!! |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th September 2008 - 06:59 AM |