Problem with passing mysql_num_rows an argument

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Problem with passing mysql_num_rows an argument

Post by requinix »

bmoyles0117 wrote:Thusforth, the form probably consists of an image type submit button.
Uh, no. You clicked it: did it look like an image to you?

Form code (as I see it) with formatting:

Code: Select all

<form action="/search" name=f>
<table cellpadding=0 cellspacing=0>
  <tr valign=top>
    <td width=25%>&nbsp;</td>
    <td align=center nowrap>
      <input name=hl type=hidden value=en>
      <input autocomplete="off" maxlength=2048 name=q size=55 title="Google Search" value=""><br>
      <input name=btnG type=submit value="Google Search">
      <input name=btnI type=submit value="I'm Feeling Lucky"></td>
    <td nowrap width=25%>
      <font size=-2>&nbsp;&nbsp;<a href=/advanced_search?hl=en>Advanced Search</a><br>
      &nbsp;&nbsp;<a href=/preferences?hl=en>Preferences</a><br>
      &nbsp;&nbsp;<a href=/language_tools?hl=en>Language Tools</a></font>
    </td>
  </tr>
</table>
</form>
bmoyles0117
Forum Newbie
Posts: 22
Joined: Sun Nov 02, 2008 1:46 am

Re: Problem with passing mysql_num_rows an argument

Post by bmoyles0117 »

Woman -.-

Code: Select all

 
<form method="post" action="test.php">
    <input type="text" name="field1" value="123" />
    <br />  
    <input type="submit" value="Submit" />
</form>
 
Will put out

Code: Select all

 
Array
(
    [test] => asdf
)
 
The ONLY reason why the submit button would result something other than being an image is if you assign it a name.

Common sense would allocate a train of thought towards separating your output so as to NOT check for a simple string value randomly generated due to your taste for desire for context to fill the value of your submit value. Other than that. Using a hidden field to have a definite reference check makes more systematical sense.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Re: Problem with passing mysql_num_rows an argument

Post by infolock »

actually....

Code: Select all

 
<form method="post" action="test.php">
    <input type="text" name="field1" value="123" />
    <br />  
    <input type="submit" value="Submit" />
</form>
 
will output

Code: Select all

 
Array
(
  [field1] => 123
)
 
;)

Either way, instead of creating a whole new input type = hidden, why not just apply the name="submit" to the submit button and be done with it?
Post Reply