php-general Digest 12 Nov 2004 04:49:10 -0000 Issue 3107
Topics (messages 201779 through 201813):
how come mysql_connect() doesn't work?
201779 by: Robert Ozimek
201780 by: Jay Blanchard
201799 by: Jonathan Charette
inline_C installation
201781 by: Rayan Lahoud
201804 by: Ryan King
Re: How do I su to another account??
201782 by: Ian Firla
201801 by: Scott Fletcher
201802 by: Scott Fletcher
Url encoding awry
201783 by: ydragon
201793 by: Rick Fletcher
calling function from function?
201784 by: Jason
201785 by: Rick Fletcher
201786 by: Greg Donald
201787 by: Jason
201788 by: Jason
201789 by: Greg Donald
201790 by: Jason
201791 by: Rick Fletcher
201792 by: Curt Zirzow
201795 by: Jason
Which PHP for MySQL 4.1
201794 by: C.F. Scheidecker Antunes
201796 by: Jay Blanchard
201798 by: Brent Baisley
201800 by: Jim Wharton
201803 by: Chris
201805 by: Chris
Re: Calling a C program from php
201797 by: Thomas Goyne
Problems when 'nc ' entered into a field on a form
201806 by: Jason Oakley
201809 by: John Holmes
how to parse a string parse with ereg
201807 by: Mark-Walter.t-online.de
201812 by: Jason Wong
Session file not written, session variables messed up.
201808 by: Rodolfo
PHP and eCommerce?
201810 by: Jason Bourque
201811 by: Afan Pasalic
adding a space every 4 chars
201813 by: Justin French
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 ---
how come mysql_connect() doesn't work? What should i use instead to
get me connect MySql.
--- End Message ---
--- Begin Message ---
[snip]
how come mysql_connect() doesn't work? What should i use instead to
get me connect MySql.
[/snip]
Are you getting a specific error? Can you show us the code you are
using? What version of PHP? Without this we cannot help you.
--- End Message ---
--- Begin Message ---
I think I know, You're probably using php 5. mysql module is not 'installed'
in it..
"Jay Blanchard" <[EMAIL PROTECTED]> a écrit dans le
message de news: [EMAIL PROTECTED]
[snip]
how come mysql_connect() doesn't work? What should i use instead to
get me connect MySql.
[/snip]
Are you getting a specific error? Can you show us the code you are
using? What version of PHP? Without this we cannot help you.
--- End Message ---
--- Begin Message ---
Does anybody knows how to install a pear package. i have the inline_C package
that i want to install and use. And can i have some sample functions using this
package?
Thank you
---------------------------------
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com
--- End Message ---
--- Begin Message ---
On Nov 11, 2004, at 12:50 PM, Rayan Lahoud wrote:
Does anybody knows how to install a pear package. i have the inline_C
package that i want to install and use. And can i have some sample
functions using this package?
I believe the inline_c package is actually a pecl package
[pecl.php.net], however it is still installed with the pear installer
(I hope that makes sense). Ok, first try typing
pear -v
on the command line. If this doesn't work (it returns "command not
found"), try http://pear.php.net/manual/en/installation.php. If that
succedes, you have a pear package manager installed. Now type:
pear install inline_c
this should install the package for you. You'll probably have to add
the module to your php.ini script and restart apache.
-ryan
--- End Message ---
--- Begin Message ---
Do you really need to switch users or do you need to run something as
another user?
Try looking into setting up and using sudo.
Ian
On Thu, 2004-11-11 at 09:20 -0500, Scott Fletcher wrote:
> How do I su (switch user) to another account from the nobody in php? I
> haven't got it to work, so I get the impression that it is either I'm doing
> it all wrong in PHP script or that the nobody doesn't have the authority to
> do so.
>
> Have anyone who ever successfully do it please post a sample script?
>
> Thanks,
> Scott
>
--- End Message ---
--- Begin Message ---
Um, I'll look into it. Thanks... Scott
"Jason" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well if you are using apache as your webserver you can use a module
> which supports this feature... mod_chroot, mod_ruid or mod_suid2 is what
> you want.
>
> Or just as a suggestion if you don't want to change the running
> environment of apache I recommend having your script set a flag (temp
> file or something) then write a shell or php script running through a
> cron job to check for the temporary file before it executes.
>
> Scott Fletcher wrote:
> > How do I su (switch user) to another account from the nobody in php? I
> > haven't got it to work, so I get the impression that it is either I'm
doing
> > it all wrong in PHP script or that the nobody doesn't have the authority
to
> > do so.
> >
> > Have anyone who ever successfully do it please post a sample script?
> >
> > Thanks,
> > Scott
>
>
> --
> Jason Gerfen
> [EMAIL PROTECTED]
>
> "And remember... If the ladies
> don't find you handsome, they
> should at least find you handy..."
> ~The Red Green show
--- End Message ---
--- Begin Message ---
Yea, switch users so I can do the chmod, chown, etc... Um, I'll look into
it.
Thanks,
Scott
"Ian Firla" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Do you really need to switch users or do you need to run something as
> another user?
>
> Try looking into setting up and using sudo.
>
> Ian
>
> On Thu, 2004-11-11 at 09:20 -0500, Scott Fletcher wrote:
> > How do I su (switch user) to another account from the nobody in php? I
> > haven't got it to work, so I get the impression that it is either I'm
doing
> > it all wrong in PHP script or that the nobody doesn't have the authority
to
> > do so.
> >
> > Have anyone who ever successfully do it please post a sample script?
> >
> > Thanks,
> > Scott
> >
--- End Message ---
--- Begin Message ---
Hello all
I have a dynamically created image labeled:
stories & critiques.jpg
I have use url encode on it when saving it, and it is stored on the server
as:
stories+%26+crtitiques.jpg
I have an html block that calls the image
<img src=stories+%26+crtitiques.jpg>
I get a 404....
I know the path is right and spelling is correct
If I just put the path into the browser directly it also 404's
If I rename the file in any way that removes the % it works...
I thought % was a legal URL encoding character?
JZ
--- End Message ---
--- Begin Message ---
I have a dynamically created image labeled:
stories & critiques.jpg
I have use url encode on it when saving it, and it is stored on the server
as:
stories+%26+crtitiques.jpg
[snip]
If I just put the path into the browser directly it also 404's
If I rename the file in any way that removes the % it works...
I thought % was a legal URL encoding character?
URL encoding the file's name on disk is causing your problems. If you
really want to keep it that way, you'll have to double encode the
request, so that when it's decoded once you end up with
"stories+%26+crtitiques.jpg". That's pretty needlessly complex.
Why not just leave the file named "stories & critiques.jpg" on disk and
change your image tag to <img src="stories & critiques.jpg"/> ?
--Rick
--- End Message ---
--- Begin Message ---
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
... do some processing ...
}
what am i missing here? i get errors if i try to pass $db to logs. i.e.
logs( $db );
--
Jason Gerfen
[EMAIL PROTECTED]
"And remember... If the ladies
don't find you handsome, they
should at least find you handy..."
~The Red Green show
--- End Message ---
--- Begin Message ---
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
... do some processing ...
}
what am i missing here? i get errors if i try to pass $db to logs. i.e.
logs( $db );
What's missing? The error message. Include it, and the offending
line(s) of code, and ask again.
--Rick
--- End Message ---
--- Begin Message ---
On Thu, 11 Nov 2004 12:26:17 -0700, Jason <[EMAIL PROTECTED]> wrote:
> function db( $host, $user, $pass, $dbnam ) {
> $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
> @mysql_select_db( $dbnam )or die( mysql_error( $db ) );
> return $db;
> }
>
> function logs() {
If you plan to pass parameters to this function you should probbaly define them:
function logs( $var1 ) {
There are built-in PHP functions that assist with handling variable
function parameters such as func_get_arg(), func_get_args(), and
func_num_args() if you don't want to pre-define any however.
> global $defined;
>
> db( $defined[9], $defined[1], $defined[2], $defined[3] );
> ... do some processing ...
What does print_r( $defined ) show you? Is that what you expect to be
in the array?
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/
--- End Message ---
--- Begin Message ---
Rick Fletcher wrote:
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
... do some processing ...
}
what am i missing here? i get errors if i try to pass $db to logs.
i.e. logs( $db );
What's missing? The error message. Include it, and the offending
line(s) of code, and ask again.
--Rick
There isnt an error at all. According to the die() functions at the end
of the mysql() functions it should give it there, instead I get blank as
if the function has not successfully completed. The reason I say this
is if you try to access the mysql resource pointer ( $db, in this case )
I get nothing, a return code of 0. Example in point...
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( "<font
face=\"arial\"><b>phpDHCPAdmin currently not active, is under repair or
is not configured correctly.</b><br><br>Error Number: " . mysql_errno(
$db ) . "<br>Error Message: " . mysql_error( $db ) . "<br>Email
Administrator: <a href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
@mysql_select_db( $dbnam )or die( "<font face=\"arial\"><b>Could
not connect to database: $defined[3]</b><br>Error Message: " .
@mysql_error( $db ) . "<br>" . "Error Number: " . @mysql_errno( $db ) .
"<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
$pagecount = "1";
$tble = "logs";
$sql = @mysql_query( "SELECT * FROM $tble WHERE session =
\"$_SESSION[hash]\"", $db )or die( "<font face=\"arial\"><b>Error
occured when searching logs for session id:</b> $_SESSION[hash]<br>Error
Message: " . @mysql_error( $db ) . "<br>" . "Error Number: " .
@mysql_errno( $db ) . "<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
while( $row = @mysql_fetch_array( $sql ) ) {
$id = $row["session"]; }
if( @mysql_num_rows( $sql ) == 0 ) {
$insert = @mysql_query( "INSERT INTO $tble VALUES
(\"\",\"$_SESSION[date]\",\"$_SESSION[hour]\",\"$_SESSION[ipaddy]\",\"$_SESSION[host]\",\"$_SESSION[ref]\",\"$_SERVER[HTTP_USER_AGENT]\",\"$_SERVER[PHP_SELF]\",\"$pagecount\",\"$_SESSION[msg]\",\"$_SESSION[hash]\")",
$db )or die( "<font face=\"arial\"><b>Error occured creating logs for
$_SESSION[hash]</b><br>Error Message: " . @mysql_error( $db ) . "<br>" .
"Error Number: " . @mysql_errno( $db ) . "<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
} elseif( @mysql_num_rows( $sql ) != 0 ) {
if( ( $_SESSION['hash'] == $id ) || ( empty( $pagecount ) ) ) {
$pagecount++;
$update = @mysql_query( "UPDATE $tble SET
date=\"$_SESSION[date]\", time=\"$_SESSION[hour]\",
ip=\"$_SESSION[ipaddy]\", host=\"$_SESSION[host]\",
referer=\"$_SESSION[ref]\", agent=\"$_SERVER[HTTP_USER_AGENT]\",
page=CONCAT(page,\".:||:.$_SERVER[PHP_SELF]\"),
pagecount=\"$pagecount\", message=\"$_SESSION[msg]\",
session=\"$_SESSION[hash]\" WHERE session=\"$id\"", $db )or die( "<font
face=\"arial\"><b>Error occured while updating logs for
$_SESSION[hash]</b><br>Error Message: " . @mysql_error( $db ) . "<br>" .
"Error Number: " . @mysql_errno( $db ) . "<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
} else {
call_user_func( "exit_app" );
}
} else {
call_user_func( "exit_app" );
}
}
when called with
logs();
returns this:
Error occured when searching logs for session id:
82a831c4190f6e929032c0a9512c3657
Error Message:
Error Number:
Email Administrator: [EMAIL PROTECTED]
--
Jason Gerfen
[EMAIL PROTECTED]
"And remember... If the ladies
don't find you handsome, they
should at least find you handy..."
~The Red Green show
--- End Message ---
--- Begin Message ---
I hate posting all of that code, but for Greg's question... it does give
me the correct array data.
Jason wrote:
Rick Fletcher wrote:
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db
));
@mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
... do some processing ...
}
what am i missing here? i get errors if i try to pass $db to logs.
i.e. logs( $db );
What's missing? The error message. Include it, and the offending
line(s) of code, and ask again.
--Rick
There isnt an error at all. According to the die() functions at the end
of the mysql() functions it should give it there, instead I get blank as
if the function has not successfully completed. The reason I say this
is if you try to access the mysql resource pointer ( $db, in this case )
I get nothing, a return code of 0. Example in point...
function db( $host, $user, $pass, $dbnam ) {
$db = @mysql_pconnect( $host, $user, $pass )or die( "<font
face=\"arial\"><b>phpDHCPAdmin currently not active, is under repair or
is not configured correctly.</b><br><br>Error Number: " . mysql_errno(
$db ) . "<br>Error Message: " . mysql_error( $db ) . "<br>Email
Administrator: <a href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
@mysql_select_db( $dbnam )or die( "<font face=\"arial\"><b>Could
not connect to database: $defined[3]</b><br>Error Message: " .
@mysql_error( $db ) . "<br>" . "Error Number: " . @mysql_errno( $db ) .
"<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
return $db;
}
function logs() {
global $defined;
db( $defined[9], $defined[1], $defined[2], $defined[3] );
$pagecount = "1";
$tble = "logs";
$sql = @mysql_query( "SELECT * FROM $tble WHERE session =
\"$_SESSION[hash]\"", $db )or die( "<font face=\"arial\"><b>Error
occured when searching logs for session id:</b> $_SESSION[hash]<br>Error
Message: " . @mysql_error( $db ) . "<br>" . "Error Number: " .
@mysql_errno( $db ) . "<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
while( $row = @mysql_fetch_array( $sql ) ) {
$id = $row["session"]; }
if( @mysql_num_rows( $sql ) == 0 ) {
$insert = @mysql_query( "INSERT INTO $tble VALUES
(\"\",\"$_SESSION[date]\",\"$_SESSION[hour]\",\"$_SESSION[ipaddy]\",\"$_SESSION[host]\",\"$_SESSION[ref]\",\"$_SERVER[HTTP_USER_AGENT]\",\"$_SERVER[PHP_SELF]\",\"$pagecount\",\"$_SESSION[msg]\",\"$_SESSION[hash]\")",
$db )or die( "<font face=\"arial\"><b>Error occured creating logs for
$_SESSION[hash]</b><br>Error Message: " . @mysql_error( $db ) . "<br>" .
"Error Number: " . @mysql_errno( $db ) . "<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
} elseif( @mysql_num_rows( $sql ) != 0 ) {
if( ( $_SESSION['hash'] == $id ) || ( empty( $pagecount ) ) ) {
$pagecount++;
$update = @mysql_query( "UPDATE $tble SET
date=\"$_SESSION[date]\", time=\"$_SESSION[hour]\",
ip=\"$_SESSION[ipaddy]\", host=\"$_SESSION[host]\",
referer=\"$_SESSION[ref]\", agent=\"$_SERVER[HTTP_USER_AGENT]\",
page=CONCAT(page,\".:||:.$_SERVER[PHP_SELF]\"),
pagecount=\"$pagecount\", message=\"$_SESSION[msg]\",
session=\"$_SESSION[hash]\" WHERE session=\"$id\"", $db )or die( "<font
face=\"arial\"><b>Error occured while updating logs for
$_SESSION[hash]</b><br>Error Message: " . @mysql_error( $db ) . "<br>" .
"Error Number: " . @mysql_errno( $db ) . "<br>Email Administrator: <a
href=\"mailto:$defined[5]\">$defined[5]</a></font>" );
} else {
call_user_func( "exit_app" );
}
} else {
call_user_func( "exit_app" );
}
}
when called with
logs();
returns this:
Error occured when searching logs for session id:
82a831c4190f6e929032c0a9512c3657
Error Message:
Error Number:
Email Administrator: [EMAIL PROTECTED]
--
Jason Gerfen
Student Computing
Marriott Library
801.585.9810
[EMAIL PROTECTED]
"And remember... If the ladies
don't find you handsome, they
should at least find you handy..."
~The Red Green show
--- End Message ---
--- Begin Message ---
On Thu, 11 Nov 2004 12:42:44 -0700, Jason <[EMAIL PROTECTED]> wrote:
> There isnt an error at all.
How could there be an error? You're using @ to suppress nearly every
mysql function call. Makes it kind of hard to debug that way.
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/
--- End Message ---
--- Begin Message ---
Greg Donald wrote:
On Thu, 11 Nov 2004 12:42:44 -0700, Jason <[EMAIL PROTECTED]> wrote:
There isnt an error at all.
How could there be an error? You're using @ to suppress nearly every
mysql function call. Makes it kind of hard to debug that way.
yep, you are right... I removed the @ for each of mysql functions and
here is my error...
Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /path/to/script.php on line 43
which tells me that the $db handle is not being returned when called
from the db() function from within the logs() function and I am not sure
why?
$defined = array( 0=> "localhost", 1 => "user", 2 => "pass" );
function db( $host, $user, $pass, $dbnam ) {
$db = mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ) );
mysql_select_db( $dbnam )or die( mysql_error( $db ) );
return $db;
}
function logs() {
global $defined;
db( $defined[0], $defined[1], $defined[2], $defined[3] );
$pagecount = "1";
$tble = "logs";
$sql = mysql_query( "SELECT * FROM $tble WHERE session =
\"$_SESSION[hash]\"", $db )or die( mysql_error( $db ));
while( $row = mysql_fetch_array( $sql ) ) {
$id = $row["session"]; }
if( mysql_num_rows( $sql ) == 0 ) {
$insert = mysql_query( "INSERT INTO $tble VALUES
(\"\",\"$_SESSION[date]\",\"$_SESSION[hour]\",\"$_SESSION[ipaddy]\",\"$_SESSION[host]\",\"$_SESSION[ref]\",\"$_SERVER[HTTP_USER_AGENT]\",\"$_SERVER[PHP_SELF]\",\"$pagecount\",\"$_SESSION[msg]\",\"$_SESSION[hash]\")",
$db )or die( mysql_error( $db ) );
} elseif( mysql_num_rows( $sql ) != 0 ) {
if( ( $_SESSION['hash'] == $id ) || ( empty( $pagecount ) ) ) {
$pagecount++;
$update = mysql_query( "UPDATE $tble SET
date=\"$_SESSION[date]\", time=\"$_SESSION[hour]\",
ip=\"$_SESSION[ipaddy]\", host=\"$_SESSION[host]\",
referer=\"$_SESSION[ref]\", agent=\"$_SERVER[HTTP_USER_AGENT]\",
page=CONCAT(page,\".:||:.$_SERVER[PHP_SELF]\"),
pagecount=\"$pagecount\", message=\"$_SESSION[msg]\",
session=\"$_SESSION[hash]\" WHERE session=\"$id\"", $db )or die(
mysql_error( $db ) );
} else {
call_user_func( "exit_app" );
}
} else {
call_user_func( "exit_app" );
}
}
--
Jason Gerfen
[EMAIL PROTECTED]
"And remember... If the ladies
don't find you handsome, they
should at least find you handy..."
~The Red Green show
--- End Message ---
--- Begin Message ---
db( $defined[0], $defined[1], $defined[2], $defined[3] );
> which tells me that the $db handle is not being returned when called
> from the db() function from within the logs() function and I am not
> sure why?
it's being returned, you've just forgotten to assign it. add a "$db = "
to the beginning of that line and you should be good to go.
--Rick
--- End Message ---
--- Begin Message ---
* Thus wrote Jason:
> function db( $host, $user, $pass, $dbnam ) {
> $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
> @mysql_select_db( $dbnam )or die( mysql_error( $db ) );
> return $db;
> }
>
> function logs() {
> global $defined;
>
> db( $defined[9], $defined[1], $defined[2], $defined[3] );
> ... do some processing ...
>
> }
You probably should read chapter III of the manual:
http://php.net/langref
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
Rick Fletcher wrote:
db( $defined[0], $defined[1], $defined[2], $defined[3] );
> which tells me that the $db handle is not being returned when called
> from the db() function from within the logs() function and I am not
> sure why?
it's being returned, you've just forgotten to assign it. add a "$db = "
to the beginning of that line and you should be good to go.
--Rick
dang, thanks dude I knew it was something simple like that. just goes
to show you how over analyzed things are. lol. thanks again.
--
Jason Gerfen
[EMAIL PROTECTED]
"And remember... If the ladies
don't find you handsome, they
should at least find you handy..."
~The Red Green show
--- End Message ---
--- Begin Message ---
Hello,
I would like to migrate my MySQL servers from 4.0 to 4.1.
As I use PHP as well as Java with these servers I wonder what PHP 4
version would be compatible with MySQL 4.1.
Has anyone used MySQL 4.1 with PHP yet?
I appreciate your thoughts.
Thanks.
--- End Message ---
--- Begin Message ---
[snip]
I would like to migrate my MySQL servers from 4.0 to 4.1.
As I use PHP as well as Java with these servers I wonder what PHP 4
version would be compatible with MySQL 4.1.
Has anyone used MySQL 4.1 with PHP yet?
[/snip]
PHP 4 is compatible with MySQL 4.1. My caution to you would be using
Apache 2 as it has some quirks that haven't been worked out yet.
--- End Message ---
--- Begin Message ---
I migrated to MySQL 4.1 about a month ago. I had some issues with PHP
(running 4.3.6) communicating with MySQL because 4.1 implements a new
form of communication. As I recall, I had to do something with the
passwords in the grants table, but I forget what now. It's been working
fine since.
On Nov 11, 2004, at 3:05 PM, C.F. Scheidecker Antunes wrote:
Hello,
I would like to migrate my MySQL servers from 4.0 to 4.1.
As I use PHP as well as Java with these servers I wonder what PHP 4
version would be compatible with MySQL 4.1.
Has anyone used MySQL 4.1 with PHP yet?
I appreciate your thoughts.
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--- End Message ---
--- Begin Message ---
You will need to use the old_password() function in MySQL 4.1 and above.
You can find out more at mysql.com
Jim
On Thu, 2004-11-11 at 15:58 -0500, Brent Baisley wrote:
> I migrated to MySQL 4.1 about a month ago. I had some issues with PHP
> (running 4.3.6) communicating with MySQL because 4.1 implements a new
> form of communication. As I recall, I had to do something with the
> passwords in the grants table, but I forget what now. It's been working
> fine since.
>
> On Nov 11, 2004, at 3:05 PM, C.F. Scheidecker Antunes wrote:
>
> > Hello,
> >
> > I would like to migrate my MySQL servers from 4.0 to 4.1.
> >
> > As I use PHP as well as Java with these servers I wonder what PHP 4
> > version would be compatible with MySQL 4.1.
> >
> > Has anyone used MySQL 4.1 with PHP yet?
> >
> > I appreciate your thoughts.
> >
> > Thanks.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>
--- End Message ---
--- Begin Message ---
The MySQL library for 4.1.x is mysqli_* ( http://www.php.net/mysqli ) ,
that's only works with PHP 5 as far as I know. The old MySQL library (
http://www.php.net/mysql ) Can be used with PHP 4 (any version), but it
won't be able to connect to MySQL with a user using the new password
system introduced in MySQL 4.1.3 . You can set a password for a MySQL
user using the OLDPASSWORD() function, which would allow you to connect
with the old library in PHP 4.
Chris
C.F. Scheidecker Antunes wrote:
Hello,
I would like to migrate my MySQL servers from 4.0 to 4.1.
As I use PHP as well as Java with these servers I wonder what PHP 4
version would be compatible with MySQL 4.1.
Has anyone used MySQL 4.1 with PHP yet?
I appreciate your thoughts.
Thanks.
--- End Message ---
--- Begin Message ---
In my previous email OLDPASSWORD() should have been OLD_PASSWORD()
Chris
--- End Message ---
--- Begin Message ---
On Thu, 11 Nov 2004 02:51:54 -0800 (PST), Rayan Lahoud
<[EMAIL PROTECTED]> wrote:
Hello,
does anybody knows how to call a C function from a php code?
Thank you!! :)
http://us4.php.net/manual/en/function.system.php
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
http://www.smempire.org
--- End Message ---
--- Begin Message ---
I have this strange problem.
If anyone enteres the letters 'nc ' that is N C and a space (eg typing Bobs
Inc or Hotsync etc) the server gives:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Now I suppose it could be Apache related or something, but I have no way of
telling.
I thought it was only in phpBB but I have my own forms on my own blog website
and the same thing happens there ( http://www.bangrocks.com .. post a comment
to test if you like).
I don't see any problems in the log file to say why this may be occurring so
this is my last hope.
Has anyone seen this before? My webhost has noticed it but aren't sure how to
proceed.
Thanks.
--------------
Jason Oakley
Robina Helpdesk
AAPT Limited
Ph: 07 5562 4359
[EMAIL PROTECTED]
------------------------------------------------------------------------------
This communication, including any attachments, is confidential. If
you are not the intended recipient, you should not read it - please
contact me immediately, destroy it, and do not copy or use any part of
this communication or disclose anything about it.
------------------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
Jason Oakley wrote:
I have this strange problem.
If anyone enteres the letters 'nc ' that is N C and a space (eg typing Bobs
Inc or Hotsync etc) the server gives:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Now I suppose it could be Apache related or something, but I have no way of
telling.
I thought it was only in phpBB but I have my own forms on my own blog website
and the same thing happens there ( http://www.bangrocks.com .. post a comment
to test if you like).
I don't see any problems in the log file to say why this may be occurring so
this is my last hope.
Has anyone seen this before? My webhost has noticed it but aren't sure how to proceed.
How are you processing the user supplied text? Can you show us the code
that validates what the user wrote before it's sent off to your database?
Basic troubleshooting steps would be of use here. Comment out your
validation code and see if it works. If it does, add back the code bit
by bit until it breaks. There's nothing in PHP that would prevent text
ending in "nc " to be entered.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi,
I've a string where the output of route -n is in for example.
x.x.x.x 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 x.x.x.x 0.0.0.0 UG 0 0 0 ppp0
The regular expression is already working but how can I reduce the
string to have then only 2 lines ?
To explain this I can proof if the first line is set properly.
This is already done.
So I would like now to delete the first line of the string which
includes this data. So I would then have now:
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 x.x.x.x 0.0.0.0 UG 0 0 0 ppp0
Then I could test if the second line is set properly which is
now the first line and so on.
What I need would be a looping possibilty which makes it able
to delete every line which is ok so far and so on. As I don't
know what routing table a person is using there could be
quite a lot of lines which should be proofed concerning the
syntax.
--
Best Regards, Mark.
"Hello, I am brand new to meditation, and I have a frustrating habit of falling
asleep in class. I don't know how to stop this. When my teacher tells us to
relax our bodies and focus on breathing, my body relaxes, but so does my brain."
--- End Message ---
--- Begin Message ---
On Friday 12 November 2004 00:50, [EMAIL PROTECTED] wrote:
> The regular expression is already working but how can I reduce the
> string to have then only 2 lines ?
Convert the string into an array using explode().
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I believe that professional wrestling is clean and everything else in
the world is fixed.
-- Frank Deford, sports writer
*/
--- End Message ---
--- Begin Message ---
Hi,
I have a weird problem with sessions on PHP 4.3.9 + Apache 1.3.33 in
Slackware, maybe someone could help me or have had the same problem. I'm
getting these messages in my logs:
PHP Warning: Unknown(): Failed to write session data (files). Please
verify that the current setting of session.save_path is correct
(/var/tmp/php) in Unknown on line 0
/var/tmp/php is owned by the user/group Apache is running as, and it has
0700 permissions. This message appears sporadically. I googled but I only
got answers related to permissions.
This happens with an application which consists in two frames loading
distinct scripts. I print the content of one session variable in both
frames, let's say:
<?php
// do many stuff... then:
echo $_SESSION['fullname'];
?>
The weirdness comes when in one frame the script will print "Agent Smith"
while in the other frame of the same frameset the script which loads on it
will print "Thomas Anderson"... and the actual full name in the database
is "Trinity" (both "Agent Smith" and "Thomas Anderson" are also in the
database, related to different logins each one). The session variables
get their values from a database, in one point of the login script only,
by simple assignment:
// query the database to get the full name for $_POST['login'], where
// login is unique... then:
$_SESSION['fullname'] = $rs['fullname'];
I have not been able to determine if the warning message is related to
this weird behavior. This behavior shows up sporadically.
I'm using this session config in php.ini:
session.save_handler = files
session.save_path = /var/tmp/php
session.use_cookies = 1
session.use_only_cookies = 1
session.name = SID
session.auto_start = 1
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 7200
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 16
session.entropy_file = /dev/urandom
session.cache_expire = 180
session.use_trans_sid = 0
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
The client browser has been MSIE 6.0 in all cases.
Any help is appreciated.
Thanks in advance.
Rodolfo.
--- End Message ---
--- Begin Message ---
Hello,
Are there any free shopping carts out there that can handle the credit card
transaction? How do I get started here? Any help is greatly appreciated.
Thanks,
Jason Bourque
--- End Message ---
--- Begin Message ---
99% of shopping carts are able to handlel credit card transactions.
search "php shopping cart" on
google
freshmeat.net
hotscripts.com
I use most of the time osCommerce. More then happy.
Used several times X-Cart. They are good too, but not for free.
-afan
Jason Bourque wrote:
Hello,
Are there any free shopping carts out there that can handle the credit card
transaction? How do I get started here? Any help is greatly appreciated.
Thanks,
Jason Bourque
--- End Message ---
--- Begin Message ---
Hi,
What's the quickest way to add a space every four characters?
Eg 123456789 becomes 1234 5678 9
TIA,
Justin
--- End Message ---