Weird GET Query String

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

Post Reply
bubberz
Forum Newbie
Posts: 14
Joined: Wed Jul 13, 2005 12:05 pm

Weird GET Query String

Post by bubberz »

Sami | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


my querystring looks like this:
http://localhost:8080/AdminEditByEmail. ... nformation

I only need the Email query string parameter, but the button name and value are getting concatenated to the end.
I validate the form since the user has to enter some or all of the email address.

Why is this happening?

Here's some of the HTML that should help:

Code: Select all

<form id="frmViewInfo" name="frmViewInfo" method="get" action="AdminEditByEmail.php">
  <table width="80%" border="1">
    <tr  >
      <td width="100%">Email:<font color="red">*</font></td>
      <td width="100%"><input name="Email" type="text" id="Email" size="100" maxlength="100" /></td>
    </tr>
  </table>
  <p align="center">
		<input name="btnSubmitInfo2" type="submit" id="btnSubmitInfo2" value="Click To View User Information" />

 </p>

Sami | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Moved to PHP Code.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I don't get it, that is normal behavior for the submit button to be included along the query string.

If you only want one part of the query string then do

Code: Select all

echo $_GET['Email'];
You could also use a link/image and javascript to submit the form, so no other information is passed along

Code: Select all

<a href="#" onClick="document.formname.submit();">Submit Me</a>
bubberz
Forum Newbie
Posts: 14
Joined: Wed Jul 13, 2005 12:05 pm

Post by bubberz »

Jcart!

Thanks for the reply. I thought my page that looks for the Email query string should be fine...and it was...I had two server behaviors "Show if recordset not empty" and another "Hide if empty", and the table I wanted to use to display the "contains" Email query string data was in the "Hide" portion of the page!

Thanks...sorry for the confusion!
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

... or just not give the button a NAME.
Post Reply