Jump to content

Archived

This topic is now archived and is closed to further replies.

Jim from Oakland

How to enable html forms => php, (Apache server)

Recommended Posts

Team PHP

 

I am hoping to do PHP development without having to become an Apache jocky (jock?). I just downloded and installed Apache and php. Html forms do not \"push\" values into the next script. I sure hope there is a \"just do this\" setting for the apache server... XP Home.

 

What is the best source for BASICS about running Apache and PHP?

 

Jim

Share this post


Link to post
Share on other sites

do you have sample code? this could be a register_globals issue.

Share this post


Link to post
Share on other sites

Effigy

 

I am doing nothing exotic, just basic html form In fact, though I am doing pretty well with php itself, topics that are more system and server oriented are totally unfamiliar to me.

 

I doubt it will help much but here is an excerpt of my code. It all works fine on my ISP\'s server. But he does not want me to use his sever for development so I need to work on my own machine. Apache and php seem to be running fine, I just need to set some stuff in Apache I\'m sure.

 

Thanks so much for the help.

 

<?php

// the name of the file to post to is in the variable $postToFileName

Echo\'<form name=\"mail\" method=\"post\" action=\"\' . $postToFileName .\'\">\';

?>

 

Snip

 

<?php

Echo(\'<Input type=\"hidden\" name=\"\'

. \'Item\' . $ItemIndex . \'ID\'

. \'\" value=\"\'

. ${\'Item\' . $ItemIndex . \'ID\'} . \'\">\');

?>

 

Snip

 

<input type=\"submit\" name=\"submit\" value=\" Check-in \">

Share this post


Link to post
Share on other sites

on the page that the form is posted to... try to echo out the variable using echo $_POST[\'input_name\']; this should work. apache would not be the problem unless it gives you a message that the POST method is not allowed on the server.

Share this post


Link to post
Share on other sites

effigy

 

Thanks. As the military folks say, \"I\'m looking through a staw\" when dealing with servers and the greater php environment -- but I am enjoying programming!

 

Question: when I first started hacking (on ISP\'s severs) html form \"variables\" seemed to show up in the \"called\" script \"automatically.\" That is, if I have a hidden control named Test and in Screen1.php then in the script posted to (e.g. screen2.php) I could immediately refer to the variable named $Test without the intermediate step of accesing $_POST[\'Test\']

 

A barely related question: When testing on ISP server (apparently Netscape web server) I got error messages. They were not very helpful but at lest they reported the offending line. Can I do that with Apache?

 

Thanks a billion!

 

Jim

Share this post


Link to post
Share on other sites

referring to variables without the $_POST prefix is based on a php setting called register_globals. if it\'s on you do not need the prefix, but it is the more secure and \"proper\" way i believe.

 

were the error messages related to php? if so you can handle them in the php.ini, or on the fly - take a look at shiva\'s tutorial:

 

http://forums.phpfreaks.com/viewtopic.php?t=2139

 

...or are you speaking of controling the error pages? such as 404 file not found, etc.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.