Jump to content

What to replace "$_REQUEST" with, so that it pulls from current page?


ghurty

Recommended Posts

I have a script I am trying to modify.

Currently the script gets the settings from a calender, and when you click on the day it gives you details.

What I am modify it to automatically display todays details:

 

Here is the Original code:

<?php
$day = $_REQUEST["day"];
$month = $_REQUEST["month"];
$year = $_REQUEST["year"];
$locName = $_REQUEST["locname"];
$location = searchLocation($locName);
print $location;
if ($location != "") {
  $caption = "Tidesfor $day, $year, $locName";
  $elevation = $location[3];
  CalculateTidesForDay($month, $day, $year, $location[0], $location[1], $location[2], $elevation, $caption);
}
?>

 

What I have done so for is:

$activelocation = "New York, NY";
$day = date("j");
$month = date("n");
$year = date("Y");

 

I am running into problems with setting the location:

$locName = $_REQUEST["locname"];

Currently it is using an array, and I cant figure out what to replace it with. I want it to use the $activelocation for the array.

 

 

Thanks

Link to comment
Share on other sites

Sorry  ;)

 

Basically, the way it was set up until now was that you made a selection on one page, and it would generate a schedule for you on the second.

I am trying to make it that you only need to display the second page, and it will give you a schedule based on today, and your preset location.

 

However, i am running into a problem,

It used to be, that the settings was set in the web address: "sched.php?day=$day&month=$month&year=$year&locname=$activelocationurl"

 

So I set it that instead of day, month, year, it would do todays info.

But I am having a problem with the location

 

It uses

$locName = $_REQUEST["locname"];
$location = searchLocation($locName);

to build an array of the information about the location: (which is in a .inc file)

for example here is one location:

"Abilene, TX",                32.27,  -99.44, -6, 0, ""

How can I tell it to do that with out using the "$_REQUEST["locname"]" rather by using a preset variable I made earlier:

$activelocation = "New York, NY"
$locName =  ????[$activelocation] 

 

I dont know what to substitute for the?????

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.