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
https://forums.phpfreaks.com/topic/42269-form-submit-opens-a-download-dialog-box/
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>";
}

did you attempt what thorpe suggested, because running that well tell you and us if you have php installed on your server. because when i read your post i assumed php was not installed on your server as that is what happens when it isnt.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.