ghurty Posted August 19, 2007 Share Posted August 19, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/65721-what-to-replace-_request-with-so-that-it-pulls-from-current-page/ Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 What ?!! maybe $location[0] = "X"; $location[1] = "Y"; $location[2] = "Z"; but you lost me!! Quote Link to comment https://forums.phpfreaks.com/topic/65721-what-to-replace-_request-with-so-that-it-pulls-from-current-page/#findComment-328299 Share on other sites More sharing options...
ghurty Posted August 19, 2007 Author Share Posted August 19, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/65721-what-to-replace-_request-with-so-that-it-pulls-from-current-page/#findComment-328310 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.