Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Having A Strange Problem
kvarnerexpress
post 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>&nbsp;</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
Go to the top of the page
 
+Quote Post
xJedix
post 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
Go to the top of the page
 
+Quote Post
exhale
post 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
Go to the top of the page
 
+Quote Post
gogoily
post 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.
Go to the top of the page
 
+Quote Post
arboc7
post 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)
Try this:
There maybe another reason: register_global is turn off.
*




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!!

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Problem Installing Sims 2 Nightlife(26)
  2. I Have A Girl Problem Here(27)
  3. Problem With My Girlfriend Family, Need Suggestions For Action(2)
  4. Problem With Page Redirect(8)
  5. Remote Assistance Problem(8)
  6. Terminating Hosting Problem(1)
  7. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  8. How Many More Times Will I Have To Post About This?(11)
  9. Domain Problem : This Is Important..(0)
  10. Skype / Xampp Port Conflict(5)
  11. Php Header Problem(11)
  12. A Problem With Ftp Clients(9)
  13. Youtube People That Do Not Respect Other Opinions(7)
  14. Laptop Keyboard Problem(7)
  15. Itunes Problem!(1)
  1. Problem Aligning In Firefox(9)
  2. Problem Getting Text To Align With Different Resolutions(4)
  3. Dvd Drive Problem(10)
  4. Hosting Problem [resolved](22)
  5. It Went Well For A While(5)
  6. Rpg Maker 2003 Music Problem(3)
  7. Two Lan Ports Problem(3)
  8. 60 Seconds Countdown That Shutdown The Pc(13)
  9. Need Help: Problem Seeing My Site(4)
  10. I Have A Big Problem With Cs 1.6.(4)
  11. I'm Having A Strange Problem With My Ping In Cs:s(28)
  12. Forum Problem? Topic Disappeared Immediately [resolved](2)
  13. Postage Costs Problem For My Website(7)
  14. Hosting Problem(moderators) [resolved](3)
  15. Problem Connecting To Phpmyadmin(2)


 



- Lo-Fi Version Time is now: 5th September 2008 - 06:59 AM