Jump to content

Form submit opens a download dialog box


Blekk

Recommended Posts

Hi,

 

I am using PHP in my solution, but I do not think that this is actually a php question, just an HTML one. But, when I click the submit button in my form, instead of going to the next page which is query.php, it opens a download dialog to download query.php.

 

Any suggestions as to what is wrong?

 

Thanks,

 

Any reply is appreciated.

Link to comment
Share on other sites

Here's my code, its for editing an entry in the na_users table.

 

if($_GET['editSelect']==1)
{

	print "<form action='query.php' method='post'><table class='table'><tr>";
	print"<td class='td'>Username</td>
	<td class='td'>First Name</td>
	<td class='td'>Last Name</td>
	<td class='td'>Home Telephone</td>
	<td class='td'>Email Address</td></tr>";

	$result = mysql_query("SELECT * FROM na_users WHERE ID='".mysql_real_escape_string($_GET['id'])."'");
	$array = mysql_fetch_assoc($result);
	$username = $array['username'];
	$firstName = $array['firstName'];
	$lastName = $array['lastName'];
	$homePhone = $array['homePhone'];
	$emailAddress = $array['emailAddress'];

	print "<tr><td class='td'><input type='text' name='username' value='$username' /></td>
		   <td class='td'><input type='text' name='firstName' value='$firstName' /></td>
		   <td class='td'><input type='text' name='lastName' value='$lastName' /></td>
		   <td class='td'><input type='text' name='homePhone' value='$homePhone' /></td>
		   <td class='td'><input type='text' name='emailAddress' value='$emailAddress' /></td>
		   <input type='hidden' name='querySelect' value='13' />
		   <input type='hidden' name='ID' value='$ID' /></tr>";

	print "</table><input type='submit' value='Apply Changes' /><input type='reset' value='Reset Form' /></form>";
}

Link to comment
Share on other sites

I was absolutely postive that my server has php, and here it is.

 

PHP Version 4.4.4

 

System Linux medusa.hosts.co.uk 2.6.9-34.0.2.EL #1 Fri Jul 7 19:24:57 CDT 2006 i686

Build Date Feb 22 2007 16:52:49

Configure Command './configure' '--prefix=/usr/local' '--enable-bcmath' '--with-freetype-dir' '--enable-ftp' '--with-mysql=/usr' '--with-mssql=/usr/local' '--with-mcrypt=/usr/local/lib/libmcrypt' '--with-zlib-dir=/usr/local' '--with-pspell' '--with-curl' '--with-imap=/usr/local/imap-2002e' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--with-xml' '--enable-xslt' '--with-xslt-sablot' '--with-sablot-js' '--enable-mbstring' '--with-config-file-path=/usr/local/bin' '--with-pear' '--with-openssl' '--with-exif' '--with-libdir=/usr/lib'

Server API CGI

Virtual Directory Support disabled

Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini

PHP API 20020918

PHP Extension 20020429

Zend Extension 20050606

Debug Build no

Zend Memory Manager enabled

Thread Safety disabled

Registered PHP Streams php, http, ftp, https, ftps, compress.zlib

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.