php-general Digest 24 Mar 2002 12:30:38 -0000 Issue 1245
Topics (messages 89866 through 89906):
PHP Developer's Cookbook, Second Edition
89866 by: Craig Westerman
89874 by: Thalis A. Kalfigopoulos
89882 by: Egon Schmid
Still REG EX
89867 by: John Fishworld
89868 by: Miguel Cruz
89869 by: John Fishworld
89876 by: Miguel Cruz
89886 by: Jim Lucas [php]
Adding Text Input in a SELECT drop-down list
89870 by: Andre Dubuc
89871 by: Miguel Cruz
89872 by: Andre Dubuc
89875 by: Justin French
89877 by: Senih
89880 by: Andre Dubuc
89904 by: Mika Tuupola
Re: Double quotes in form fields and submitting them
89873 by: Miguel Cruz
89878 by: webapprentice
89879 by: Miguel Cruz
The infamous HTML quotes Re: [PHP] Double quotes in form fields and submitting them
89881 by: webapprentice
Using EditPlus with PHP
89883 by: Luca Grossi
shell_exec() or passthru()
89884 by: Douglas
89892 by: Douglas
89894 by: Andrew Lopucki
89895 by: Andrew Lopucki
Re: Create Email POP accounts with PHP
89885 by: Jason Wong
Trouble with mysql_pconnect unable to connect to database?
89887 by: Jim Hankins
89888 by: Rasmus Lerdorf
89891 by: Jim Hankins
89896 by: Jim Hankins
89897 by: Gerard Samuel
Re: assert in php.ini setting.
89889 by: CC Zona
Re: Image Manipulation/GD support
89890 by: Michael A. Peters
89893 by: Rasmus Lerdorf
Re: PHP Search Engine?
89898 by: lmlweb
89899 by: lmlweb
Re: Superglobals....
89900 by: David
Php Application Techniques...
89901 by: Arik Ashepa
Problem with special characters
89902 by: N. Pari Purna Chand
test...
89903 by: Liam
urldecode adds slashes 3 times on a single quote. Why?
89905 by: Andy
How to reduce an array to n values?
89906 by: Andy
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 ---
Is the second edition much different from the 1st? If one has 1st Edition,
is it worth $39.95 to get the second?
Thanks
Craig ><>
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Don't have 1st, but 2nd looks pretty good. It functions both as a manual and as a
reference and most of the recipes have pieces that I'd say correspond to real life
problems.
not much help I guess :-)
cheers,
--t.
On Sat, 23 Mar 2002, Craig Westerman wrote:
> Is the second edition much different from the 1st? If one has 1st Edition,
> is it worth $39.95 to get the second?
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
From: "Craig Westerman" <[EMAIL PROTECTED]>
> Is the second edition much different from the 1st? If one has 1st
Edition,
> is it worth $39.95 to get the second?
I hope so. Sterling got a list of errors from two German
translators for his 1st edition. Sterling havenīt said a word about
the second edition during his trip to Germany. You can see him at
http://www.php-ev.de/documents/phpdoc/protocol.html.
-Egon
--- End Message ---
--- Begin Message ---
I'm still playing about trying to validate an url
www(dot)something(dot)something !
I thought this would work but know
if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
can anyone explain why not ???
^(w{3}) = three w at start of string ??
(\\.) = literal dot ??
([a-zA-Z]+) match any word with letters ??
(\\.) = literal dot ??
([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
but it doesn't !
thanks in advance
john
--- End Message ---
--- Begin Message ---
On Sun, 24 Mar 2002, John Fishworld wrote:
> I'm still playing about trying to validate an url
> www(dot)something(dot)something !
>
> I thought this would work but know
>
> if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
First of all, web server hostnames don't need to start with www. Secondly,
they can have any number of components (separated by periods) from 1 to
dozens. Thirdly, the last term doesn't have to be 4 characters or less.
> ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
.museum...
miguel
--- End Message ---
--- Begin Message ---
Okay good point but still why doesn't it work ?
thanks
john
> On Sun, 24 Mar 2002, John Fishworld wrote:
> > I'm still playing about trying to validate an url
> > www(dot)something(dot)something !
> >
> > I thought this would work but know
> >
> > if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
>
> First of all, web server hostnames don't need to start with www. Secondly,
> they can have any number of components (separated by periods) from 1 to
> dozens. Thirdly, the last term doesn't have to be 4 characters or less.
>
> > ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
>
> .museum...
>
> miguel
>
>
--- End Message ---
--- Begin Message ---
On Sun, 24 Mar 2002, John Fishworld wrote:
>> On Sun, 24 Mar 2002, John Fishworld wrote:
>>> I'm still playing about trying to validate an url
>>> www(dot)something(dot)something !
>>>
>>> I thought this would work but know
>>>
>>> if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
>>
>> First of all, web server hostnames don't need to start with www. Secondly,
>> they can have any number of components (separated by periods) from 1 to
>> dozens. Thirdly, the last term doesn't have to be 4 characters or less.
>>
>>> ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
>>
>> .museum...
>
> Okay good point but still why doesn't it work ?
Seems to work for me, given your questionable intentions. What happens
when you try it?
I just thought of one more problem. Domain name components can also
contain numbers and hyphens.
miguel
--- End Message ---
--- Begin Message ---
what are you trying to do?
Jim Lucas
www.bend.com
----- Original Message -----
From: "John Fishworld" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 23, 2002 4:33 PM
Subject: [PHP] Still REG EX
> I'm still playing about trying to validate an url
> www(dot)something(dot)something !
>
> I thought this would work but know
>
> if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
>
> can anyone explain why not ???
>
> ^(w{3}) = three w at start of string ??
>
> (\\.) = literal dot ??
>
> ([a-zA-Z]+) match any word with letters ??
>
> (\\.) = literal dot ??
>
> ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
>
> but it doesn't !
>
> thanks in advance
> john
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I have written, in an html form, a drop-downlist that uses <SELECT>:
i.e. <SELECT NAME=state>
<OPTION SELECTED>State
<OPTION>AL
<OPTION>AZ
<OPTION> // and so on
I would like a text input as the last option so that a user can type in a
state (non-USA) and have this variable passed on. Is there any way of
accomplishing this using html or php?
Any help would be greatly appreciated,
Tia,
Andre
--
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.
May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
On Sat, 23 Mar 2002, Andre Dubuc wrote:
> I have written, in an html form, a drop-downlist that uses <SELECT>:
>
> i.e. <SELECT NAME=state>
> <OPTION SELECTED>State
> <OPTION>AL
> <OPTION>AZ
> <OPTION> // and so on
>
> I would like a text input as the last option so that a user can type in a
> state (non-USA) and have this variable passed on. Is there any way of
> accomplishing this using html or php?
It's not possible. You'll have to put a separate text input field next to
it.
miguel
--- End Message ---
--- Begin Message ---
On Saturday 23 March 2002 19:45, you wrote:
> On Sat, 23 Mar 2002, Andre Dubuc wrote:
> > I have written, in an html form, a drop-downlist that uses <SELECT>:
> >
> > i.e. <SELECT NAME=state>
> > <OPTION SELECTED>State
> > <OPTION>AL
> > <OPTION>AZ
> > <OPTION> // and so on
> >
> > I would like a text input as the last option so that a user can type in a
> > state (non-USA) and have this variable passed on. Is there any way of
> > accomplishing this using html or php?
>
> It's not possible. You'll have to put a separate text input field next to
> it.
>
> miguel
\
Thanks Miguel.
Too bad, since a few sites seem to have that capability. Oh well . .
Regards,
Andre
--
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.
May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
If you've seen it on other sites (I can't see how, since there's no
support for it in the HTML spec), then why not just look at the source?
> Too bad, since a few sites seem to have that capability. Oh well . .
>
> Regards,
> Andre
> --
--- End Message ---
--- Begin Message ---
JavaScript is there to do that.
Senih
> I have written, in an html form, a drop-downlist that uses <SELECT>:
>
> i.e. <SELECT NAME=state>
> <OPTION SELECTED>State
> <OPTION>AL
> <OPTION>AZ
> <OPTION> // and so on
>
> I would like a text input as the last option so that a user can type in a
> state (non-USA) and have this variable passed on. Is there any way of
> accomplishing this using html or php?
>
> Any help would be greatly appreciated,
> Tia,
> Andre
>
> --
> Please pray the Holy Rosary to end the holocaust of abortion.
> Remember in your prayers the suffering souls in Purgatory.
>
> May God bless you abundantly in His love!
>
> For a free Cenacle Scriptural Rosary Booklet --
http://www.webhart.net/csrb/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Saturday 23 March 2002 19:57, you wrote:
> If you've seen it on other sites (I can't see how, since there's no
> support for it in the HTML spec), then why not just look at the source?
>
> > Too bad, since a few sites seem to have that capability. Oh well . .
> >
> > Regards,
> > Andre
> > --
Unfortunately, my bookmarks were lost when I re-installed. It was a major
site, and I don't remember which one. Oh well, I'll keep looking . . .
Thanks,
Andre
--
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.
May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
On Sat, 23 Mar 2002, Andre Dubuc wrote:
> > > <OPTION SELECTED>State
> > > <OPTION>AL
> > > <OPTION>AZ
> > > <OPTION> // and so on
> > >
> > > I would like a text input as the last option so that a user can type in a
> > > state (non-USA) and have this variable passed on. Is there any way of
> > > accomplishing this using html or php?
> > It's not possible. You'll have to put a separate text input field next to
> > it.
> Too bad, since a few sites seem to have that capability. Oh well . .
Any URL's to them?
--
Mika Tuupola http://www.appelsiini.net/~tuupola/
--- End Message ---
--- Begin Message ---
On Fri, 22 Mar 2002, webapprentice wrote:
> I have a form with a text field, say userName.
> I put a value in that has double quotes (i.e. "foobar") and submit this form.
>
> On output I have this:
> <?php echo $HTTP_POST_VARS["userName"]; ?>
>
> The output ends up being a \.
The quotes go away, or they just get a backslash before them? If the
latter, try <?= stripslashes($HTTP_POST_VARS['userName']) ?>
miguel
--- End Message ---
--- Begin Message ---
Hi,
"foobar" becomes simply \
I've lost foobar AND the double quotes. Is there a way to keep them all?
--Stephen
----- Original Message -----
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "webapprentice" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 23, 2002 7:49 PM
Subject: Re: [PHP] Double quotes in form fields and submitting them
> On Fri, 22 Mar 2002, webapprentice wrote:
> > I have a form with a text field, say userName.
> > I put a value in that has double quotes (i.e. "foobar") and submit this
form.
> >
> > On output I have this:
> > <?php echo $HTTP_POST_VARS["userName"]; ?>
> >
> > The output ends up being a \.
>
> The quotes go away, or they just get a backslash before them? If the
> latter, try <?= stripslashes($HTTP_POST_VARS['userName']) ?>
>
> miguel
>
--- End Message ---
--- Begin Message ---
That's a little odd; something else must be going on. Can you provide some
more code, and, preferably, a pointer to a live example?
miguel
On Sat, 23 Mar 2002, webapprentice wrote:
> Hi,
> "foobar" becomes simply \
>
> I've lost foobar AND the double quotes. Is there a way to keep them all?
>
> --Stephen
>
> ----- Original Message -----
> From: "Miguel Cruz" <[EMAIL PROTECTED]>
> To: "webapprentice" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Saturday, March 23, 2002 7:49 PM
> Subject: Re: [PHP] Double quotes in form fields and submitting them
>
>
> > On Fri, 22 Mar 2002, webapprentice wrote:
> > > I have a form with a text field, say userName.
> > > I put a value in that has double quotes (i.e. "foobar") and submit this
> form.
> > >
> > > On output I have this:
> > > <?php echo $HTTP_POST_VARS["userName"]; ?>
> > >
> > > The output ends up being a \.
> >
> > The quotes go away, or they just get a backslash before them? If the
> > latter, try <?= stripslashes($HTTP_POST_VARS['userName']) ?>
> >
> > miguel
> >
>
>
--- End Message ---
--- Begin Message ---
Sorry Miguel, it's the HTML entities nonsense again.
It displayed as \ on my browser, but the HTML source code indicated
otherwise.
Thus, if I entered "foobar", it shows up as \ but the HTML source shows.
<input type="text" name="realName" value="\"foobar\"">
So value="\" was the culprit, so you're original solution was in the right
direction. stripslashes() itself wouldn't work because the HTML source
would be value=""foobar"" and on in HTML, only the first two double quotes
count.
The solution was this, which apparently has been discussed many times
before.
stripslashes(htmlentities($HTTP_POST_VARS["realName"]));
or
stripslashes(htmlspecialcharacters($HTTP_POST_VARS["realName"]));
Thanks for your help in leading me to the right direction.
----- Original Message -----
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "webapprentice" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 23, 2002 8:03 PM
Subject: Re: [PHP] Double quotes in form fields and submitting them
> That's a little odd; something else must be going on. Can you provide some
> more code, and, preferably, a pointer to a live example?
>
> miguel
>
> On Sat, 23 Mar 2002, webapprentice wrote:
>
> > Hi,
> > "foobar" becomes simply \
> >
> > I've lost foobar AND the double quotes. Is there a way to keep them
all?
> >
> > --Stephen
> >
> > ----- Original Message -----
> > From: "Miguel Cruz" <[EMAIL PROTECTED]>
> > To: "webapprentice" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Saturday, March 23, 2002 7:49 PM
> > Subject: Re: [PHP] Double quotes in form fields and submitting them
> >
> >
> > > On Fri, 22 Mar 2002, webapprentice wrote:
> > > > I have a form with a text field, say userName.
> > > > I put a value in that has double quotes (i.e. "foobar") and submit
this
> > form.
> > > >
> > > > On output I have this:
> > > > <?php echo $HTTP_POST_VARS["userName"]; ?>
> > > >
> > > > The output ends up being a \.
> > >
> > > The quotes go away, or they just get a backslash before them? If the
> > > latter, try <?= stripslashes($HTTP_POST_VARS['userName']) ?>
> > >
> > > miguel
> > >
> >
> >
>
--- End Message ---
--- Begin Message ---
I'm sorry if this question has been asked before
but could anyone give me instructions on how to debug and interpret php
scripts using Edit Plus ? I download the php modules for edit plus so
it recognise the syntax. But how do I setup the user tools , so I can check
for bugs in the script and run it
Thanks
--- End Message ---
--- Begin Message ---
Hi,
I have a bash script I need to run.
I have tried all the various program execution commands.
My script never completes. It only get 1/4 of the way through.
I have tried running the script in the background.
Any ideas?
--- End Message ---
--- Begin Message ---
Hi,
I have a bash script I need to run.
I have tried all the various program execution commands.
My script never completes. It only get 1/4 of the way through.
I have tried running the script in the background.
Any ideas?
--- End Message ---
--- Begin Message ---
You may need to redirect output (both stderr and stdout) atleast that helped
me with a similar problem. My system is Linux.
On Saturday 23 March 2002 11:06 pm, Douglas wrote:
> Hi,
>
> I have a bash script I need to run.
> I have tried all the various program execution commands.
>
> My script never completes. It only get 1/4 of the way through.
> I have tried running the script in the background.
>
> Any ideas?
--- End Message ---
--- Begin Message ---
And by redirect I mean to /dev/null possibly if you don't want to capture
output.
On Saturday 23 March 2002 03:52 pm, Douglas wrote:
> Hi,
>
> I have a bash script I need to run.
> I have tried all the various program execution commands.
>
> My script never completes. It only get 1/4 of the way through.
> I have tried running the script in the background.
>
> Any ideas?
--- End Message ---
--- Begin Message ---
On Sunday 24 March 2002 03:52, Julian wrote:
> Hi Jason!!!
>
> Explain me how to do it with qmail and sendmail, plese.
How do you usually do it? ie from the command line?
Use php to execute whatever you usually execute from the command line using
the functions in "Program Execution functions".
You'll most likely run into permissions problem.
For example, if you're using a bog standard qmail install (with no vpopmail
or vmailmgr) then all your mail accounts are system user accounts. And to add
system user accounts you need to be root.
It would probably help if you told us what exactly you're trying to do.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
I generally avoid temptation unless I can't resist it.
-- Mae West
*/
--- End Message ---
--- Begin Message ---
I'm doing a simple database connection using the follow syntax:
<html>
<head>
<title>Book-O-Rama Search Results</title>
</head>
<body>
<h1>Book-O-Rama Search Results</h1>
<?
if (!$searchtype || !$searchterm)
{
echo "You have not entered search details. Please go back and try
again.";
exit;
}
$searchtype = addslashes($searchtype);
$searchterm = addslashes($searchterm);
@ $db = mysql_pconnect("localhost", "bookorama", "bookorama123");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
When I go to the search page and hit submit (after removing the @ to see an
error on the mysql_pconnect line)
I get Warning: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2) in /home/jhankins/public_html/mydirectory/results.php
on line 17
I can telnet to the host and with the same username and password access the
database tables etc. What gives? I'm using
4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine from
command line and remote via odbc?
Also tryed mysql_connect with same problem.
--- End Message ---
--- Begin Message ---
Figure out where your mysql.sock file is and provide the path right in
your mysql_connect() call. "mysqladmin version" tells you the path.
-Rasmus
On Sat, 23 Mar 2002, Jim Hankins wrote:
> I'm doing a simple database connection using the follow syntax:
>
> <html>
> <head>
> <title>Book-O-Rama Search Results</title>
> </head>
> <body>
> <h1>Book-O-Rama Search Results</h1>
> <?
> if (!$searchtype || !$searchterm)
> {
> echo "You have not entered search details. Please go back and try
> again.";
> exit;
> }
>
> $searchtype = addslashes($searchtype);
> $searchterm = addslashes($searchterm);
>
> @ $db = mysql_pconnect("localhost", "bookorama", "bookorama123");
>
> if (!$db)
> {
> echo "Error: Could not connect to database. Please try again later.";
> exit;
> }
>
> When I go to the search page and hit submit (after removing the @ to see an
> error on the mysql_pconnect line)
> I get Warning: Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2) in /home/jhankins/public_html/mydirectory/results.php
> on line 17
>
> I can telnet to the host and with the same username and password access the
> database tables etc. What gives? I'm using
> 4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine from
> command line and remote via odbc?
>
> Also tryed mysql_connect with same problem.
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Can you give me a syntax example. I've found my sock file but seem to be
having trouble getting it right on the mysql_pconnect line,
my sock is /var/lib/mysql/mysql.sock
Thanks in advance!
So close but yet so far. :) My first MySql project.
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Figure out where your mysql.sock file is and provide the path right in
> your mysql_connect() call. "mysqladmin version" tells you the path.
>
> -Rasmus
>
> On Sat, 23 Mar 2002, Jim Hankins wrote:
>
> > I'm doing a simple database connection using the follow syntax:
> >
> > <html>
> > <head>
> > <title>Book-O-Rama Search Results</title>
> > </head>
> > <body>
> > <h1>Book-O-Rama Search Results</h1>
> > <?
> > if (!$searchtype || !$searchterm)
> > {
> > echo "You have not entered search details. Please go back and try
> > again.";
> > exit;
> > }
> >
> > $searchtype = addslashes($searchtype);
> > $searchterm = addslashes($searchterm);
> >
> > @ $db = mysql_pconnect("localhost", "bookorama", "bookorama123");
> >
> > if (!$db)
> > {
> > echo "Error: Could not connect to database. Please try again
later.";
> > exit;
> > }
> >
> > When I go to the search page and hit submit (after removing the @ to
see an
> > error on the mysql_pconnect line)
> > I get Warning: Can't connect to local MySQL server through socket
> > '/tmp/mysql.sock' (2) in
/home/jhankins/public_html/mydirectory/results.php
> > on line 17
> >
> > I can telnet to the host and with the same username and password access
the
> > database tables etc. What gives? I'm using
> > 4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine
from
> > command line and remote via odbc?
> >
> > Also tryed mysql_connect with same problem.
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
never mind got it "localhost:/pathto/mysql.sock" duh? :) Thanks a
million, I'm up and running.
----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Jim Hankins" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 23, 2002 10:50 PM
Subject: Re: [PHP] Trouble with mysql_pconnect unable to connect to
database?
> Figure out where your mysql.sock file is and provide the path right in
> your mysql_connect() call. "mysqladmin version" tells you the path.
>
> -Rasmus
>
> On Sat, 23 Mar 2002, Jim Hankins wrote:
>
> > I'm doing a simple database connection using the follow syntax:
> >
> > <html>
> > <head>
> > <title>Book-O-Rama Search Results</title>
> > </head>
> > <body>
> > <h1>Book-O-Rama Search Results</h1>
> > <?
> > if (!$searchtype || !$searchterm)
> > {
> > echo "You have not entered search details. Please go back and try
> > again.";
> > exit;
> > }
> >
> > $searchtype = addslashes($searchtype);
> > $searchterm = addslashes($searchterm);
> >
> > @ $db = mysql_pconnect("localhost", "bookorama", "bookorama123");
> >
> > if (!$db)
> > {
> > echo "Error: Could not connect to database. Please try again
later.";
> > exit;
> > }
> >
> > When I go to the search page and hit submit (after removing the @ to
see an
> > error on the mysql_pconnect line)
> > I get Warning: Can't connect to local MySQL server through socket
> > '/tmp/mysql.sock' (2) in
/home/jhankins/public_html/mydirectory/results.php
> > on line 17
> >
> > I can telnet to the host and with the same username and password access
the
> > database tables etc. What gives? I'm using
> > 4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine
from
> > command line and remote via odbc?
> >
> > Also tryed mysql_connect with same problem.
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
--- End Message ---
--- Begin Message ---
Is that supposed to be ->
$db = @mysql_pconnect("localhost", "bookorama", "bookorama123");
Jim Hankins wrote:
> I'm doing a simple database connection using the follow syntax:
>
> <html>
> <head>
> <title>Book-O-Rama Search Results</title>
> </head>
> <body>
> <h1>Book-O-Rama Search Results</h1>
> <?
> if (!$searchtype || !$searchterm)
> {
> echo "You have not entered search details. Please go back and try
> again.";
> exit;
> }
>
> $searchtype = addslashes($searchtype);
> $searchterm = addslashes($searchterm);
>
> @ $db = mysql_pconnect("localhost", "bookorama", "bookorama123");
>
> if (!$db)
> {
> echo "Error: Could not connect to database. Please try again later.";
> exit;
> }
>
> When I go to the search page and hit submit (after removing the @ to see an
> error on the mysql_pconnect line)
> I get Warning: Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2) in /home/jhankins/public_html/mydirectory/results.php
> on line 17
>
> I can telnet to the host and with the same username and password access the
> database tables etc. What gives? I'm using
> 4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine from
> command line and remote via odbc?
>
> Also tryed mysql_connect with same problem.
>
>
>
>
>
>
--- End Message ---
--- Begin Message ---
In article <Pine.LNX.4.20.0203231339370.28994-100000@Larry>,
[EMAIL PROTECTED] (S.Murali Krishna) wrote:
> can any one tell me what is this
>
> ;assert.active = On ; assert(expr); active by default
> ;assert.warning = On ; issue a PHP warning for each failed
> ;assert.bail = Off ; don't bail out by default.
> ;assert.callback = 0 ; user-function to be called if an assertion
> ;assert.quiet_eval = 0 ; eval the expression with current
>
>
> setting in my php.ini file, I don't know what it is for, and it has been
> commented.
<http://www.php.net/assert>
<http://www.php.net/assert-options>
--
CC
--- End Message ---
--- Begin Message ---
On the topic of gd support but a slightly different topic-
I was using php 4.0.5
gd 1.8.3 patched for gif support (using libungif for libgif which I
*think* is OK)
FreeType 1.3.1 (compiled myself in /usr/local )
t1lib 1.3.1 (compiled myself in /usr/local )
I was using gd to draw pictures and write text on them with ttf fonts.
I saw there were some new image functions in >= 4.0.6 so I grabbed the
latest php
I use a script to compile php
same compile options, but t1lib gave a ptoblem because instead of looking
in /usr/local/lib it tried to find the library in /usr/lib/.libs
the configure option id --with-t1lib=/usr/local
cd /usr/lib
ln -s /usr/local/lib .libs
took care of that but I really don't want to do that.
Anyway, my big problem is with freetype.
compiled
I could draw and open images, but could not write ttf fonts on them.
reading the ./configure -h I see that they CHANGED what the configure
options mean.
now --with-freetype=dir refers to freetype 2
Personally I think its insane to change the meaning of a configure option,
but OK.
So I downloaded FreeType 2 and compiled it and installed in /usr/local
recompiled php
Still can't use ttf to write on images.
phpinfo() says I have FreeType linkage.
But both ImageFtText and ImageTTFText fail to do anything.
What is up with that?
Perl is losing popularity because every time it updates scripts frequently
need some rewriting (that and cpan will grab the latest module and then
try to grab a newer perl instead of grabbing the module that works with
the installed perl- grrrr)
Hopefully php isn't going that route.
Is this just a bug or has there been a major change?
I'm going to have to find myself trying php 4.0.6 and possibly reverting
back to 4.0.5 if I can't get this resolved.
My compile options are here- http://macaddict4life.dhs.org/info.php
--- End Message ---
--- Begin Message ---
> reading the ./configure -h I see that they CHANGED what the configure
> options mean.
> now --with-freetype=dir refers to freetype 2
Untrue, it only refers to freetype2 when you are building against GD2.
> phpinfo() says I have FreeType linkage.
> But both ImageFtText and ImageTTFText fail to do anything.
>
> What is up with that?
>
> Perl is losing popularity because every time it updates scripts frequently
> need some rewriting (that and cpan will grab the latest module and then
> try to grab a newer perl instead of grabbing the module that works with
> the installed perl- grrrr)
> Hopefully php isn't going that route.
>
> Is this just a bug or has there been a major change?
> I'm going to have to find myself trying php 4.0.6 and possibly reverting
> back to 4.0.5 if I can't get this resolved.
Works just fine for me. Play with your config.log and see what is
failing. I use gd2 these days because the 8-bit limitation of gd1 just
sucks. You can find my simple gd2 instructions here
http://www.php.net/~rasmus/gd.html
-Rasmus
--- End Message ---
--- Begin Message ---
I don't think my server even has PEAR installed, so even if I just put
the script on my own directory, it still needs the PEAR.php - will I
need to do that too?
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 23, 2002 1:56 PM
> To: lmlweb
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP Search Engine?
>
>
> So just put that file in your own directory and use it from
> there. It is just a PHP script.
>
> On Sat, 23 Mar 2002, lmlweb wrote:
>
> > Hello,
> >
> > I've picked up a book called the PHP Developer's Cookbook,
> > specifically for the search engine that was featured in it. It
> > required the use of PEAR's File/Find.php, which my host hasn't
> > installed, ..and very likely will not.
> >
> > Is there another way of coming up with a search engine in PHP that
> > doesn't require the use of subscription services?
> >
> > Laurie M. Landry
> > http://www.lmlweb.com
> > voicemail/fax: (604) 693-1120
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
--- End Message ---
--- Begin Message ---
My correction - there is a Pear, and it was just a matter of finding the
location
(/root/php-4.1.2/pear/File/Find.php) - so I tried to use the full path -
owrked, but then the Find.php required the PEAR.php, which was one
level. So what I've done so far is to put the Find.php in my directory,
and then make the path to the PEAR.php in the Find.php.
I don't know if this will work for the search application from the PHP
Dev's Cookbook but so far it seem to be working this way.
> -----Original Message-----
> From: lmlweb [mailto:[EMAIL PROTECTED]]
>
> I don't think my server even has PEAR installed, so even if I
> just put the script on my own directory, it still needs the
> PEAR.php - will I need to do that too?
>
> > -----Original Message-----
> > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, March 23, 2002 1:56 PM
> > Subject: Re: [PHP] PHP Search Engine?
--- End Message ---
--- Begin Message ---
Jason Sheets said something on 24 Mar 2002, in php.general:
> You might remind them that anything under PHP 4.1.2 has a security
> whole that can be exploited remotely, my web host refused to upgrade
> until they learned about the security implications of not doing so.
>
> Jason
The are running a patched version.
--
---
WarpedWeb.Net
http://www.warpedweb.net/
--- End Message ---
--- Begin Message ---
Someone knows a site, or a tutorial article something that would teach
advanced techniques, like suppose using themes, languages, API... ?
Any help is appreciated
Sincerely
Arik
--- End Message ---
--- Begin Message ---
When a form is submitting data to another php page
it is sending specialcharacters with escape sequences added.
Ex : <Input type=text value="c:\programfiles\" name=var1>
& when i do an
echo $var1;
in the submitted php page
it is showing "c:\\programfiles\\" instead of "c:\programfiles\"
Howto overcome this ?
/Chandu
--- End Message ---
--- Begin Message ---
24/03/2002 8:34:40 PM
Umm, is it just me or has there been no traffic on this list for the last 2 hours....
Weird....
--- End Message ---
--- Begin Message ---
Hi there, I want to transfer a message back to the form if an error occures.
Therefore I am encoding the message and afterwards decoding. Works fo far
with one exeption. The single quote is slashed 3 times.
Example:
$message = That's great!
Code:
example.php?message=".urlencode($message)."
<textarea name="message" rows="10" cols="53"
wrap="virtual">'.urldecode($message).'</textarea>
Result:
That\\\'s great!
So whats wrong? I can't see the mistake.
Thanx for any help
Andy
--- End Message ---
--- Begin Message ---
Hi there,
I am trying to reduce an array to n values if it is more than n values.
eg.
$level_depth = 3;
$test = array('banana', 'super', 'php', 'car');
# some array function which is deleting the last item ( car) if existant
Thanx for any help,
Andy
--- End Message ---