Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
missdanni
Hangin' Around



Joined: Jul 06, 2005
Posts: 25

PostPosted: Sat Oct 29, 2005 8:28 am Reply with quote

Simple issue - Data is passed and echos fine, however is not passed to check_status() .... im having a brain dead day ... what am I missing ?

Code:
echo "

<form name=\"imcheck\" 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=\"reset\" name=\"Reset\" value=\"Reset\">
        <input type=\"submit\" name=\"Submit\" value=\"IM Check\">
      </div></td>
    </tr>
  </table>
  </form>
";

check_status('$ms', '$id', 0);
echo " '$ms' '$id' ";


Ok I have messed around somemore and tried this method and still not getting anything back.

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);
}


Any suggestions would be great.
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Oct 29, 2005 10:02 am Reply with quote

missdanni,

Try echo'ing the variables $ms and $id with something like:

Code:


echo "ms = $ms<br>";
echo "id = $id<br>";


Just to see what you are getting. One thing you might want to try is lengthen your variables names a bit. The one that concerns me is the use of "id". Not sure where I read it or if I am even off-base, but it might be getting clobbered.

Also, is this the complete test.php script that you are showing us here? Also, is this what you are calling from the browser the first time?

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
missdanni







PostPosted: Sat Oct 29, 2005 10:13 am Reply with quote

I renamed ms to mes and id to userid
THEN
I tried adding
echo "mes = $mes<br>";
echo "userid = $userid<br>";

The data is passed into the function but not to check_status()

Now if I use check_status('blah' , 'blah' , 0);

It works fine.

I just can seem to get it to take $mes and $userid
 
montego







PostPosted: Sat Oct 29, 2005 10:16 am Reply with quote

Oopppsss.... Can't believe I missed it before. Sorry about that. Take the quotes off around $ms and $id so that it looks like this instead:

check_status($ms, $id, 0);
 
missdanni







PostPosted: Sat Oct 29, 2005 11:31 am Reply with quote

Now im lost ....

When I do this

Code:
    $mes = 'yim';

   $userid = 'theonezion';
   check_status($mes, $userid, 0);


Everything is fine.

But when I try and do it with a form like above so that you can select $mes and enter $userid it wont work.

Ideas?
 
montego







PostPosted: Sat Oct 29, 2005 11:44 am Reply with quote

Is variable $opi working? Are you getting a value for it? If not, try using the following instead for your variables:

$_POST['opi']
$_POST['mes']
$_POST['userid']
 
missdanni







PostPosted: Sat Oct 29, 2005 4:09 pm Reply with quote

This is what im working with currently and it still isnt correctly passing the data.

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=\"mes\">
        <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=\"userid\" 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($mes, $userid, 0);
}
 
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sat Oct 29, 2005 11:36 pm Reply with quote

montego maybe right, you may not have register_globals activated. Is this all of the test.php file?

Try
Code:


   check_status($_POST['mes'], $_POST['userid'], 0);

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
missdanni







PostPosted: Sun Oct 30, 2005 6:50 am Reply with quote

I tried what you suggested and its still giving me problems.
I believe it has something to do with passing the ' along ..... Im not sure how to correct that one.
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Oct 30, 2005 8:37 am Reply with quote

If you run this code, do you see the variables being passed?

Code:
<?

function check_status($mes, $userid, $var1) {
   echo '$mes = '.$mes.'<br />';
   echo '$userid = '.$userid;
}

$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=\"mes\">
        <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=\"userid\" 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($mes, $userid, 0);
}
?>
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©