Re: [PHP] Can I check MYSQL version

2002-12-08 Thread Johannes Schlueter
On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote:
> Hi,
> Can I check mysql version so if version >= 4 $sql = 'version 4 stuff' else
> $sql ="version 3 stuff";

Try this SQL-Statement:

SEELCT VERSION();

MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html

johannes


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Typo -- Re: [PHP] Can I check MYSQL version

2002-12-08 Thread Johannes Schlueter
On Sunday 08 December 2002 20:40, Johannes Schlueter wrote:
> SEELCT VERSION();

Should be SELECT VERSION() 

;-)

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP_SELF Variable

2002-12-10 Thread Johannes Schlueter
On Tuesday 10 December 2002 12:36, info AT t-host.com wrote:
> after successfully compiling and installing php.4.3-dev from tarball
> ...
> PHP_SELF has no value. How can I set this?

Try using $_SERVER['PHP_SELF'] if it works look at the release notes and look 
for "register_globals"

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Can PHP do this...?

2002-12-11 Thread Johannes Schlueter
On Wednesday 11 December 2002 19:19, Ronald Clark wrote:
Hi Ronald, hi List,

it isn't

> if ($_SERVER['!HTTPS']) {

but 

if (!isset($_SERVER['HTTPS']) {
  // unsecure
} else {
  //secure
}

You want to check wether the server variable HTTPS is set or not.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] real password value

2002-12-13 Thread Johannes Schlueter
On Friday 13 December 2002 20:58, empty wrote:
> do you know how to decrypt password('xxx'); value?

You can't do this. The only thing you could do is to send the User who lost 
his password a new one with an activation link. The new Password is saved 
somewhere else. Then the user clicks on the link and has a _new_ password.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Testing smtp server

2002-12-13 Thread Johannes Schlueter
On Friday 13 December 2002 21:30, Max Clark wrote:
> I found the socket_create function that is listed as experimental and
> requires a re-compile of php. Is there a built in way to perform this kind
> of test?


Based upon the second example on 
http://www.php.net/manual/en/ref.sockets.php :

echo "TCP/IP Connection\n";

/* Get the service for TCP-Port 25. */
$service_port = getservbyport (25, 'tcp');

/* Get the IP address for the target host. */
$address = gethostbyname ('www.example.com');

/* Create a TCP/IP socket. */
$socket = socket_create (AF_INET, SOCK_STREAM, 0);
if ($socket < 0) {
echo "socket_create() failed: reason: " . socket_strerror ($socket) . 
"\n";
} else {
echo "OK.\n";
}

echo "Attempting to connect to '$address' on port '$service_port'...";
$result = socket_connect ($socket, $address, $service_port);
if ($result < 0) {
echo "socket_connect() failed.\nReason: ($result) " . 
socket_strerror($result) . "\n";
} else {
echo "OK.\n";
}


johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Submitting a Form

2002-12-17 Thread Johannes Schlueter
On Tuesday 17 December 2002 18:38, Jay Thayer wrote:
> 1. Any reason that I can not pass the variable to the submit page?  I am

Try $_REQUEST['Test'] and look in the manual, the archives or a PHP-FAQ for 
"register_globals".

> 2. If I have a  HTML tag, how can I
> reference the x# of variables that are selected in that form value in the
> submittest page?  I would want to get every option that is selected in the
> page.

set the name to testmultiple[] then You get an array.





> 3. Is there a variable so that I can see everything that is passed from the
> form, some debug variable I could "print()" to see everything that was
> passed from the form?

$_REQUEST

johannes


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Browser Language

2002-12-17 Thread Johannes Schlueter
On Tuesday 17 December 2002 18:51, Jeff wrote:
> Does anybody know how to get what language (en, fr, it, etc.) the users
> browser is using?

Have a look at 
$_SERVER["HTTP_ACCEPT_LANGUAGE"] This are the languages the user
likes to read.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] md5()

2002-12-23 Thread Johannes Schlueter
On Monday 23 December 2002 14:38, Edward Peloke wrote:
> [...]  Can I reverse md5()?

No. You could only send the user a new password wich must be activated.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Forms

2002-12-23 Thread Johannes Schlueter
On Monday 23 December 2002 17:30, John Nichel wrote:
> How did you install php?  RPM, from source?  Check in /etc, or do a...
>
> find / -name php.ini

Or run a script



and look what "Configuration File (php.ini) Path" tells you. On the output ob 
this comamnd you can see the settin of register_globals, too.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem with compilation from CVS

2002-12-25 Thread Johannes Schlueter
On Thursday 26 December 2002 00:57, Bc. Radek Krejča wrote:
> Fatal error: main() [function.main]: Failed opening required
> './libraries/grab_globals.lib.php' (include_path='.:/usr/local/lib/php') in
> /home/starnet.cz/dbadmin3/index.php on line 8
>
> Where is problem, what I made bad?

Hi,

are you sure you have all PHP-Files your PHP-Project needs? The error message 
tells you that your script trys to load ./libraries/grab_globals.lib.php at 
index.php, line 8, check wether the grab_globals.lib.php is reachable...

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] using mail() with .info emails?

2002-12-29 Thread Johannes Schlueter
On Sunday 29 December 2002 23:45, Joe Popovich wrote:
> Im trying to send email using mail() to a .info email address and get an
> error message. I assume the function parses the email address and doesnt
> accept anything that isnt the customary .net, .com, etc. addresses. How can
> I get around this?

Usually it should work. Maybe a spam-filter from your provider or sth. like 
that. What kind of error message do you recieve?

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem in $_SERVER["PHP_SELF"]

2003-01-02 Thread Johannes Schlueter
On Thursday 02 January 2003 19:30, ªüYam wrote:
> There is warning of my script , the warning msg is about undefined variable
> $PHP_SELF..however, when I try to use $_SERVER["PHP_SELF"] instead of
> $PHP_SELF, there is no problem

Check your register_globals settings! Either switch it on (bad) or start your 
scripts with $PHP_SELF = $_SERVER['PHP_SELF'] or replace all $PHP_SELF with 
$_SERVER['PHP_SELF'].
If you don't know what register_globals is check the Manual!

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php.ini - changes aren't taking?

2003-01-06 Thread Johannes Schlueter
On Monday 06 January 2003 17:26, Rad Craig wrote:
> I have been trying to get my email working.  I have made some changes in
> the php.ini file in the Windoze directory, but when I run phpinfo() the
> changes I make aren't changing on what it prints out.
>
> I have logging turned on in my php.ini file, but phpinfo() says it's turned
> off.

Have a look at "Configuration File (php.ini) Path" on the output of phpinfo() 
it tells you which ph.ini file is used.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP/MySQL help?

2003-01-12 Thread Johannes Schlueter
Hi Steven,

On Sunday 12 January 2003 23:58, Steven M wrote:
> include 'db.php';
>
> $result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'");
> list($number) = mysql_fetch_row($result);

Here you are closing your conenction to the MySQL-Server:
> mysql_close();

> if($number==0)

But here you need it again:
> {mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'");
> mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");

So remove the mysql_close() if it don't work: Post the error message!

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] --without-mysl in configure command

2003-01-14 Thread Johannes Schlueter
On Tuesday 14 January 2003 19:16, gamin wrote:
> I have PHP 4.0.6 installed from rpm as part of RH 7.2. phpinfo() shows the
> configure command having --without-mysql. But my php scripts seeem to be
> able to run mysql commands happily.
>
> Could anybody point out why ? Doin rpm -aq | grep php shows me that
> php-mysql-4.0.6-7 is installed, maybe something to do with this.

Yes, the last part is the imortant ;-) The PHP-MySQL-Extension was compile as 
shared extension. It is included in your php.ini file with a command sth. 
like extension=php_mysql.so

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] --without-mysl in configure command

2003-01-14 Thread Johannes Schlueter
On Tuesday 14 January 2003 19:54, gamin wrote:
> Thx Johannes for pointing this out.  In the php.ini file i have

Your welcome ;-)

> extension=mysql.so Now i have another webserver running PHP where the
> configure command has --with-mysql=shared. I guess this means the same
> thing. Please could you second that and remove all doubts.

There is a small difference, if configured using --with-mysql=shared when 
running make it makes a php binary AND  the mysql.so. If congigured 
--without-mysql and then run make it makes only the php binary then you need 
to make the mysql.so yourself (cd ext/mysql; phpize; configure; make). But 
finally you'll get the same result.

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Johannes Schlueter
Hi,

On Saturday 25 January 2003 12:18, Frank Keessen wrote:
> The register_globals = Off. Dit the basic echo ($submit) but it displays
> nothing..
>
> Any thoughts somebody??

Switch on register_globals or (better!) use $_GET['submit'], $_POST['submit'] 
or $_REQUEST['submit'].

> Thanks for helping me out on this cloudy saturday (in Amsterdam!)

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Switch statement || How to output html without using echo() or print()

2003-01-25 Thread Johannes Schlueter
On Saturday 25 January 2003 20:38, CF High wrote:

> Each operation has @ 50 lines of html -- do I have to echo or print all
> this html!?

Try something like

Hello


johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MS Access

2003-01-28 Thread Johannes Schlueter
On Tuesday 28 January 2003 23:11, Todd Barr wrote:
> I have it connected, now I am getting the following error
>
> Warning: SQL error: , SQL state 0 in SQLConnect in c:\program
> files\apache group\apache\htdocs\test.php on line 7

What are you doing on line 7? What did you do on the lines 1-6? Sorry for the 
question, but my gem is broken...

johannes


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] if (a == b) ...

2003-01-29 Thread Johannes Schlueter
On Thursday 30 January 2003 02:39, David Freeman wrote:
> -8<-
> $a = "0";
> $b = "Friday August 22";
> -8<-
>
> and resulted in 'no match'.

Or try
  $a = 0;
  $c = (string) $a; // Now $c == "0"
or
  if (( (string) $a == (string) $b)) {
 ...

The manual could be your friend, too:
http://www.php.net/manual/en/language.types.type-juggling.php

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP Compile Error

2003-01-30 Thread Johannes Schlueter
Hi,

On Friday 31 January 2003 01:10, Robert Fitzpatrick wrote:
> Running Redhat 8.0
> PHP 4.3.0
>
> When I try to configure with the following:
> ./configure --with-apxs=/web_root/bin/apxs --enable-track-vars
> --enable-versioning --with-mysql=/usr/mysql --with-gd=/usr/local

Are you sure you told the correct path:
> --with-jpeg-dir=/usr/local/bin/ 
Try just /usr/local

> --with-png-dir=/usr/lib
> --with-zlib-dir=/usr/lib --with-zlib --enable-xslt --enable-cli
> --disable-debug --with-xslt-sablot

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Help with classes (oop)

2003-02-03 Thread Johannes Schlueter
On Monday 03 February 2003 20:45, Chris Boget wrote:
> function setData( $age, $name )
> {
>   $age = $age;
>   $name = $name;
> }

Is useless ;-) I think you wanted this:

 function setData( $age, $name )
 {
   $this->age = $age;
   $this->name = $name;
 }


johannes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Including images with mail() or pear mail

2003-02-06 Thread Johannes Schlueter
On Thursday 06 February 2003 19:12, Mark McCulligh wrote:
> I have a little app that sends email, All images I link back to the site
> Example: http://www.site.com/images/pic1.gif";>
>
> I know that with the normal mail() and pear mail function you can attach
> the image with the email.
> My question is what is better.  Linking the image back to the site is very
> easy, but is there any disadvantage to this option, that attaching the
> image to the email would fix.
>
> In short I am looking for the pros and cons to both methods.

What comesfirst to my mind is:

pro linking to Website:
 - small mail
con
 - user needs to be online to see it
 - this kind of linking could be disabled (you could create a link
   www.site.com?image?mail=32&user=USERID and you know 
   when and wether the user read the mail...) and some users 
   could dislike this

Best: Don't use images in a mail ;-) (just my opinion...)

johannes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] processing files

2003-02-06 Thread Johannes Schlueter
On Thursday 06 February 2003 19:18, Edward Peloke wrote:
> Is there a setting in the config file where I can tell php what extensions
> to process?

Not in the PHP configuration but in the Server configuration. For Apache add 
something like
  AddType application/x-httpd-php .xyz
to your httpd.conf, .htacces file to tell apache to parse all files ending 
.xyz using PHP

johannes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Print_r bug?

2003-02-12 Thread Johannes Schlueter
On Wednesday 12 February 2003 16:53, Leif K-Brooks wrote:
> I think I've found a print_r bug with reference recursion.  The
> following example script runs forever:
>
>  $GLOBALS['foo'] = &$GLOBALS;
> print_r($GLOBALS);
> ?>
>
> Am I correct in thinking this is a bug that should be reported?

No, thats no bug. $GLOBALS includes $GLOBALS which include $GLOBALS
Use var_dump for $GLOBALS instead ;-)

johannes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php