PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 22nd, 2004, 06:02 PM
zzz zzz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: icecream island
Posts: 37 zzz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to zzz Send a message via Yahoo to zzz
$_POST to $HTTP_POST_VARS...

if i'm using earlier version of php, such as 4.0.5
and what i know is i need to change $_POST TO $HTTP_POST_VARS..
my question is...how about $_REQUEST and $_COOKIE
do i have to change to another$.... or still can remain the same..something like
Code:
$sql = mysql_query("SELECT * FROM users WHERE username = '$_COOKIE[username]'") OR DIE("Sorry Theres a mysql error.");

and
Code:

$userid = $_REQUEST['id'];
$code = $_REQUEST['code'];

Reply With Quote
  #2  
Old February 22nd, 2004, 07:28 PM
bluephoenix's Avatar
bluephoenix bluephoenix is offline
Levelheaded Curmudgeon
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 507 bluephoenix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 13 m 2 sec
Reputation Power: 2
Send a message via AIM to bluephoenix
RE: $_POST to $HTTP_POST_VARS...

The following comes from php.net/manual/en/reserved.variables.php

Server variables: $_SERVER
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_SERVER_VARS.

Environment variables: $_ENV
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_ENV_VARS.

HTTP Cookies: $_COOKIE
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_COOKIE_VARS.

HTTP GET variables: $_GET
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_GET_VARS.

HTTP POST variables: $_POST
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_POST_VARS.

HTTP File upload variables: $_FILES
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_POST_FILES.

Request variables: $_REQUEST
Note: Introduced in 4.1.0. There is no equivalent array in earlier versions.

Note: Prior to PHP 4.3.0, $_FILES information was also included into $_REQUEST.

Session variables: $_SESSION
Note: Introduced in 4.1.0. In earlier versions, use $HTTP_SESSION_VARS.

Global variables: $GLOBALS
Note: $GLOBALS has been available since PHP 3.0.0.

Reply With Quote
  #3  
Old February 22nd, 2004, 07:48 PM
zzz zzz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: icecream island
Posts: 37 zzz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to zzz Send a message via Yahoo to zzz
RE: RE: $_POST to $HTTP_POST_VARS...

woooops..oh no..can you tell me what can i do with this code
php Code:
Original - php Code
  1.  
  2. <?
  3.  
  4. include("config.php");
  5. include("functions.php");
  6. include("user_check.php");
  7.  
  8. $userid = $_REQUEST['id'];
  9. $code = $_REQUEST['code'];
  10.  
  11. $sql = mysql_query("UPDATE users SET activated='1' WHERE userid='$userid' AND password='$code'");
  12.  
  13. $sql_doublecheck = mysql_query("SELECT * FROM users WHERE userid='$userid' AND password='$code' AND activated='1'");
  14. $doublecheck = mysql_num_rows($sql_doublecheck);
  15.  
  16. if($doublecheck == 0){
  17.     echo "<strong><font color=red>Sorry,<BR>your account could not be activated!</font></strong>";
  18. } elseif ($doublecheck > 0) {
  19.    
  20.     echo "<strong>Your account has been activated!</strong> You may login below!<br />";
  21.     login_form();
  22. }
  23.  
  24. ?>
  25.  

if i'm using php4.0.5, can i still use this code by changing the code, which will be doing the same thing like above...?or i have to get a newer version of php..if i have to, that means i have to edit all my previous code??coz previous codes is using HTTP_POST_VARS and so on....will it affect my current coding progress...?i need ot know..if anybody can tell me ...pls!:

Reply With Quote
  #4  
Old February 23rd, 2004, 01:08 AM
System System is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 665 System User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Message Moved

Thread moved from 'Database Help' to 'PHP Installation' by sliver.

Reason: This is more a php question

Reply With Quote
  #5  
Old February 23rd, 2004, 01:10 AM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 897 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 47 m 45 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: $_POST to $HTTP_POST_VARS...

php Code:
Original - php Code
  1.  
  2. if($HTTP_POST_VARS['id']) {
  3.   $userid=$HTTP_POST_VARS['id']
  4. } elseif($HTTP_GET_VARS['id']) {
  5.   $userid=$HTTP_GET_VARS['id'];
  6. }
  7. if($HTTP_POST_VARS['code']) {
  8.   $code=$HTTP_POST_VARS['code'];
  9. } elseif($HTTP_GET_VARS['code']) {
  10.   $code=$HTTP_GET_VARS['code'];
  11. }

Reply With Quote
  #6  
Old February 23rd, 2004, 05:33 AM
zzz zzz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: icecream island
Posts: 37 zzz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to zzz Send a message via Yahoo to zzz
RE: RE: $_POST to $HTTP_POST_VARS...


Quote:
this
php Code:
Original - php Code
  1.  
  2. if($HTTP_POST_VARS['id']) {
  3.   $userid=$HTTP_POST_VARS['id']
  4. } elseif($HTTP_GET_VARS['id']) {
  5.   $userid=$HTTP_GET_VARS['id'];
  6. }
  7. if($HTTP_POST_VARS['code']) {
  8.   $code=$HTTP_POST_VARS['code'];
  9. } elseif($HTTP_GET_VARS['code']) {
  10.   $code=$HTTP_GET_VARS['code'];
  11. }

to replace this right??
Code:
$userid = $_REQUEST['id'];
$code = $_REQUEST['code'];

but it's not woring at all...still error message :
Parse error: parse error in c:program filesapache groupapachehtdocsloginactivate.php on line 10

line 10 is this.. $userid=$HTTP_GET_VARS['id'];
the whole code look like this
php Code:
Original - php Code
  1. <?
  2.  
  3. include("config.php");
  4. include("functions.php");
  5. include("user_check.php");
  6.  
  7.  
  8. if($HTTP_POST_VARS['id']) {
  9.   $userid=$HTTP_POST_VARS['id']
  10. } elseif($HTTP_GET_VARS['id']) {
  11.   $userid=$HTTP_GET_VARS['id'];
  12. }
  13. if($HTTP_POST_VARS['code']) {
  14.   $code=$HTTP_POST_VARS['code'];
  15. } elseif($HTTP_GET_VARS['code']) {
  16.   $code=$HTTP_GET_VARS['code'];
  17. }
  18.  
  19.  
  20. $sql = mysql_query("UPDATE users SET activated='1' WHERE userid='$userid' AND password='$code'");
  21.  
  22. $sql_doublecheck = mysql_query("SELECT * FROM users WHERE userid='$userid' AND password='$code' AND activated='1'");
  23. $doublecheck = mysql_num_rows($sql_doublecheck);
  24.  
  25. if($doublecheck == 0){
  26.     echo "<strong><font color=red>Sorry,<BR>your account could not be activated!</font></strong>";
  27. } elseif ($doublecheck > 0) {
  28.    
  29.     echo "<strong>Your account has been activated!</strong> You may login below!<br />";
  30.     login_form();
  31. }
  32.  
  33. ?>

thanksss alot...please help...HELP~!!@~!~

Reply With Quote
  #7  
Old February 23rd, 2004, 05:39 AM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: $_POST to $HTTP_POST_VARS...

you are getting the parse error because you forgot to terminate the variable statement with a semicolon ;

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > $_POST to $HTTP_POST_VARS...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |