Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 15th, 2003, 05:59 AM
Dai Dai is offline
Authorized User
 
Join Date: Jun 2003
Location: Swansea, west glamorgan, United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forms and variables

I've started to teach my self php again this time seriously but I've got one small proble and that is

that when I pass a variable from a form to a nother script (doesn't matter whether it's POSTor GET)

it doesn't print in the browser. (see code below) I've checked phpinfo and all seems ok to me

rechecked the script in the book and my scripts and everything seems ok so I'm stumped! Any

suggestions would be appreciated (using foxserv for apache, php etc and maguma studio as the

editor)

<html>
<head>
<title>Form Results</title>
</head>
<body>
<FORM ACTION="handleform.php" METHOD="POST">
First Name:<input type="text" name="firstname" size="20"><br>
Last Name:<input type="text" name="lastname" size="20"><br>
E-mail Address:<input type="text" name="email" size="20"><br>
Comments:<BR>
<textarea name="comments" rows=5 cols=40 wrap="on"></textarea><BR>
<input type="submit" value="SUBMIT" name="submit">
</FORM>
</body>
</html>

<html>
<head>
       <title>Title here!</title>
</head>
<body>
<?php
/* This page recieves and handles the data generated by "form.html"*/

echo "Your first name is $firstname.<br>";
echo "Your last name is $lastname.<br>";
echo "Your E-mail address is $email.<br>";
echo "This is what you had to say:<br>";
echo "$comments";

?>
</body>
</html>

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>
<FORM ACTION="text.php" METHOD="GET">
Who is your favourite author:<BR>
<input type="text" name="author" size="20">
<br>
<br>
<input type="submit" value="SUBMIT">
</FORM>
</body>
</html>

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>
Your favourite author is:
<?php
echo "$author";
?>
</body>
</html>
;):)

What ever makes life easy
__________________
What ever makes life easy
Reply With Quote
  #2 (permalink)  
Old June 15th, 2003, 06:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

What is the value of register_globals variable into
your php.ini file?

...but the Soon is eclipsed by the Moon
Reply With Quote
  #3 (permalink)  
Old June 15th, 2003, 07:02 AM
Dai Dai is offline
Authorized User
 
Join Date: Jun 2003
Location: Swansea, west glamorgan, United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

register_globals = Off

I'ts set to off

What ever makes life easy
Reply With Quote
  #4 (permalink)  
Old June 15th, 2003, 07:09 AM
Dai Dai is offline
Authorized User
 
Join Date: Jun 2003
Location: Swansea, west glamorgan, United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've set register_globals to on and it's working ok now thanks.
:D;)

What ever makes life easy
Reply With Quote
  #5 (permalink)  
Old June 19th, 2003, 02:25 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're much better off NOT setting register_globals to ON. I know it makes coding so much easier but there are lots of security risks involved.

read my FAQ about it:
 http://p2p.wrox.com/archive/beginnin...2002-11/17.asp


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessin variables from various forms anandthecoolest C# 2005 2 March 8th, 2007 03:18 AM
Problem With variables and forms marcrock Classic ASP Databases 1 November 8th, 2005 02:02 PM
Simple 'passing variables between forms' issue... overture C# 4 October 14th, 2005 02:30 PM
Passing variables between forms arcuza General .NET 1 July 11th, 2005 09:08 AM



All times are GMT -4. The time now is 03:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.