General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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 November 29th, 2002, 04:55 AM
rathaur rathaur is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Malaysia
Posts: 82 rathaur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 57 sec
Reputation Power: 7
Help ! Form variables

Hi .

I developed a small system with secured login area for member under win2k enviroment where later I upload it to a linux server. As for my past experience, there is no problem of doing so except a little adjustment . But my recent system, which works fine in Win2k, is not working under linux enviroment. I trace down the
problem where by variables are not passed from the form to action file.
meaning

in file 1: test1.html

<html>
<body>
<form action=test2.php method=post>
name <input type=text name=fname>
<br>
<input type=submit name=submit value=submit>
</html>

and in test2.php

<?
echo" variable name: $fname<br>";
?>

and seems the varibale $fname is empty, meaning the variable is not passed from my test1.html to test2.php ..
but it works fine in win2k enviroment

any suggestion,
__________________
Rathaur
======================
Knowledge is Power

Reply With Quote
  #2  
Old November 29th, 2002, 05:23 AM
Kanu Kanu is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 91 Kanu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Is register_globals set to off?

Try using the $HTTP_POST_VARS['fname'] array.

Reply With Quote
  #3  
Old November 29th, 2002, 12:00 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Rathaur,

Kanu is right; itt sounds like your register_globals are off. In your test 2 script, you can't refer to your variable as $fname. Because register_globals are off, you need to make use of the superglobal arrays:

$_POST['fname'] or $_GET['fname']: depending on the method used in your <form> tags... In this case, you would use the $_POST[] array as your method is set to post.

Hope that helps!

For more information, check out the PHP Manual.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #4  
Old November 30th, 2002, 02:13 AM
rathaur rathaur is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Malaysia
Posts: 82 rathaur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 57 sec
Reputation Power: 7
thanks, the $_post_var works fine

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Help ! Form variables


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 1 hosted by Hostway
Stay green...Green IT