|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am in the process of installing a new application on my local machine. The application was originally written for Apache.
My environment includes the following: Windows XP SP2 MS IE 6.0.2900.2180 IIS 5.1 PHP 5.0.4 MySQL 4.1.10 The application is started using the URL, http://localhost/workbench/index.php. After providing a user name and password, and clicking on Submit button, the /main.php page is displayed. Options on the main.php page allow tables to be viewed and to be maintained. The view options work fine. The maintain options have problems. Regardless of the option selected, the following takes place: After clicking on an option, a page is displayed that allows the user to select an existing table entry for editing or allows the user to create a new entry, both are initiated by clicking on a button. If an existing entry is selected, the related data is displayed in a form with the capability to change the data, and then to click on Submit to update the database. If create entry is selected, an empty form is displayed with fields, and after providing the data, the Submit button is clicked to insert the row into the database table. In both cases, once the Submit button is clicked, a delay occurs and then an error page is displayed with the following: "The page cannot be displayed ... Cannot find server or DNS Error" Regarding the data, the database tables are updated; however, for the create option, the new record is inserted/appended to the table multiple times, even 27 to 54 times. The following is an example of what the form code looks like in the *.php files; each file generally has a upper section of PHP code, which includes database calls and field validation, and then the lower section contains HTML code, with some PHP code: <form method="post" action="mydetails.php" name="mydetails" onSubmit="return validateForm('mydetails')"> <table cellspacing="0" class="table3"> <tr class="rowtitle"> <td colspan="2"><h5>My Details</h5></td> </tr> <tr> <td colspan="2"><p>Use this page to change your details.</p></td> </tr> <tr> <td colspan="2"><hr></td> </tr> <tr> <?$query = mysql_query("select * from users where login='$login'") or die(mysql_error()); while ($result = mysql_fetch_array($query)){?> <td width="200">Login</td> <td width="400"><?=$result[login]?></td> </tr> <tr> <td width="200">First Name</td> <td width="400"><input type="text" name="fName" size="20" maxlength="<?=mysql_field_len($query, 2)?>" value="<?=$result[fName]?>"></td> </tr> <tr> <td width="200">Surname</td> <td width="400"><input type="text" name="sName" size="20" maxlength="<?=mysql_field_len($query, 3)?>" value="<?=$result[sName]?>"></td> </tr> <tr> <td width="200">Email</td> <td width="400"><input type="text" name="email" size="20" maxlength="<?=mysql_field_len($query, 4)?>" value="<?=$result[email]?>"></td> </tr> <?$query = mysql_query("select * from groups where grpID='$result[grpID]'") or die(mysql_error()); while ($result2 = mysql_fetch_array($query)){?> <tr> <td width="200">Group</td> <td width="400"><?=$result2[grpName]?></td> </tr> <?} }?> <tr> <td width="200"> </td> <td width="400"><input type="Submit" value="Submit" onfocus="this.blur()"><input type="Reset" value="Reset" onfocus="this.blur()"></td> </tr> </table> </form> I would appreciate any thoughts regarding how to resolve both problems, the "The page cannot be displayed ... Cannot find server or DNS Error" problem and the multiple unexpected updates of the database. Thank you in advance for your help and insight, Randy |
|
#2
|
||||
|
||||
|
Sounds like an error in the code that handles the update/insert to the database, not the submission form. Follow through the submission process in the code and look for references to redundant DSN's, links and the like, which will not be present on your machine.
__________________
-
thought-after | my thoughts on web development Get Firefox, the developers browser Budget hosting - recommended [/left] |
|
#3
|
|||
|
|||
|
Lafinboy,
Thank you for the suggestion to look at the PHP code. I stumbled across something that noted the general need or a fully qualified URL in the PHP redirect statement like the following, header("Location: http://localhost/test/servers.php"). The code was actually referencing a variable, $relative, which was just that, a relative address. I replaced it with a $url variable, which contained the fully qualified part of the URL. Changed header("Location: $relative/servers.php") with header("Location: $url/servers.php"). $relative contains "/test" and $url contains http://localhost/test. Thank you, Randy |
|
#4
|
||||
|
||||
|
Does that mean it's fixed now?
|
|
#5
|
|||
|
|||
|
Yes, the fully qualified URL solved the problem of both the multiple postings and and the not finding the page. Thank you.
|
|
#6
|
||||
|
||||
|
No problem, happy to help.
|
![]() |
| Viewing: ASP Free Forums > System Administration > Microsoft IIS > PHP/IIS/MySQL - page and database errors |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|