Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request URL Problem

Status
Not open for further replies.

GeorgeBC

Programmer
Nov 23, 2005
21
TR
hi,

i m not working a script
i m receiving this error, when i click continue buton:

this is writing on the address bar.
20<b>//premfs19/sites/premium19/georgeb/webroot/adlogger/adlogger/install/index.php</b>%20on%20line%20<b>109</b><br%20/>


at the explorer:
The page cannot be found
HTTP 400 - Bad Request
Internet Explorer

As you see it shows the hard disk path of the hosting company and I think that it must be shown of the domain url.

My hosting company supports php. But it stops on the line that includes 'request url'.

<form name="form1" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">

what can i do?

thank you.
 
Your server simply isn't providing a REQUEST_URI. Not all servers do. Pretty much the only things you can do about this are to reconfigure the web server (which isn't feasible if you're using a hosting company) or use different elements from $_SERVER.

From the manual page on $_SERVER
PHP documentation said:
The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here.
 
thank you for your reply.
what can i use instead of REQUEST_URI command?
 
Depends on what you need to do. Using $_SERVER['SCRIPT_NAME'] will probably do the trick in most situations. The link in my last post lists all the common elements of $_SERVER and what they do.
 
hi,

$_SERVER['SCRIPT_NAME' is working fine. but now i m receiving this error:

Notice: Undefined index: adlogger_adminglog in \\premfs19\sites\premium19\georgeb\webroot\adlogger\adlogger\admin\loginverify.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at \\premfs19\sites\premium19\georgeb\webroot\adlogger\adlogger\admin\loginverify.php:36) in \\premfs19\sites\premium19\georgeb\webroot\adlogger\adlogger\admin\loginverify.php on line 37

loginverify.php line 36 and line 37:
if ($_SESSION["$admin_cookie"] != $login_hash) {
header("Location: ./login.php?ref=" . urlencode($_SERVER['SCRIPT_NAME']));

what can i do? it is most important for me. thank you very much.
 
the key problem is the notice that has been generated. that then causes the other problems.

the notice is generated because you do not have a session variable called $_SESSION['adlogger_adminglog'] so when you test for whether that variable is NOT EQUAL TO, php throws a notice saying it can't test it because it does not exist.

if the variable should exist then you need to look elsewhere for the problem. if the variabl emay or may not exist then you need to expand you conditionality to include a test for whether the variable does exist e.g.
Code:
 if (isset ($_SESSION['ad.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top