Jul 26, 2008

Having A Strange Problem

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Having A Strange Problem

kvarnerexpress
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

 

 

 


Reply

xJedix
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

 

 

 


Reply

exhale
wrong forum, this is the dating topic lol and i have NO idea about php. haha

Reply

gogoily
Try this:
CODE

if ($opi == "docheck")
  check_status('$ms', '$id', 0);
else
  echo "$checkform";


There maybe another reason: register_global is turn off.

Reply

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


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics
Looking for strange, problem

Searching Video's for strange, problem
advertisement



Having A Strange Problem



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE