Welcome to WebmasterWorld Guest from 54.156.36.82

Forum Moderators: ocean10000

Message Too Old, No Replies

querystring not working. Server issue ?

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

New User

5+ Year Member

joined:Feb 8, 2010
posts: 20
votes: 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
5:24 pm on June 16, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 8, 2010
posts: 20
votes: 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 ?
1:20 am on June 18, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


Is the server setup to run asp pages. The test page you provided is php?
8:03 am on June 18, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 8, 2010
posts: 20
votes: 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
1:04 pm on June 18, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 24, 2002
posts:894
votes: 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)
1:07 pm on June 18, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


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.
1:59 pm on June 18, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 8, 2010
posts: 20
votes: 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