Page 1 of 1

I have 2 questions

Posted: Fri Aug 29, 2003 12:49 am
by seeker2921
1st question:

I wrote the simple date script below and It wokrs but my server is on the east coast and I need the timezone to be in PST format not EST.. heres the code:

Code: Select all

<?
//Img paths
$monday=("http://www.alien-web-networks.com/htm/images/date/monday.gif");
$tuesday=("http://www.alien-web-networks.com/htm/images/date/tuesday.gif");
$wendnesday=("http://www.alien-web-networks.com/htm/images/date/wednesday.gif");
$thursday=("http://www.alien-web-networks.com/htm/images/date/thursday.gif");
$friday=("http://www.alien-web-networks.com/htm/images/date/friday.gif");
$saturday=("http://www.alien-web-networks.com/htm/images/date/saturday.gif");
$sunday=("http://www.alien-web-networks.com/htm/images/date/sunday.gif");
$zone=("pst");
$img_date=date("w");
$time=date(" h:i a ");
$date=date("F j, Y");
 if($img_date=="0")
 {
 print("<img src="$sunday"> ".$date.$time.$zone);
 }
 if($img_date=="1")
 {
 print("<img src="$monday"> ".$date.$time.$zone);
 }
 if($img_date=="2")
 {
 print("<img src="$tuesday"> ".$date.$time.$zone);
 }
 if($img_date=="3")
 {
 print("<img src="$wednesday"> ".$date.$time.$zone);
 }
 if($img_date=="4")
 {
 print("<img src="$thursday"> ".$date.$time.$zone);
 }
 if($img_date=="5")
 {
 print("<img src="$friday"> ".$date.$time.$zone);
 }
 if($img_date=="6")
 {
 print("<img src="$saturday"> ".$date.$time.$zone);
 }
?>
2nd Question

On my site I want all the other pages to call to the index.php for the links so say I have the page:
..doc_root/htm/info/info.php

and one of the links on that page leads to my order page so when someone clicks the link it will go to the index.php page and then go to the link like that.. so the address would be

http://www.domain.com/index.php?id=order

instead of

http://www.domain.com/htm/order/order.php

I hope I explained what I want well enough.. I am still a beginner and i'm not sure how to do that.. thanx for your help on both of my questions

Posted: Fri Aug 29, 2003 5:40 am
by tylerdurden
Question 1:
Maybe there is a function to do this but the first solution that comes to mind is this:

Code: Select all

echo date("w",time() -21600);
where 21600 is: offset in hours * 360, so you have the number of seconds.

Question 2:

You could call an include like this:

Code: Select all

include ($_GET&#1111;'id'].".php");
or redirect via HTTP header:
header("Location: &#123;$_GET&#1111;'id']&#125;.php");
The syntax in the above examples may be wrong, but you get the idea.