Despite good help, still can't get this form post working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

could it be a 'register globals' problem in php.ini file??
mikeb
Forum Commoner
Posts: 60
Joined: Tue Jul 08, 2003 4:37 pm
Location: Dublin, Ireland

Post by mikeb »

Hi,

A new day!

Jason

I have set up a server to work on at home after office hours - this is where I am learning php. Here is my config

Win2k sp3 (ntfs configuration)
php4.0.4
Apache 2
MySQL 4.0.13-nt

I have only dial-up at home so I can't show you my phpinfo page live.
I have run the phpinfo file locally and copied and pasted the results for you as a browseable html page. You can view it at one of my sites, here:

http://www.corkholidayhomes.com/php/myinfo.htm

*Note: this site does NOT have php istalled. I'm using it just for showing
you the code. The server in question is my local machine at home.


Here is the exact up to date code for the form page:
----------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<body>

<form name="newform" method="post" action="formaction.php">
<input type="text" name="FirstName"><br>
<input type="submit" name="submit">
</form>

</body>
</html>
----------------------------------------------------------------------------------
and here is the code for the action page (formaction.php)
----------------------------------------------------------------------------------
<html>
<head>
<title>hello</title>
</head>
<body>
<?php
echo $_POST['FirstName'];
?>
</body>
</html>
----------------------------------------------------------------------------------
My php ini file can be browsed at:
http://www.corkholidayhomes.com/php/php.txt
and my Apache config at:
http://www.corkholidayhomes.com/php/httpdconf.txt

I hope that sheds some light on the subject, and thank you all for your help
[/url]
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

php4.0.4

That's your problem. $_POST (and the rest of the superglobals) don't exist in that version. You would be best off upgrading to the latest version 4.3.x. The new features will help out tremendously.
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post by mrvanjohnson »

Great Catch jason!
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

also, windows, even nt, is unstable. as good as nt is, you' be better off creating a home network and buying a cheapo second machine and putting on a real operating system... something posix compliant. red hat 9 server has php, apache and mysql as options. install them. they will be locked down correctly that way.

there's a bunch of websites you can get refurbished computers at for $200 or less. p2 through p3 speeds ranging from 200 mHz to 1 gHz (what i've seen)

unix is much more stable, and the versions it will install aer:

mysql: 11.18 dist 3.23.56 (higher than what you have and with a number of fixes and things to improve upon what you have, the next step beyond this is 4.0)

php: 4.2.2 (again, much better than what you have)

apache: 2.0.40
mikeb
Forum Commoner
Posts: 60
Joined: Tue Jul 08, 2003 4:37 pm
Location: Dublin, Ireland

Post by mikeb »

Guess what? Midday Saturday here and I've just got the whole shooting match working! Thanks a million for all you help guys. I upgraded and that did the trick. I'm now on the version 5 beta (Hoping that at least for the moment I won't be doing any programming serious enough to find any bugs!). Anyhow, it's now working perfectly.

m3rajk, I take your point on the Linux issue. As it happens, I have a new machine with a dual-boot of Red Hat Linux 8/Win2k which is what I'm cutting my teeth on. I'm setting up a Linux server on another machine but I'm trying to walk before I run. My overall plan is to have a Linux server doing mail and web services etc. with my main machine running on it's current split configuration. So I've got php, Apache and MySQL to sort out on the Win2k machine and then I delve into Linux. If my IT person in work has his way we'll all be on Linux by the end of the year, have grown beards and nodding knowingly at hex dumps on our screen :wink:

cheers and again thanks for the help all. No doubt I'll be back for more!

Mike
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

you don't wanna use a split for a server. you want to have servers up as much as possible. to quote a friend from when i was working in network operations at brandeis "no computer should ever have to be rebooted...unless you're talking about windows, but that's because bill gates can't make an operating system"


remember, windows has never actually met dod security reqs. reason it's been used is they've paid more so the army has done more to find work arounds. the nsa is currently working with redhat and apache to make a linux/apache that actually does meet it, and from what i've heard, in the first 3 months they got father than microsoft EVER got. that's the rumor at any rate...

since linux is stable (unlike windows) and apache is better than iis, if you really wanna get the full feel and ot wonder if your issues are os based, you should first get used to posix .

btw: upgrade to 9. in the unix world you need to keep up with updates. it moves faster than windows because it's opensource, so intelligent people are actually patching it, the things get fixed, not changed how the holes work.

9 also has a better gui than 8 and while you get used to linux you'll need the gui.
Post Reply