Print Page | Close Window

PHP code

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=6246
Printed Date: 30 March 2026 at 7:50am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: PHP code
Posted By: zMaestro
Subject: PHP code
Date Posted: 08 October 2003 at 2:43am

I know NOTHING in php...

I want a code that is equivelent to this pleez:

Response.Write (Request.servervariables("http_host"))




Replies:
Posted By: Gullanian
Date Posted: 08 October 2003 at 6:55am

Try:

$_SERVER['HTTP_REFERRER']



Posted By: KCWebMonkey
Date Posted: 08 October 2003 at 7:01am

<?php echo $_HTTP_SERVER_VARS["HTTP_HOST"]; ?>

also,

using this will spit out all the predefined variables: <?php phpinfo(); ?>



Posted By: zMaestro
Date Posted: 21 October 2003 at 8:51am

Originally posted by zMaestro zMaestro wrote:

I know NOTHING in php...

i wrote: <h1>$_SERVER['HTTP_REFERRER']</h1>

and it wrote: ........................................................

have a look plz:

http://www.it-egypt.com/default.php - http://www.it-egypt.com/default.php



Posted By: zMaestro
Date Posted: 21 October 2003 at 8:58am

neither this worked:

<h1><?php $_SERVER['HTTP_REFERRER']?></h1>



Posted By: KCWebMonkey
Date Posted: 21 October 2003 at 9:10am

It won't work unless there IS a referrer...

<edit> you have to come to that page from a link on another page, and then the referrer will have a value. </edit>



Posted By: zMaestro
Date Posted: 21 October 2003 at 9:20am

Response.Write (Request.servervariables("http_host")) doesn't need a Refferer..

 

I'm trying now...



Posted By: KCWebMonkey
Date Posted: 21 October 2003 at 9:39am
Originally posted by zMaestro zMaestro wrote:

Response.Write (Request.servervariables("http_host")) doesn't need a Refferer..

referrer means "referring page". there must be a referring page if you want that server variable to have a value...



Posted By: zMaestro
Date Posted: 21 October 2003 at 10:20am

NO,

<%Response.Write (Request.servervariables("http_host"))%>

works without a referrer, and in this case ServerVariables works without having a referer



Posted By: zMaestro
Date Posted: 21 October 2003 at 10:30am

I didn't expect that a Linux Server will support ASP

I think ChilisASP or whatever it is named is good

http://it-egypt.com/default.asp - http://it-egypt.com/default.asp

http://it-egypt.com/default.php - http://it-egypt.com/default.php

the <%= Request.servervariables("http_host")%> worked on Linux
(and without a referrer)

NO NEED FOR PHP

lol (Professional Home Pages) lol

Thanks All



Posted By: KCWebMonkey
Date Posted: 21 October 2003 at 10:50am

ok ok...

you were talking about http_host and about http_referrer... got confusing...



Posted By: zMaestro
Date Posted: 21 October 2003 at 4:02pm

this brough the PHP tp work:

<?php echo $_SERVER['SERVER_NAME'] ?>



Posted By: zMaestro
Date Posted: 21 October 2003 at 4:13pm
Originally posted by Gullanian Gullanian wrote:

Try:

$_SERVER['HTTP_REFERRER']

oh.. it was Gullanian who directed us to the HTTP_REFERRER, although i asked for HTTP_HOST, and since i know nothing in php.. i didn't read the code.. just copied and pasted it




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net