Jump to content


Photo

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


  • Please log in to reply
5 replies to this topic

#1 Jim from Oakland

Jim from Oakland
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 02 May 2003 - 01:25 AM

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

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 02 May 2003 - 02:45 AM

do you have sample code? this could be a register_globals issue.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 Jim from Oakland

Jim from Oakland
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 02 May 2003 - 03:52 AM

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 \">

#4 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 02 May 2003 - 04:29 AM

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.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#5 Jim from Oakland

Jim from Oakland
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 02 May 2003 - 02:58 PM

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

#6 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 02 May 2003 - 03:08 PM

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.phpfre...opic.php?t=2139

...or are you speaking of controling the error pages? such as 404 file not found, etc.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users