dovetail Posted May 31, 2006 Share Posted May 31, 2006 Hi, I'm unable to pass $_POST information between my form and my .php file. I'm using samples from the Tizag tutorial, but I can't get them to work. If I change the $_POSTs to $_GETs, I still get the same bad result at the bottom. I've also tried other html/.php samples from books, and no luck.Here's my html...-------------------------------------ACTION.HTML-------------------------------------<html><body><h4>Tizag Art Supply Order Form</h4><form action="process.php" method="post"><select name="item"><option>Paint</option><option>Brushes</option><option>Erasers</option></select>Quantity: <input name="quantity" type="text" /><input type="submit" /></form></body></html>-------------------------------------Here's my .php...-------------------------------------PROCESS.PHP-------------------------------------<html><body><?php$quantity = $_POST['quantity'];$item = $_POST['item'];echo "You ordered ". $quantity . " " . $item . ".<br />";echo "Thank you for ordering from Tizag Art Supplies!";?></body></html>-------------------------------------Here's my output, when I fill out the HTML form and submit-------------------------------------"; echo "Thank you for ordering from Tizag Art Supplies!"; ?>------------------------------------- The correct output should have been: You ordered 5 brushes.Thank you for ordering from Tizag Art Supplies!----------------------------------I'm using WAMP5 1.6.3 with the following server configuration:Apache version :Apache/2.0.55 (Win32) PHP version :5.1.4 Loaded extensions :bcmath, calendar, com_dotnet, ctype, date, ftp, hash, iconv, odbc, pcre, Reflection, session, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, apache2handler, mbstring, mysql, mysqli, PDO, pdo_sqlite, SQLite MySQL version :5.0.21-community-ntTools-------------------------------------Please help. Thanks!!! If it helps diagnose the problem, here are the results of phpinfo():~dovetail~PHP Version 5.1.4System Windows NT DOVETAILMEDIA 5.1 build 2600Build Date May 4 2006 10:30:29Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"Server API Apache 2.0 HandlerVirtual Directory Support enabledConfiguration File (php.ini) Path C:\wamp\Apache2\bin\php.iniPHP API 20041225PHP Extension 20050922Zend Extension 220051025Debug Build noThread Safety enabledZend Memory Manager enabledIPv6 Support enabledRegistered PHP Streams php, file, http, ftp, compress.zlibRegistered Stream Socket Transports tcp, udpRegistered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*Zend logo This program makes use of the Zend Scripting Language Engine:Zend Engine v2.1.0, Copyright © 1998-2006 Zend TechnologiesPHP CreditsConfigurationPHP CoreDirective Local Value Master Valueallow_call_time_pass_reference On Onallow_url_fopen On Onalways_populate_raw_post_data Off Offarg_separator.input & &arg_separator.output & &asp_tags Off Offauto_append_file no value no valueauto_globals_jit On Onauto_prepend_file no value no valuebrowscap no value no valuedefault_charset no value no valuedefault_mimetype text/html text/htmldefine_syslog_variables Off Offdisable_classes no value no valuedisable_functions no value no valuedisplay_errors On Ondisplay_startup_errors Off Offdoc_root no value no valuedocref_ext no value no valuedocref_root no value no valueenable_dl On Onerror_append_string no value no valueerror_log c:/wamp/logs/php_error.log c:/wamp/logs/php_error.logerror_prepend_string no value no valueerror_reporting 2039 2039expose_php On Onextension_dir c:/wamp/php/ext/ c:/wamp/php/ext/file_uploads On Onhighlight.bg #FFFFFF #FFFFFFhighlight.comment #FF8000 #FF8000highlight.default #0000BB #0000BBhighlight.html #000000 #000000highlight.keyword #007700 #007700highlight.string #DD0000 #DD0000html_errors On Onignore_repeated_errors Off Offignore_repeated_source Off Offignore_user_abort Off Offimplicit_flush Off Offinclude_path .;C:\php5\pear .;C:\php5\pearlog_errors On Onlog_errors_max_len 1024 1024magic_quotes_gpc On Onmagic_quotes_runtime Off Offmagic_quotes_sybase Off Offmail.force_extra_parameters no value no valuemax_execution_time 30 30max_input_time 60 60open_basedir no value no valueoutput_buffering no value no valueoutput_handler no value no valuepost_max_size 8M 8Mprecision 12 12realpath_cache_size 16K 16Krealpath_cache_ttl 120 120register_argc_argv On Onregister_globals Off Offregister_long_arrays On Onreport_memleaks On Onreport_zend_debug On Onsafe_mode Off Offsafe_mode_exec_dir no value no valuesafe_mode_gid Off Offsafe_mode_include_dir no value no valuesendmail_from no value no valuesendmail_path no value no valueserialize_precision 100 100short_open_tag Off OffSMTP localhost localhostsmtp_port 25 25sql.safe_mode Off Offtrack_errors Off Offunserialize_callback_func no value no valueupload_max_filesize 2M 2Mupload_tmp_dir c:/wamp/tmp c:/wamp/tmpuser_dir no value no valuevariables_order EGPCS EGPCSxmlrpc_error_number 0 0xmlrpc_errors Off Offy2k_compliance On Onzend.ze1_compatibility_mode Off Offapache2handlerApache Version Apache/2.0.55 (Win32) PHP/5.1.4Apache API Version 20020903Server Administrator webmaster@localhostHostname:Port localhost:80Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100Timeouts Connection: 300 - Keep-Alive: 15Virtual Server NoServer Root C:/wamp/Apache2Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_access mod_actions mod_alias mod_asis mod_auth mod_autoindex mod_cgi mod_dir mod_env mod_imap mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_setenvif mod_userdir mod_php5Directive Local Value Master Valueengine 1 1last_modified 0 0xbithack 0 0Apache EnvironmentVariable ValueHTTP_HOST localhostHTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3HTTP_ACCEPT text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5HTTP_ACCEPT_LANGUAGE en-us,en;q=0.5HTTP_ACCEPT_ENCODING gzip,deflateHTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7HTTP_KEEP_ALIVE 300HTTP_CONNECTION keep-aliveHTTP_REFERER [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a]PATH C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\IBM ThinkVantage\Client Security Solution;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\IM;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\SystemRoot C:\WINDOWSCOMSPEC C:\WINDOWS\system32\cmd.exePATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSHWINDIR C:\WINDOWSSERVER_SIGNATURE <address>Apache/2.0.55 (Win32) PHP/5.1.4 Server at localhost Port 80</address>SERVER_SOFTWARE Apache/2.0.55 (Win32) PHP/5.1.4SERVER_NAME localhostSERVER_ADDR 127.0.0.1SERVER_PORT 80REMOTE_ADDR 127.0.0.1DOCUMENT_ROOT C:/wamp/wwwSERVER_ADMIN webmaster@localhostSCRIPT_FILENAME C:/wamp/www/index.phpREMOTE_PORT 2030GATEWAY_INTERFACE CGI/1.1SERVER_PROTOCOL HTTP/1.1REQUEST_METHOD GETQUERY_STRING phpinfo=1REQUEST_URI /?phpinfo=1SCRIPT_NAME /index.phpHTTP Headers InformationHTTP Request HeadersHTTP Request GET /?phpinfo=1 HTTP/1.1Host localhostUser-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5Accept-Language en-us,en;q=0.5Accept-Encoding gzip,deflateAccept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive 300Connection keep-aliveReferer [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a]HTTP Response HeadersX-Powered-By PHP/5.1.4Keep-Alive timeout=15, max=100Connection Keep-AliveTransfer-Encoding chunkedContent-Type text/htmlbcmathBCMath support enabledcalendarCalendar support enabledcom_dotnetCOM support enabledDCOM support disabled.Net support enabledDirective Local Value Master Valuecom.allow_dcom 0 0com.autoregister_casesensitive 1 1com.autoregister_typelib 0 0com.autoregister_verbose 0 0com.code_page no value no valuecom.typelib_file no value no valuectypectype functions enableddatedate/time support enabledTimezone Database Version 2006.1Timezone Database internalDefault timezone America/Los_AngelesDirective Local Value Master Valuedate.default_latitude 31.7667 31.7667date.default_longitude 35.2333 35.2333date.sunrise_zenith 90.583333 90.583333date.sunset_zenith 90.583333 90.583333date.timezone no value no valuedomDOM/XML enabledDOM/XML API Version 20031129libxml Version 2.6.22HTML Support enabledXPath Support enabledXPointer Support enabledSchema Support enabledRelaxNG Support enabledftpFTP support enabledhashhash support enabledHashing Engines md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5iconviconv support enablediconv implementation "libiconv"iconv library version 1.9Directive Local Value Master Valueiconv.input_encoding ISO-8859-1 ISO-8859-1iconv.internal_encoding ISO-8859-1 ISO-8859-1iconv.output_encoding ISO-8859-1 ISO-8859-1libxmllibXML support activelibXML Version 2.6.22libXML streams enabledmbstringMultibyte Support enabledMultibyte string engine libmbflMultibyte (japanese) regex support enabledMultibyte regex (oniguruma) version 3.7.1mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.Directive Local Value Master Valuembstring.detect_order no value no valuembstring.encoding_translation Off Offmbstring.func_overload 0 0mbstring.http_input pass passmbstring.http_output pass passmbstring.internal_encoding no value no valuembstring.language neutral neutralmbstring.strict_detection Off Offmbstring.substitute_character no value no valuemysqlMySQL Support enabledActive Persistent Links 0Active Links 0Client API version 5.0.21Directive Local Value Master Valuemysql.allow_persistent On Onmysql.connect_timeout 60 60mysql.default_host no value no valuemysql.default_password no value no valuemysql.default_port no value no valuemysql.default_socket no value no valuemysql.default_user no value no valuemysql.max_links Unlimited Unlimitedmysql.max_persistent Unlimited Unlimitedmysql.trace_mode Off OffmysqliMysqlI Support enabledClient API library version 5.0.21Client API header version 4.1.7MYSQLI_SOCKET /tmp/mysql.sockDirective Local Value Master Valuemysqli.default_host no value no valuemysqli.default_port 3306 3306mysqli.default_pw no value no valuemysqli.default_socket no value no valuemysqli.default_user no value no valuemysqli.max_links Unlimited Unlimitedmysqli.reconnect Off OffodbcODBC Support enabledActive Persistent Links 0Active Links 0ODBC library Win32Directive Local Value Master Valueodbc.allow_persistent On Onodbc.check_persistent On Onodbc.default_db no value no valueodbc.default_pw no value no valueodbc.default_user no value no valueodbc.defaultbinmode return as is return as isodbc.defaultlrl return up to 4096 bytes return up to 4096 bytesodbc.max_links Unlimited Unlimitedodbc.max_persistent Unlimited UnlimitedpcrePCRE (Perl Compatible Regular Expressions) Support enabledPCRE Library Version 6.6 06-Feb-2006PDOPDO support enabledPDO drivers sqlite, sqlite2pdo_sqlitePDO Driver for SQLite 3.x enabledPECL Module version 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $SQLite Library 3.2.8undefinedReflectionReflection enabledVersion $Id: php_reflection.c,v 1.164.2.33 2006/03/29 14:28:42 tony2001 Exp $sessionSession Support enabledRegistered save handlers files user sqliteRegistered serializer handlers php php_binary wddxDirective Local Value Master Valuesession.auto_start Off Offsession.bug_compat_42 On Onsession.bug_compat_warn On Onsession.cache_expire 180 180session.cache_limiter nocache nocachesession.cookie_domain no value no valuesession.cookie_lifetime 0 0session.cookie_path / /session.cookie_secure Off Offsession.entropy_file no value no valuesession.entropy_length 0 0session.gc_divisor 100 100session.gc_maxlifetime 1440 1440session.gc_probability 1 1session.hash_bits_per_character 4 4session.hash_function 0 0session.name PHPSESSID PHPSESSIDsession.referer_check no value no valuesession.save_handler files filessession.save_path c:/wamp/tmp c:/wamp/tmpsession.serialize_handler php phpsession.use_cookies On Onsession.use_only_cookies Off Offsession.use_trans_sid 0 0SimpleXMLSimplexml support enabledRevision $Revision: 1.151.2.22 $Schema support enabledSPLSPL support enabledInterfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubjectClasses AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueExceptionSQLiteSQLite support enabledPECL Module version 2.0-dev $Id: sqlite.c,v 1.166.2.13 2006/04/18 14:30:15 iliaa Exp $SQLite Library 2.8.17SQLite Encoding iso8859Directive Local Value Master Valuesqlite.assoc_case 0 0standardRegex Library Bundled library enabledDynamic Library Support enabledInternal Sendmail Support for Windows enabledDirective Local Value Master Valueassert.active 1 1assert.bail 0 0assert.callback no value no valueassert.quiet_eval 0 0assert.warning 1 1auto_detect_line_endings 0 0default_socket_timeout 60 60safe_mode_allowed_env_vars PHP_ PHP_safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATHurl_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset= a=href,area=href,frame=src,input=src,form=,fieldset=user_agent no value no valuetokenizerTokenizer Support enabledwddxWDDX Support enabledWDDX Session Serializer enabledxmlXML Support activeXML Namespace Support activelibxml2 Version 2.6.22xmlreaderXMLReader enabledxmlwriterXMLWriter enabledzlibZLib Support enabledStream Wrapper support compress.zlib://Stream Filter support zlib.inflate, zlib.deflateCompiled Version 1.2.3Linked Version 1.2.3Directive Local Value Master Valuezlib.output_compression Off Offzlib.output_compression_level -1 -1zlib.output_handler no value no valueAdditional ModulesModule NameEnvironmentVariable ValueALLUSERSPROFILE C:\Documents and Settings\All UsersCommonProgramFiles C:\Program Files\Common FilesCOMPUTERNAME DOVETAILMEDIAComSpec C:\WINDOWS\system32\cmd.exeFP_NO_HOST_CHECK NOIBMSHARE C:\IBMSHARENUMBER_OF_PROCESSORS 2OS Windows_NTPath C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\IBM ThinkVantage\Client Security Solution;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\IM;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSHPROCESSOR_ARCHITECTURE x86PROCESSOR_IDENTIFIER x86 Family 6 Model 14 Stepping 8, GenuineIntelPROCESSOR_LEVEL 6PROCESSOR_REVISION 0e08ProgramFiles C:\Program FilesRR C:\Program Files\IBM ThinkVantage\Rescue and RecoverySMA C:\Program Files\IBM ThinkVantage\SMA\SonicCentral c:\Program Files\Common Files\Sonic Shared\Sonic Central\SystemDrive C:SystemRoot C:\WINDOWSTEMP C:\WINDOWS\TEMPTMP C:\WINDOWS\TEMPTVT C:\Program Files\IBM ThinkVantageTVTPYDIR C:\Program Files\IBM ThinkVantage\Common\Python24USERPROFILE C:\Documents and Settings\LocalServicewindir C:\WINDOWSAP_PARENT_PID 3672PHP VariablesVariable Value_REQUEST["phpinfo"] 1_GET["phpinfo"] 1_SERVER["HTTP_HOST"] localhost_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3_SERVER["HTTP_ACCEPT"] text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate_SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7_SERVER["HTTP_KEEP_ALIVE"] 300_SERVER["HTTP_CONNECTION"] keep-alive_SERVER["HTTP_REFERER"] [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a]_SERVER["PATH"] C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\IBM ThinkVantage\Client Security Solution;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\IM;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\_SERVER["SystemRoot"] C:\WINDOWS_SERVER["COMSPEC"] C:\WINDOWS\system32\cmd.exe_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH_SERVER["WINDIR"] C:\WINDOWS_SERVER["SERVER_SIGNATURE"] <address>Apache/2.0.55 (Win32) PHP/5.1.4 Server at localhost Port 80</address>_SERVER["SERVER_SOFTWARE"] Apache/2.0.55 (Win32) PHP/5.1.4_SERVER["SERVER_NAME"] localhost_SERVER["SERVER_ADDR"] 127.0.0.1_SERVER["SERVER_PORT"] 80_SERVER["REMOTE_ADDR"] 127.0.0.1_SERVER["DOCUMENT_ROOT"] C:/wamp/www_SERVER["SERVER_ADMIN"] webmaster@localhost_SERVER["SCRIPT_FILENAME"] C:/wamp/www/index.php_SERVER["REMOTE_PORT"] 2030_SERVER["GATEWAY_INTERFACE"] CGI/1.1_SERVER["SERVER_PROTOCOL"] HTTP/1.1_SERVER["REQUEST_METHOD"] GET_SERVER["QUERY_STRING"] phpinfo=1_SERVER["REQUEST_URI"] /?phpinfo=1_SERVER["SCRIPT_NAME"] /index.php_SERVER["PHP_SELF"] /index.php_SERVER["REQUEST_TIME"] 1149061978_SERVER["argv"] Array_SERVER["argc"] 1_ENV["ALLUSERSPROFILE"] C:\Documents and Settings\All Users_ENV["CommonProgramFiles"] C:\Program Files\Common Files_ENV["COMPUTERNAME"] DOVETAILMEDIA_ENV["ComSpec"] C:\WINDOWS\system32\cmd.exe_ENV["FP_NO_HOST_CHECK"] NO_ENV["IBMSHARE"] C:\IBMSHARE_ENV["NUMBER_OF_PROCESSORS"] 2_ENV["OS"] Windows_NT_ENV["Path"] C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\IBM ThinkVantage\Client Security Solution;C:\Program Files\Diskeeper Corporation\Diskeeper\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\IM;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\_ENV["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH_ENV["PROCESSOR_ARCHITECTURE"] x86_ENV["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 14 Stepping 8, GenuineIntel_ENV["PROCESSOR_LEVEL"] 6_ENV["PROCESSOR_REVISION"] 0e08_ENV["ProgramFiles"] C:\Program Files_ENV["RR"] C:\Program Files\IBM ThinkVantage\Rescue and Recovery_ENV["SMA"] C:\Program Files\IBM ThinkVantage\SMA\_ENV["SonicCentral"] c:\Program Files\Common Files\Sonic Shared\Sonic Central\_ENV["SystemDrive"] C:_ENV["SystemRoot"] C:\WINDOWS_ENV["TEMP"] C:\WINDOWS\TEMP_ENV["TMP"] C:\WINDOWS\TEMP_ENV["TVT"] C:\Program Files\IBM ThinkVantage_ENV["TVTPYDIR"] C:\Program Files\IBM ThinkVantage\Common\Python24_ENV["USERPROFILE"] C:\Documents and Settings\LocalService_ENV["windir"] C:\WINDOWS_ENV["AP_PARENT_PID"] 3672 Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/ Share on other sites More sharing options...
Yesideez Posted May 31, 2006 Share Posted May 31, 2006 I can't see what the problem is as everything seems to be right but if you want to validate your data before accepting it you could have a slight problem with using two files. You can merge everything into one file like this:[code]<?php if ($_POST['subsend']) { $quantity=$_POST['quantity']; $item=$_POST['item']; }?><html><body><h4>Tizag Art Supply Order Form</h4><?php if ($quantity&&$item) { ?>You ordered <?=$quantity?> <?=$item?><br />Thank you for ordering from Tizag Art Supplies!<?php } else { ?><form action="process.php" method="post"><select name="item"><option>Paint</option><option>Brushes</option><option>Erasers</option></select>Quantity: <input name="quantity" type="text" /><input type="submit" name="subsend" /></form><?php } ?></body></html>[/code]Thats basically the idea - try that and see how it works. Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40488 Share on other sites More sharing options...
dovetail Posted May 31, 2006 Author Share Posted May 31, 2006 Thank you for trying, Yesideez, though that didn't work either. I created a new file named allinone.php with your code and the the response was:------"; echo "Thank you for ordering from Tizag Art Supplies!"; ?>------Then I tried changing the formaction from process.php to allinone.php, so that it was calling itself. Here's what I received:------Tizag Art Supply Order FormYou orderedThank you for ordering from Tizag Art Supplies!------I'm stumped. [!--quoteo(post=378632:date=May 31 2006, 03:48 AM:name=Yesideez)--][div class=\'quotetop\']QUOTE(Yesideez @ May 31 2006, 03:48 AM) [snapback]378632[/snapback][/div][div class=\'quotemain\'][!--quotec--]I can't see what the problem is as everything seems to be right but if you want to validate your data before accepting it you could have a slight problem with using two files. You can merge everything into one file like this:[code]<?php if ($_POST['subsend']) { $quantity=$_POST['quantity']; $item=$_POST['item']; }?><html><body><h4>Tizag Art Supply Order Form</h4><?php if ($quantity&&$item) { ?>You ordered <?=$quantity?> <?=$item?><br />Thank you for ordering from Tizag Art Supplies!<?php } else { ?><form action="process.php" method="post"><select name="item"><option>Paint</option><option>Brushes</option><option>Erasers</option></select>Quantity: <input name="quantity" type="text" /><input type="submit" name="subsend" /></form><?php } ?></body></html>[/code]Thats basically the idea - try that and see how it works.[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40577 Share on other sites More sharing options...
kenrbnsn Posted May 31, 2006 Share Posted May 31, 2006 It looks like your webserver isn't processing PHP files correctly or you are invoking the script incorrectly.How are you invoking the HTML file with the form?Ken Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40586 Share on other sites More sharing options...
dovetail Posted May 31, 2006 Author Share Posted May 31, 2006 Hi Ken, thanks for trying to help. If I understand your question correctly, I've got the form in .html and it invokes a separate .php file with <form action="process.php" method="post">. Both files are in the same directory. I'm able to execute other php files in the directory just fine, I just can't seem to get anything going with $_POST or $_GET. Ideas?thanks,mark[!--quoteo(post=378732:date=May 31 2006, 10:01 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 31 2006, 10:01 AM) [snapback]378732[/snapback][/div][div class=\'quotemain\'][!--quotec--]It looks like your webserver isn't processing PHP files correctly or you are invoking the script incorrectly.How are you invoking the HTML file with the form?Ken[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40631 Share on other sites More sharing options...
kenrbnsn Posted May 31, 2006 Share Posted May 31, 2006 The reason I ask how you are invoking the "action.html" file is that if you are not using a URL like "http://localhost/action.html", then the PHP file will not be invoked correctly.I saved your files on my laptop and invoked "action.html" two different ways:[ol type=\'1\'][*]I put in the URI "file:///C:/Program%20Files/xampp/htdocs/xxxxxx/phpfreaks/action.html" into the Firefox browser, filled in the form. When I clicked on the "Submit Query", I got the same output as you.[*]When I use the URL "http://localhost/kenrbnsn/phpfreaks/action.html", it works fine.[/ol]When you invoke the file the first way, the Apache webserver is not invoked, so PHP can not be processed.Ken Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40660 Share on other sites More sharing options...
dovetail Posted June 1, 2006 Author Share Posted June 1, 2006 Ken, I was hopeful this was the solution, but alas I reconfirmed that my html form triggers [a href=\"http://localhost/PHP/process.php\" target=\"_blank\"]http://localhost/PHP/process.php[/a], and I again reproduced that bad result.Next, on a lark, I changed the form action to <form action="http://localhost/PHP/process.php" and got the same incorrect result.Anything else I can try?Thank you again for your help.mark[!--quoteo(post=378807:date=May 31 2006, 02:04 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 31 2006, 02:04 PM) [snapback]378807[/snapback][/div][div class=\'quotemain\'][!--quotec--]The reason I ask how you are invoking the "action.html" file is that if you are not using a URL like "http://localhost/action.html", then the PHP file will not be invoked correctly.I saved your files on my laptop and invoked "action.html" two different ways:[ol type=\'1\'][*]I put in the URI "file:///C:/Program%20Files/xampp/htdocs/xxxxxx/phpfreaks/action.html" into the Firefox browser, filled in the form. When I clicked on the "Submit Query", I got the same output as you.[*]When I use the URL "http://localhost/kenrbnsn/phpfreaks/action.html", it works fine.[/ol]When you invoke the file the first way, the Apache webserver is not invoked, so PHP can not be processed.Ken[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40795 Share on other sites More sharing options...
kenrbnsn Posted June 1, 2006 Share Posted June 1, 2006 How did you invoke "action.html". That is the key.Ken Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40857 Share on other sites More sharing options...
dovetail Posted June 1, 2006 Author Share Posted June 1, 2006 I invoked action.html via [a href=\"http://localhost/PHP/action.html\" target=\"_blank\"]http://localhost/PHP/action.html[/a]. It's in the same directory in which I'm able to successfully execute other non-GET non-POST functions.Thanks,Mark[!--quoteo(post=379011:date=Jun 1 2006, 05:32 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 1 2006, 05:32 AM) [snapback]379011[/snapback][/div][div class=\'quotemain\'][!--quotec--]How did you invoke "action.html". That is the key.Ken[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-40917 Share on other sites More sharing options...
knownotknow Posted March 15, 2007 Share Posted March 15, 2007 (I know this is an old post, but I thought i'd respond anyway, just in case.)If you double click to open any .html file , the address will read something like file:///C:/wamp/www/action.html\If this is the case, the webserver will not be processing the files you are viewing, the browser will, and the browser can't process php.What does it say in the address bar of your browser window? For php to be processed sucessfully by your wamp server, it should read http://localhost/PHP/action.html or something like that in the address bar. Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-208174 Share on other sites More sharing options...
legohead6 Posted March 15, 2007 Share Posted March 15, 2007 reomove the action from the form tag all together, use [code]if(isset($_POST['submitbuttonname'])){[/code] instead Quote Link to comment https://forums.phpfreaks.com/topic/10833-problem-with-forms/#findComment-208179 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.