Passing a parameter to the server

This is where you share YOUR scripts with others

Moderators: egami, macek, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Fri Mar 11, 2011 9:50 pm

You can get the name of the file using,$_SERVER['SCRIPT_NAME']

reyborn
New php-forum User
New php-forum User
Posts: 9
Joined: Wed Mar 30, 2011 7:36 am
Contact:

Wed Mar 30, 2011 8:00 am

Getting the server variable script_name will only get the name of the page but not include the passed variables.

You need to get the variable passed and the script name and concantenate it as one string.





reyBorn Online Portal
http://reygcalantaol.com

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Thu Mar 31, 2011 6:14 am

@reyborn - I don't understand why we need to pass the variable? When ever a user visits a page (say page1.html), the server needs to send an email to somebody saying that page1.html has been visited. I think, all we need here is the name of the page that has been visited - correct me if I am wrong.

One way to do this will be - when page1.html is visited, a hidden variable is set to the current page name and the form gets auto submitted to some server.php where $_POST['hiddenvariable'] will give the script name.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests