homepage Welcome to WebmasterWorld Guest from 54.198.130.203
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
querystring not working. Server issue ?
xert




msg:4466208
 10:28 am on Jun 16, 2012 (gmt 0)

Hi all,

Spent a couple of hours on this and getting nowhere fast so a little help needed. I have a page with querystring code to show the product being reviewed linked from the product page with a querystring in the link.

Link to the review page :

a href="review_form.asp?item_id=geneva+guestbed"

Code on the review_form.asp page :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>review form</title>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div align="center" class="instocktop">Product review form for model <%= Request.QueryString("item_id")%></div>
</body>
</html>

The output shown on the screen is :

Product review form for model <%= Request.QueryString("item_id")%>

The code used to work fine until I checked the other day and I cannot think of any mods I have carried out. The htaccess and robots files are unchanged.

Could this be a server fault ?

Kindest regards to all.

Chris

 

xert




msg:4466289
 5:24 pm on Jun 16, 2012 (gmt 0)

5 hours in and still can't crack it. I have even set up a test page on a different server but with the same result.

Code for first page (www.sofabedgallery.karoo.net/index.php)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
test page
<a href="karoo_rev.asp?item_id=geneva+guestbed">click</a></div>
</body>
</html>

Linked page (karoo_rev.asp):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<div align="center">Product review form for product : <%= Request.QueryString("item_id") %></div>
</body>
</html>

All I get on the screen when clicking the link is :
"Product review form for product : <%= Request.QueryString("item_id") %>"

Where am I going wrong ?

Ocean10000




msg:4466569
 1:20 am on Jun 18, 2012 (gmt 0)

Is the server setup to run asp pages. The test page you provided is php?

xert




msg:4466639
 8:03 am on Jun 18, 2012 (gmt 0)

Hi - many thanks for your input. The page with the code on is the www.sofabedgallery/karoo.net/karoo_rev.asp page.
This is just a test server I have set up without any special properties. After more research, I am wondering if the issue could be with the server permissions on this page. Is that what you are referring to, or is there an extra code needed to be uploaded to run the querystring code ?

If it's the permission, what code number should I be applying ?

Chris

Staffa




msg:4466694
 1:04 pm on Jun 18, 2012 (gmt 0)

I have often found that it seems to work better by writing your page as :

Linked page (karoo_rev.asp):
<%@ LANGUAGE = "VBScript" %>

<%
item_id = Request.QueryString("item_id")
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<div align="center">Product review form for product : <%= item_id %></div>
</body>
</html>

Don't ask me why, it just happens ;o)

Ocean10000




msg:4466695
 1:07 pm on Jun 18, 2012 (gmt 0)

From the looks of it the test server is running Apache webserver.

Apache to the best of my knowledge will not run asp pages. This is what I believe cause of the problem your having. Apache is treating the asp page as a static page, doing no processing what so ever on it.

xert




msg:4466710
 1:59 pm on Jun 18, 2012 (gmt 0)

Thank you both for your input. After spending many hours on the issue, I re emailed the hosting company who advise support for asp pages has now been withdrawn, hence the reason why the code will not run.
Workaround was to use the following php code to parse the query string :

<?php echo $_GET['item_id']; ?>

This works fine.

Kindest regards,

Chris

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved