[PHP] *.PHP save-as dialog
Hi there, I posted this message yesterday: -- I recently upgraded from PHP version 4.0-ish to 4.2.3 on my Linux/Apache machine. AFAIK, Apache is setup correctly (it serves HTML) and PHP works, but only from the command line. If I type php -q php.php test.html the output of phpinfo() is stored in test.html. When I try and look at test.html running on localhost it displays fine, but when I try and view php.php, as save as window pops up. I am not too familiar with Linux. If it was a Windows installation then I would make sure the Action application (path to php.exe) line was correct, but I can't find this in the Linux httpd.conf. Does this issue sound familiar to anyone. Could anyone point me in the right direction? - I am still having the same problem. It is obviously a problem with my httpd.conf file. PHP is installed as a CGI, and the AddHandler application/x-httpd-php .php is present. Can anyone offer any other suggestions? Below is my httpd.conf file. My apologies for inserting so many lines, but this is an extremely niggling problem, and I... just... can't... figure... it... out /shatner. If anyone could have a quick look to try and identify the problem, I would really appreciate it! Thanks. - Best regards, Lee Reilly -- ## httpd.conf - configuration for the Apache web server # # Generated automatically... if you edit manually, the changes will be lost # the next time you run apacheconfig. # # What we listen to # ServerType StandAlone ServerRoot /etc/httpd/ # We don't handle this yet... # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Please read the file README.DSO in the Apache 1.3 distribution for more # details about the DSO mechanism and run `httpd -l' for the list of already # built-in (statically linked and thus always available) modules in your httpd # binary. # # Note: The order is which modules are loaded is important. Don't change # the order below without expert advice. # # Example: # LoadModule foo_module modules/mod_foo.so #LoadModule mmap_static_module modules/mod_mmap_static.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule env_module modules/mod_env.so LoadModule config_log_module modules/mod_log_config.so LoadModule agent_log_module modules/mod_log_agent.so LoadModule referer_log_module modules/mod_log_referer.so #LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule mime_modulemodules/mod_mime.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule status_module modules/mod_status.so LoadModule info_modulemodules/mod_info.so LoadModule includes_modulemodules/mod_include.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule dir_module modules/mod_dir.so LoadModule cgi_module modules/mod_cgi.so LoadModule asis_modulemodules/mod_asis.so LoadModule imap_modulemodules/mod_imap.so LoadModule action_module modules/mod_actions.so #LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule access_module modules/mod_access.so LoadModule auth_modulemodules/mod_auth.so LoadModule anon_auth_module modules/mod_auth_anon.so LoadModule db_auth_module modules/mod_auth_db.so #LoadModule digest_module modules/mod_digest.so #LoadModule proxy_module modules/libproxy.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule example_module modules/mod_example.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_modulemodules/mod_setenvif.so #LoadModule bandwidth_module modules/mod_bandwidth.so #LoadModule put_modulemodules/mod_put.so IfDefine HAVE_PERL LoadModule perl_modulemodules/libperl.so /IfDefine IfDefine HAVE_PHP LoadModule php_module modules/mod_php.so /IfDefine IfDefine HAVE_PHP3 LoadModule php3_modulemodules/libphp3.so /IfDefine IfDefine HAVE_PHP4 LoadModule php4_modulemodules/libphp4.so /IfDefine IfDefine HAVE_DAV LoadModule dav_module modules/libdav.so /IfDefine IfDefine HAVE_ROAMING LoadModule roaming_module modules/mod_roaming.so /IfDefine IfDefine HAVE_SSL LoadModule ssl_module modules/libssl.so /IfDefine # Reconstruction of the complete module list from all available modules # (static and shared ones) to achieve correct module execution order. # [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO] ClearModuleList
Re: [PHP] *.PHP save-as dialog
Thanks for your reply. I took out the following lines, and restarted Apache, but I still have the same problem... /IfDefine IfDefine HAVE_PHP LoadModule php_module modules/mod_php.so /IfDefine IfDefine HAVE_PHP3 LoadModule php3_modulemodules/libphp3.so /IfDefine IfDefine HAVE_PHP4 LoadModule php4_modulemodules/libphp4.so /IfDefine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Installation problem - httpd.conf issue?
Hi there, I recently upgraded from PHP version 4.0-ish to 4.2.3 on my Linux/Apache machine. AFAIK, Apache is setup correctly (it serves HTML) and PHP works, but only from the command line. If I type php -q php.php test.html the output of phpinfo() is stored in test.html. When I try and look at test.html running on localhost it display sfine, but when I try and view php.php, as save as window pops up. I am not too familar with Linux. If it was a Windows installation then I would make sure the Action application (path to php.exe) line was correct, but I can't find this in the Linux httpd.conf. Does this issue sound familar to anyone. Could anyone point me in the right direction? Thanks very much. - Best regards, Lee Reilly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq))
Hi, I wonder if someone can help me solve this niggling problem: I have a hyperlink [javascript:openwindow('http:myserver/files.php?expid=67.iq')], which passes the argument 'expid' to the PHP script, where 'expid' is the name of a file. I want to take the file data and put it into a string. When I do so by naming the file in the script it works fine e.g. $fcontents = join ('', file ('myserbver/files/67.iq')); But when I do $fcontents = join ('', file ('myserver/files/$expid')); // where $expid = 67.iq I get the following errors --- Warning: file(myserver/files/$expid) - No error in c:\program files\apache group\apache\htdocs\sasdap\v5\files.php on line 4 Warning: Bad arguments to join() in c:\program files\apache group\apache\htdocs\sasdap\v5\files.php on line 4 --- I've also tried $file_location=myserver/files/$expid; $fcontents = join ('', file ('$file_location')); I'm new to PHP and am so far only working with the online documentation. Can anyone help and/or explain the problem? Thanks in advance ;-) - Best regards, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq))
Okay, I see the problem. No reply necessary. Cheers, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] file upload problem - Warning: Max file size of 8 bytes exceeded
Hi, I have an HTML form containing a file upload form object called 'file'. When I submit the form (either holiding a path to a 1kb file or a 7MB file) I get the following error: - Warning: Max file size of 8 bytes exceeded - file [file] not saved in Unknown on line 0 - I had hoped that by changing the upload_max_filesize value in the php.ini this problem would be resolved, but it hasn't. I expect some people have had similar problems in the past; can anyone suggest what the problem is? Some additional info at the foot of this message. Thanks in advance! - Best regards, Lee Windows 2000; PHP4; Apache V1.3 PHP.INI reads: -=-=-==-=-=-=-= ; Maximum allowed size for uploaded files. upload_max_filesize = 8M -=-=-==-=-=-=-= Simplified PHP script reads: -=-=-==-=-=-=-= if ($file!=){ @copy($file, c:\Program Files\Apache Group\Apache\htdocs\sasdap\v4 or die (Could not copy the file.); } else { die(No input file specified); } -=-=-==-=-=-=-= .HTML's file upload name = file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] header(Location:blah...) - passing variables
Hi, I wonder if someone could tell me whether or not the following is possible? I have an HTML form which passes a username and password to a PHP script for validation. If either is not valid, I would like it to return to the previous page - carrying with it a variable plus the submitted form information... =-=-=-=-=-=-=-=-= if (strlen ($password1) 4 ) { $err = Password must be more than 4 characters long; header(Location:http://somelocation.php;); // ^-- at the location, the $err and form variables will be available exit; } =-=-=-=-=-=-=-=-= Is it possible to this without using an HTML form? Thanks very much in advance. - Best regards, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] newbie: Supplied argument is not a valid MySQL result..?
Hi, I wonder if someone could point out what is wrong with the following piece of code (taken directly from the 'PHP - fast easy web development' book) , which gives the following warning : Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\cms\pick_modcontact.php on line 23 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $result = mysql_query($sql,$connection);--line 23 while ($row = mysql_fetch_array($result)) { $id = $row['id']; $fname = $row['fname']; $lname = $row['lname']; $option_block .= option value=\$id\$lname, $fname/option; } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The mySQL query that is executed returns a result set when I use the mySQL shell, and the connection string is valid. If someone could advise me as to the error, I would greatly appreciate it. - Best regards, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: newbie: Supplied argument is not a valid MySQL result..?
No reply required; I see the problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]