Wrox Programmer Forums
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2006, 01:51 AM
Authorized User
 
Join Date: Jan 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help!

///////////////////////Help!/////////////////////////////////////

1- $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
2- if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
3- $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

1- If i am right the line one shows that this form will take action on this same page.

2- what the line 2 explain with respect of this variable['QUERY_STRING'], either it is not declared anywhere on this page just on this place.

3- What the line 3 shows, i am not gettin understand.

what is the difference between $_request[] and $HTTP_SERVER_VARS.

I have spent alot of my time to understand this from manuel but in vain.

plz help me to get this understand.
I will b very thankful to u for his.
Thanks.

 
Old January 27th, 2006, 02:41 AM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Line 1: $editFormAction is being set to the script's file name
Line 2: if a query string exists go to Line 3
Line 3: "?" and the query string is appended to the $editFormAction variable

If you're not sure what a query string is, look in the address bar on your web browser, you should see something similar to "topic.asp?TOPIC_ID=39208" everything after the "?" is a query string.

Lets say your file name is script.php, lets say your query string is "?cmd=run", your piece of code will set $editFormAction to "script.php?cmd=run"

$_REQUEST: An associative array consisting of the contents of $_GET, $_POST, and $_COOKIE.
$HTTP_SERVER_VARS: Is an array containing information such as headers, paths, and script locations.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.