php-windows Digest 7 Sep 2002 22:26:04 -0000 Issue 1327
Topics (messages 15696 through 15706):
I got a little confusion about mysql and php
15696 by: Raheel Hussain
15702 by: Constantin Baciu
Re: problem with querystring
15697 by: Hans Gruyaert
Help! I will even Donate through Paypal, I only want to make a thumbnail of a picture
through php code.
15698 by: Kurtis Harper
15703 by: Rich Gray
15705 by: Kurtis Harper
Dying socket client kills serveer too ??
15699 by: Sven Schnitzke
Stupid problem: cannot send variables!
15700 by: Elias Lovén Larsson
15701 by: Rich Gray
Re: Calling PHP script with Exec
15704 by: Rich Gray
IMAP install help
15706 by: Admin
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 ---
hi,
I m a newbie programmer and has just started working on php, i m not actually having
much problem in it as because i have backgroud of C/C++ and vb and ASP and Pascal etc.
I have a little confusion , may be it is gonna be a cheap question the question is as
follows
1 - I have a mysql database on my local server on which i m trying php scripts.
now i m gonna upload this site,
I found out a function of mysql through which i m going to create the
mysql db on the sever with phpscripts
which is ( mysql_create_db() )
but i want to write my scripts as follows
if ( database doesn't exists )
create db;
2 - and the other thing which is actually about mysql, which is how do i set different
database passwords to different database.
as because in my server ( win 2000 ) there is only one password which i use when using
mysql_connect() fucntion
---------------------------------
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
--- End Message ---
--- Begin Message ---
"Raheel Hussain" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> hi,
>
> I m a newbie programmer and has just started working on php, i m not
actually having much problem in it as because i have backgroud of C/C++ and
vb and ASP and Pascal etc.
> I have a little confusion , may be it is gonna be a cheap question the
question is as follows
>
> 1 - I have a mysql database on my local server on which i m trying php
scripts.
> now i m gonna upload this site,
> I found out a function of mysql through which i m going to create the
> mysql db on the sever with phpscripts
> which is ( mysql_create_db() )
> but i want to write my scripts as follows
>
> if ( database doesn't exists )
> create db;
As far as I know, in mysql you cannot create a database that is allready
created.... So, the mysql_create_db() function *should* return an error....
>
> 2 - and the other thing which is actually about mysql, which is how do i
set different database passwords to different database.
>
> as because in my server ( win 2000 ) there is only one password which i
use when using mysql_connect() fucntion
>
>
Again, as far as I know, mysql has a user+host+password security setup. That
is, if you have an user (say foo-user) with the password foo-password, you
could give it access only to a database (based on username and password)...
Then you could create another user, with the same name but another
password... and give it access to another database.....
The GRANT syntax is : GRANT ...privileges... on database[.table.[column]]
to user foo.. identified by password...
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
--- End Message ---
--- Begin Message ---
It works! Thanks a lot!
"Matt Kynaston" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Check your php.ini and make sure that register_globals is turned on.
>
> Either that or use:
> if ($_REQUEST['a'] == "X")
> which will give you the variable if its posted, in the query string or a
> cookie.
>
> Second is better in terms of portable code.
>
> Matt
>
> > -----Original Message-----
> > From: Sandeep Murphy [mailto:[EMAIL PROTECTED]]
> > Sent: 06 September 2002 11:10
> > To: hans; [EMAIL PROTECTED]
> > Subject: RE: [PHP-WIN] problem with querystring
> >
> >
> > hi,
> >
> > i chked on my local m/c and it works fine... though i hv win
> > 2k prof on my PC... Can u test the code on another PC??
> >
> > -----Original Message-----
> > From: hans [mailto:[EMAIL PROTECTED]]
> > Sent: sexta-feira, 6 de Setembro de 2002 8:09
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] problem with querystring
> >
> >
> > hi there,
> >
> > i'm having this very strange problem using a querystring...
> > to illustrate me
> > problem i have this file:
> >
> > <form method="post">
> > a: <input type="checkbox" value="X" <? if ($a == "X") echo "checked"
> > ?>><br>
> > b: <input type="checkbox" value="X" <? if ($b == "X") echo "checked"
> > ?>><br>
> > </form>
> >
> > called test.php... when i open the url tesp.php?a=X the
> > checkbox doesn't get
> > checked, and as far as i know some PHP it should be... i'm having this
> > problem with every querystring i use... i'm working with
> > release 4.1.1 on a
> > Windows XP Prof machine...
> >
> > anyone has got an idea?
> >
> > chears,
> > hans
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
--- End Message ---
--- Begin Message ---
Hi Gang,
I am serious, I will send a donation (small- I am not a rich man :o) )
through PayPal, if someone is kind enough to help me out. What I need it
to create a thumbnail of an uploaded picture. I am not fussy on how the PHP
script accomplishes this as long as it works. I tried running Imagemagick
(convert after the file is uploaded) through an exec command with no luck.
I would like to have two files in the folder where the image is uploated :
image.jpg and imagethumbnail.jpg (I want to creat thumbnails on the fly of
pictures users upload). I am running IIS 5, If this is part of my problem I
am willing to change to apache. I am sure this is a simple process since it
is done all the time. If there are otherways to create a thumbnail I am
willing to try that as well. I just can not seem to run the convert.exe
through a PHP file :o(
Is it not possible to run an external progrman (convert.exe) through php
code?
What I am looking for is some detailed instruction on how to go about this,
I have found bits and pieces but there are too many holes in the information
I have so far.
Again Thanks in advance to any help anyone can provide
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
--- End Message ---
--- Begin Message ---
Hi Kurtis
So what error do you get when you run exec on convert.exe?
Rich
-----Original Message-----
From: Kurtis Harper [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2002 08:55
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Help! I will even Donate through Paypal, I only want
to make a thumbnail of a picture through php code.
Hi Gang,
I am serious, I will send a donation (small- I am not a rich man :o) )
through PayPal, if someone is kind enough to help me out. What I need it
to create a thumbnail of an uploaded picture. I am not fussy on how the PHP
script accomplishes this as long as it works. I tried running Imagemagick
(convert after the file is uploaded) through an exec command with no luck.
I would like to have two files in the folder where the image is uploated :
image.jpg and imagethumbnail.jpg (I want to creat thumbnails on the fly of
pictures users upload). I am running IIS 5, If this is part of my problem I
am willing to change to apache. I am sure this is a simple process since it
is done all the time. If there are otherways to create a thumbnail I am
willing to try that as well. I just can not seem to run the convert.exe
through a PHP file :o(
Is it not possible to run an external progrman (convert.exe) through php
code?
What I am looking for is some detailed instruction on how to go about this,
I have found bits and pieces but there are too many holes in the information
I have so far.
Again Thanks in advance to any help anyone can provide
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
LOL, there is no error. It seems as though the does not launch the
convert.exe . Is there rights I have to setup in IIS to allow a program to
be run through PHP. I am not sure if there exec() command is ment for this.
If it is I must be missing something :(
"Rich Gray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Kurtis
> So what error do you get when you run exec on convert.exe?
> Rich
>
> -----Original Message-----
> From: Kurtis Harper [mailto:[EMAIL PROTECTED]]
> Sent: 07 September 2002 08:55
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Help! I will even Donate through Paypal, I only want
> to make a thumbnail of a picture through php code.
>
>
> Hi Gang,
>
> I am serious, I will send a donation (small- I am not a rich man :o) )
> through PayPal, if someone is kind enough to help me out. What I need it
> to create a thumbnail of an uploaded picture. I am not fussy on how the
PHP
> script accomplishes this as long as it works. I tried running Imagemagick
> (convert after the file is uploaded) through an exec command with no luck.
> I would like to have two files in the folder where the image is uploated :
> image.jpg and imagethumbnail.jpg (I want to creat thumbnails on the fly of
> pictures users upload). I am running IIS 5, If this is part of my problem
I
> am willing to change to apache. I am sure this is a simple process since
it
> is done all the time. If there are otherways to create a thumbnail I am
> willing to try that as well. I just can not seem to run the convert.exe
> through a PHP file :o(
> Is it not possible to run an external progrman (convert.exe) through php
> code?
> What I am looking for is some detailed instruction on how to go about
this,
> I have found bits and pieces but there are too many holes in the
information
> I have so far.
>
> Again Thanks in advance to any help anyone can provide
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
--- End Message ---
--- Begin Message ---
Hi,
I'm kinda new at PHP and trying out 4.2.2.on Windows 98 using
Apache 1.3.23 as webserver. however my Problem arises also with calling
PHP -f in the box:
Basically I do (leaving out error checking here):
<?php
// set up listener and wait for clients
$listener = socket_create(AF_INET, SOCK_STREAM, 0);
socket_setopt($listener, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($listener, "0.0.0.0", 1234);
if (socket_listen($listener, 5);
$client = array();
// monitoring loop
while (true)
{
$read[0] = $listener;
// keep track of clients
for ($i = 0; $i < MAX_CLIENTS; i++)
{
if ($client[$i] != null)
$read[$i + 1] = $client[$i];
}
// watch for any socket activity
$nready = socket_select($read, $null, $null, null);
if (in_array($listener, $read))
{
// here we have a new client
for ($i = 0; $i < MAX_CLIENTS; $i++)
{
if ($client[$i] == null)
{
$client[$i] = socket_accept($listener);
break;
}
}
if (--$nready <= 0)
continue;
}
// get data from socket(s) marked as active
for ($i = 0; $i < MAX_CLIENTS; $i++)
{
if (in_array($client[$i], $read))
{
socket_getpeername($client[$i], $host, $port);
$n = socket_read($client[$i], 16300);
if (strlen($n) > 0)
echo "rcv from $host:$port:$n\r\n";
// else close and cleanup socket
}
}
}
Everything works fine as long as I have well-behaved clients.
But if I for example try this against a telnet client and
just close it without properly disconnecting my PHP -f ...
dies with a page fault when getting to "socket_read".
I tried to have a look at "socket_last_error" before reading
but that does not help since it says: 0. "socket_select" lets
loose upon the killing of the client, putting the socket into
the "read" array. So I have to look at it...
Any hints on how I get around this?
Thanks in advance
Sven Schnitzke
--- End Message ---
--- Begin Message ---
I am experiencing major problems with sending variables from forms to PHP
scripts.
Newbie error perhaps, but I have never ever witnessed anything like this
before with PHP!
I am running Apache 1.3.23 with PHP 4.2.3 (SAPI) on Windows XP.
The URL and the code:
http://corner.no-ip.com/me/profiles/test1.php
----------
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<FORM NAME="form1" ACTION="test1.php">
<P>
<INPUT NAME="field" TYPE="text" ID="field">
</P>
<P>
<INPUT TYPE="submit" NAME="Submit" VALUE="Submit">
</P>
</FORM>
<?
echo $field;
$justanothervariable = "data";
echo $justanothervariable;
?>
</BODY>
</HTML>
----------
--- End Message ---
--- Begin Message ---
Either switch on register_globals in php.ini (security implications however)
or use echo $_GET['field'] instead of echo $field.
HTH
Rich
-----Original Message-----
From: Elias Lovén Larsson [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2002 11:32
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-WIN] Stupid problem: cannot send variables!
I am experiencing major problems with sending variables from forms to PHP
scripts.
Newbie error perhaps, but I have never ever witnessed anything like this
before with PHP!
I am running Apache 1.3.23 with PHP 4.2.3 (SAPI) on Windows XP.
The URL and the code:
http://corner.no-ip.com/me/profiles/test1.php
----------
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<FORM NAME="form1" ACTION="test1.php">
<P>
<INPUT NAME="field" TYPE="text" ID="field">
</P>
<P>
<INPUT TYPE="submit" NAME="Submit" VALUE="Submit">
</P>
</FORM>
<?
echo $field;
$justanothervariable = "data";
echo $justanothervariable;
?>
</BODY>
</HTML>
----------
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Nicole
Some comments...
You're redirecting stdout - I would redirect stderr as well i.e. >/dev/null
2>/tmp/errlog.
Can't say about the load on the server - depends entirely on what your
background script does... do you want to throttle the number of spawned
processes or are you happy to let 500 processes get kicked off at once? You
may hit a Linux fork limit with 500+ processes being started....
You may want to add a 'nohup' to the start to supress termination from a
hangup signal.
HTH
Rich
-----Original Message-----
From: Nicole Amashta [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2002 02:29
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Calling PHP script with Exec
Hello PHPWinGroup!
I am writing a php script that will need to call via exec() a 2nd php script
to run in the background. (OS: linux)
I am thinking it would look something like this:
exec("php script2.php $param > /dev/null &");
I haven't actually attempted this yet. Was just hoping for a confirmation
that I am on the right track. And what is the payload of doing something
like this, if say, oh, 500+ people are doing this at the same time? No
access to crons, so can't do that. This is my hack or workaround for not
having scheduling ability. So I just call a 2nd script to run in background
to handle the script that will take longer. Don't want people waiting for a
script to finish.
Some server specs:
OS: linux (on a hosted server i have no access to at all)
Crontab: nope
Thanks!!
--
Nicole
www.aeontrek.com
- - - -
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
can some one direct me to a step-by-step guide to installing
imap support in php 4.2.2 for windows , and IIS on w2k pro
<***** http://www.myispnet.net *****>
Administrator
My ISP Network
MSN Messenger= [EMAIL PROTECTED]
<***** http://www.kompukit.com *****>
--- End Message ---