php-windows Digest 28 Aug 2004 06:07:56 -0000 Issue 2374
Topics (messages 24458 through 24461):
Newbie Question: PHP/Appache/WINXP/MySQl
24458 by: Bestman4unowwa.aol.com
24459 by: Gryffyn, Trevor
PHP/MySQL fatal error
24460 by: gc
File permissions in XP
24461 by: Warren Vail
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Does the PHP script have to be already running to communicate send a HTTP Post
varibale to it (from a DHTML client browser)? Or can it initiate the HTTP Post fron
the client that activates the PHP script?
I know this must seems simple but I'm having troble receiving these varible from my
client. When I find out the value of the vaiable I stick it into a MySQL table. Both
client DHTML and server PHP work well alone but I can't seem to et the connection
going using localhost.
--- End Message ---
--- Begin Message ---
When you click "submit" on a POST method form, it'll go to whatever file
is specified in the "action=" part of the FORM and send the POST data to
it for processing. PHP scripts are executed when called, they're never
"already running" although you could probably have a case where you
could (and might want) to do that, but for 99.9% of the cases, it's
called, it executes, it outputs or does whatever it does, then it
closes.
Do you know if you're receiving the variable data (that it's a
"receiving" problem) versus a problem storing the value into the MySQL
table?
A common issue is with the "register globals" being turned ON on one
system you're testing on and turned OFF on another. It should be "OFF"
(the default in all the latest PHP versions) in which case you need to
use $varname = $_GET["varname"] or $varname = $_POST["varname"]
depending on the METHOD of your form.
If you are POSTing it, try a:
Var_Dump($_POST);
And make sure you see your data in there. If it's in there and not
getting inserted into MySQL, then that's another question.
Posting a bit of your PHP code can help us help you.
Good luck!
-TG
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 27, 2004 12:37 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Newbie Question: PHP/Appache/WINXP/MySQl
>
>
> Does the PHP script have to be already running to communicate
> send a HTTP Post varibale to it (from a DHTML client
> browser)? Or can it initiate the HTTP Post fron the client
> that activates the PHP script?
>
> I know this must seems simple but I'm having troble receiving
> these varible from my client. When I find out the value of
> the vaiable I stick it into a MySQL table. Both client DHTML
> and server PHP work well alone but I can't seem to et the
> connection going using localhost.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi all,
I'm Gene Candelaria and I'm a PHP and MySQL newbie.
I have a feeling a lot of you have seen this before. I'm teaching myself
PHP/MySQL trying to setup a guestbook. I'm running latest versions of
Apache, PHP and MySql on my WIN2k machine. I have them working, except, I
get the messages:
"Fatal error: Call to undefined function mysql_connect() "
"Fatal error: Call to undefined function mysql_pconnect() "
when serving two of my php docs (code snippets below). I've been reading and
searching and trying all sorts of things to fix this and nothing works. I've
removed the comment from the line "extension=php_mysql.dll" in php.ini.
(Below is the MySQL section of php.ini. It's pretty standard, I'm using
defaults.) I edited my Apache config file with the needed lines:
### Section 4: PHP 5 Module
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
LoadModule php5_module php/php5apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/Program Files/Apache Group/Apache2/PHP"
When I run my test.php doc, MySQL is not listed. Do I need to enable it in
the configure command? How do I edit the configure command. Per my test.php,
It now reads:
Configure Command cscript /nologo configure.js "--with-gd=shared"
"--enable-snapshot-build"
Online I read these comments:
Ok, your php.ini file is set to 'on' for mysql.allow_persistent, but is
mysql really enabled? Does your configure command look something like
this?
'./configure' '--with-mysql=/usr/local/mysql'
............................................
If you don't have --with-mysql it means that you cannot use mysql functions,
so compile PHP again
with this option.
How do I edit that pesky configure command. I searched, but couldn't find an
answer. So, where am I going wrong? Thanks for reading and big thanks for
any help.
gene
[EMAIL PROTECTED]
php.ini snippet (comments removed for easier reading:
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
guest.php code snippet:
//connect
// change localhost to your db host name
mysql_pconnect( "http://aulon.dyndns.org/", "$username", "$password")
or die( "Unable to connect to SQL server");
mysql_select_db( "$db_name") or die( "Unable to select database");
guestbook.php code snippet:
// Connect to DB
$li = mysql_connect($dbHost, $dbUser, $dbPass) or die("Could not connect");
mysql_select_db($dbDatabase, $li) or die ("could not select DB");
--- End Message ---
--- Begin Message ---
I can't figure out how to define permissions so that php scripts running
under an apache server can create files in a directory. When I browse the
directory with the explorer, I notice the read only attribute is set and I
can't seem to clear it in windows xp professional, even with the dos attrib
command. I'm not sure this is related to my problem but it seem logical to
me. What am I missing?
Warren Vail
--- End Message ---