PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 27th, 2005, 08:54 AM
crrivera crrivera is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 crrivera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 8 sec
Reputation Power: 0
Problem passing the array values from test.php to test2.php

HI,

I'm having problems on web server1 and web server2 with pasing the array values from test.php to test2.php.

when I print $count value return me 0, the array is empty!

I already have this working on web server3.

what could be my problem on the server1 and 2

[web server1]
OS Debian 3.1 kernel 2.4-27
apache 1.3.33
php 4.3.10-2

[web server2]
OS windows xp pro
apache 2.0.52
php 4.3.10

[web server3]
OS sentinix 0.70.5 kernel 2.4-22
apache 1.3.28
php 4.3.2



[test.php]

<form name="form1" id=form1 method="post" action="test2.php">
<SELECT NAME="assigned_to[]" MULTIPLE SIZE="8">
<OPTION VALUE="100">None</OPTION>
<OPTION VALUE="dtype">dtype</OPTION>
<OPTION VALUE="tim_perdue">tim_perdue</OPTION>
<OPTION VALUE="fusion94">fusion94</OPTION>
<OPTION VALUE="precision">precision</OPTION>
<OPTION VALUE="18">michael</OPTION>
<OPTION VALUE="157">jbyers</OPTION>
<OPTION VALUE="251">Lectric</OPTION>
<OPTION VALUE="149">baddog</OPTION>
<OPTION VALUE="105">mrzenn</OPTION>
</SELECT>

<input type="submit" name="submit" value="submit"/>
</form>

[test2.php]

<?php

$count= count($assigned_to);

for ($i=0; $i<$count; $i++) {
echo $assigned_to[$i];

}

?>

Reply With Quote
  #2  
Old January 27th, 2005, 10:26 AM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 5
Do you have register_globals turned on on server 3?

Reply With Quote
  #3  
Old January 27th, 2005, 12:01 PM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Canada
Posts: 331 Viper_SB User rank is Private First Class (20 - 50 Reputation Level)Viper_SB User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 h 53 m 7 sec
Reputation Power: 6
try this instead
[test2.php]
PHP Code:
print '<pre>';
print_r($_POST['assigned_to']);
print 
'</pre>'

Reply With Quote
  #4  
Old January 27th, 2005, 04:16 PM
crrivera crrivera is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 crrivera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 8 sec
Reputation Power: 0
register_globals on

Quote:
Originally Posted by Madpawn
Do you have register_globals turned on on server 3?


was off. now are on and working. thanks

But what about Security issues about using it on?

Do you know what changes I need to do to work with register_globals=off.

Thnaks

Reply With Quote
  #5  
Old January 28th, 2005, 09:31 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Personally I think the code looks more structured with it turned off...
but feel free to read the register_globals documentation

Quote:
When on, register_globals will inject (poison) your scripts will all sorts of variables, like request variables from HTML forms. This coupled with the fact that PHP doesn't require variable initialization means writing insecure code is that much easier. It was a difficult decision, but the PHP community decided to disable this directive by default. When on, people use variables yet really don't know for sure where they come from and can only assume. Internal variables that are defined in the script itself get mixed up with request data sent by users and disabling register_globals changes this.



I think you'd be better off leaving it off and updating your code to reflect that.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Problem passing the array values from test.php to test2.php


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT