Microsoft IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationMicrosoft IIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 13th, 2005, 12:00 AM
RTCreager RTCreager is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 3 RTCreager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 39 sec
Reputation Power: 0
Unhappy PHP/IIS/MySQL - page and database errors

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">&nbsp;</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

Reply With Quote
  #2  
Old April 13th, 2005, 01:01 AM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,267 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 48 m 12 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
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.
Comments on this post
RTCreager agrees: see additional post regarding resolution

Reply With Quote
  #3  
Old April 14th, 2005, 10:20 PM
RTCreager RTCreager is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 3 RTCreager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 39 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old April 15th, 2005, 01:34 AM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,267 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 48 m 12 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
Does that mean it's fixed now?

Reply With Quote
  #5  
Old April 15th, 2005, 07:16 AM
RTCreager RTCreager is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 3 RTCreager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 39 sec
Reputation Power: 0
Yes, the fully qualified URL solved the problem of both the multiple postings and and the not finding the page. Thank you.

Reply With Quote
  #6  
Old April 15th, 2005, 08:23 AM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,267 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 48 m 12 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
No problem, happy to help.

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationMicrosoft IIS > PHP/IIS/MySQL - page and database errors


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT