473,383 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Current url

This might be the dumb one for the day but, I need a PHP function (or
whatever) similar to the JavaScript "self.location" in PHP.

Will someone please put me out of my misery.

Thanks

May 2 '07 #1
3 2909
In article <11**********************@e65g2000hsc.googlegroups .com>,
ft310 <to*****@fullchannel.netwrote:
>This might be the dumb one for the day but, I need a PHP function (or
whatever) similar to the JavaScript "self.location" in PHP.
Look at the header() function in the php documentation. A call like
header("Location: http://example.com/mypage.php?etc") will cause an
instant redirect to that page.

If you want the script to know the URL of the page that called it, use
the predefined variable $_SERVER[] - see
http://us.php.net/manual/en/reserved.variables.php

For example, $_SERVER['PHP_SELF'] in a script at the address
http://example.com/mypage.php?etc would be /mypage.php/etc

Hope that helps. -A
May 2 '07 #2
On May 2, 5:46 pm, a...@spamcop.net (axlq) wrote:
In article <1178140660.159901.169...@e65g2000hsc.googlegroups .com>,

ft310 <tooh...@fullchannel.netwrote:
This might be the dumb one for the day but, I need a PHP function (or
whatever) similar to the JavaScript "self.location" in PHP.

Look at the header() function in the php documentation. A call like
header("Location:http://example.com/mypage.php?etc") will cause an
instant redirect to that page.

If you want the script to know the URL of the page that called it, use
the predefined variable $_SERVER[] - seehttp://us.php.net/manual/en/reserved.variables.php

For example, $_SERVER['PHP_SELF'] in a script at the addresshttp://example.com/mypage.php?etcwould be /mypage.php/etc

Hope that helps. -A
Thank you very much

May 2 '07 #3
ft310 schreef:
On May 2, 5:46 pm, a...@spamcop.net (axlq) wrote:
>In article <1178140660.159901.169...@e65g2000hsc.googlegroups .com>,

ft310 <tooh...@fullchannel.netwrote:
>>This might be the dumb one for the day but, I need a PHP function (or
whatever) similar to the JavaScript "self.location" in PHP.
Look at the header() function in the php documentation. A call like
header("Location:http://example.com/mypage.php?etc") will cause an
instant redirect to that page.

If you want the script to know the URL of the page that called it, use
the predefined variable $_SERVER[] - seehttp://us.php.net/manual/en/reserved.variables.php

For example, $_SERVER['PHP_SELF'] in a script at the addresshttp://example.com/mypage.php?etcwould be /mypage.php/etc
Be aware that $_SERVER['PHP_SELF'] can be tweaked (since it contains GET
parameters), thus if you want to be safe you should not use it for
generation of <form action='"'>...
--
Tim Van Wassenhove - Read my mind <url:http://www.timvw.be/>
May 3 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Don G | last post by:
Within the menu for my site, I have inserted 'class="current"' within the link for the current page. So the link looks somthing link: <li><a href="index.php" class="current">Home</a></li> The...
14
by: deko | last post by:
This runs, but does not narrow to current week. suggestions appreciated! SELECT lngEid, dtmApptDate, Subject, Appt_ID FROM qry002 WHERE (dtmApptDate BETWEEN DateAdd("d",-weekday()+2,) And...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
0
by: Nayt Grochowski | last post by:
Does anyone see any problem with the loading a SqlConnection into the System.Web.HttpContextCurrent.Items collection in a Page's Constructor. Then Closing and Disposing of it the OnUnload method? ...
3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
0
by: Aaron Morton | last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event from the HttpApplication, if the event is raised after EndRequest then HttpContext.Current is null. If it is raised before...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
2
by: Dave | last post by:
After some digging, I discovered HttpContext.Current.Session is null when trying to access a session variable, username, in my upload.cs code which is in the App_Code folder. I just determined...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.