php-general Digest 1 Mar 2003 16:29:34 -0000 Issue 1912

Topics (messages 137664 through 137694):

Checking for HTTP:// at the start of a string and more ////
        137664 by: Philip J. Newman
        137665 by: Rasmus Lerdorf
        137688 by: Ernest E Vogelsinger

IS there a way.
        137666 by: Philip J. Newman
        137667 by: Leif K-Brooks
        137668 by: Rasmus Lerdorf
        137689 by: Ernest E Vogelsinger

Re: Post method
        137669 by: Alex Shi

Re: SORT_NUMERIC
        137670 by: Jason Wong

Re: testing for < 0
        137671 by: Leo Spalteholz
        137686 by: Niels Andersen

Re: IMAP error while compiling PHP-4.3.0
        137672 by: Jason Wong

Re: JP Graph
        137673 by: Uttam

Re: Mysql Date got prob!
        137674 by: Uttam

Re: Help!! with array's Please
        137675 by: Tom Rogers

mysql replication + mysql_pconnect
        137676 by: electroteque

Re: Is it multi-byte safe?
        137677 by: Jean-Christian Imbeault
        137692 by: Daniel Guerrier

Random not working?
        137678 by: Frank Keessen

mail function and Bcc restriction?
        137679 by: Mirza Muharemagic

Re: [PHP-I18N] addslashes(): Is it multi-byte safe?
        137680 by: Moriyoshi Koizumi
        137681 by: Jean-Christian Imbeault
        137682 by: Moriyoshi Koizumi

V_OPEN() causes crash?
        137683 by: Niels Andersen

Re: php.ini
        137684 by: Niels Andersen

Re: session help
        137685 by: Niels Andersen

authentication headers....
        137687 by: Sunfire

Re: [PHP-DB] Random not working?
        137690 by: Doug Thompson

Re: Get variable from PHP before submit
        137691 by: Chris Hayes

email pipe
        137693 by: qt

Constants and "Here Document" Interpolation
        137694 by: Daniel R. Hansen

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 ---
I would like to check for HTTP:// at the start of a string and for at least
1 . and a / at the end of a string.

I have tried ereg, but the documentation is not too clear how to format.




------
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]

+64 (9) 576 9491
+64 021-048-3999

------
Friends are like stars
You can't allways see them,
but they are always there.

------
Websites:

PhilipNZ.com - Design.
http://www.philipnz.com/
[EMAIL PROTECTED]

Philip's Domain // Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]

Vital Kiwi / NEWMAN.NET.NZ.
http://www.newman.net.nz/
[EMAIL PROTECTED]

------
Quote:

"God gave men both a penis and a brain,
but unfortunately not enough blood supply
to run both at the same time."

- Robin Williams
(Commenting on the Clinton/Lewinsky affair).



--- End Message ---
--- Begin Message ---
You don't need a regular expression.  Look at the substr() function.

-Rasmus

On Sat, 1 Mar 2003, Philip J. Newman wrote:

> I would like to check for HTTP:// at the start of a string and for at least
> 1 . and a / at the end of a string.
>
> I have tried ereg, but the documentation is not too clear how to format.
>
>
>
>
> ------
> Philip J. Newman.
> Head Developer
> [EMAIL PROTECTED]
>
> +64 (9) 576 9491
> +64 021-048-3999
>
> ------
> Friends are like stars
> You can't allways see them,
> but they are always there.
>
> ------
> Websites:
>
> PhilipNZ.com - Design.
> http://www.philipnz.com/
> [EMAIL PROTECTED]
>
> Philip's Domain // Internet Project.
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
>
> Vital Kiwi / NEWMAN.NET.NZ.
> http://www.newman.net.nz/
> [EMAIL PROTECTED]
>
> ------
> Quote:
>
> "God gave men both a penis and a brain,
> but unfortunately not enough blood supply
> to run both at the same time."
>
> - Robin Williams
> (Commenting on the Clinton/Lewinsky affair).
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
At 05:09 01.03.2003, Philip J. Newman said:
--------------------[snip]--------------------
>I would like to check for HTTP:// at the start of a string and for at least
>1 . and a / at the end of a string.
>
>I have tried ereg, but the documentation is not too clear how to format.
--------------------[snip]-------------------- 

Untested:

if (preg_match('/^http:\/\/[^\.\s]+\.[^\s]+\/$/i', $string))
    // valid string
else
    // invalid string

Should match a string beginning with 'http://', followed by one or more
characters that are no dots or whitespace, followed by a dot, followed by
one or more characters that are not whitespace, and terminated with a
slash. The terminating 'i' makes the search case insensitive.


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



--- End Message ---
--- Begin Message ---
  Is there a way to PING a URL and check if it returns a valid code like 200
... ??

------
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]

+64 (9) 576 9491
+64 021-048-3999

------
Friends are like stars
You can't allways see them,
but they are always there.

------
Websites:

PhilipNZ.com - Design.
http://www.philipnz.com/
[EMAIL PROTECTED]

Philip's Domain // Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]

Vital Kiwi / NEWMAN.NET.NZ.
http://www.newman.net.nz/
[EMAIL PROTECTED]

------
Quote:

"God gave men both a penis and a brain,
but unfortunately not enough blood supply
to run both at the same time."

- Robin Williams
(Commenting on the Clinton/Lewinsky affair).



--- End Message ---
--- Begin Message --- Try using exec() or backticks.

Philip J. Newman wrote:

 Is there a way to PING a URL and check if it returns a valid code like 200
... ??

------
Philip J. Newman.
Head Developer
[EMAIL PROTECTED]

+64 (9) 576 9491
+64 021-048-3999

------
Friends are like stars
You can't allways see them,
but they are always there.

------
Websites:

PhilipNZ.com - Design.
http://www.philipnz.com/
[EMAIL PROTECTED]

Philip's Domain // Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]

Vital Kiwi / NEWMAN.NET.NZ.
http://www.newman.net.nz/
[EMAIL PROTECTED]

------
Quote:

"God gave men both a penis and a brain,
but unfortunately not enough blood supply
to run both at the same time."

- Robin Williams
(Commenting on the Clinton/Lewinsky affair).






-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




--- End Message ---
--- Begin Message ---
The industrial strength way to do this is to use the curl functions.  See
php.net/curl.  You can alternatively just fsockopen yourself and issue the
request and see what the first line of the response is.

(by the way, a slightly shorter .sig would be appreciated)

-Rasmus

On Sat, 1 Mar 2003, Philip J. Newman wrote:

>   Is there a way to PING a URL and check if it returns a valid code like 200
> ... ??

--- End Message ---
--- Begin Message ---
At 05:40 01.03.2003, Philip J. Newman said:
--------------------[snip]--------------------
>  Is there a way to PING a URL and check if it returns a valid code like 200
>... ??
--------------------[snip]-------------------- 

Ping doesn't return a "200 OK" code... If you want to check for the
existence of a webserver at the given address you should try to read some
data from it. To check the return code you need a tool to return the HTTP
headers - check out cUrl (also supports SSL), or go on your own using
fsockopen().


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



--- End Message ---
--- Begin Message ---
> Curl will let you perform post operationgs, take a look at
> http://www.php.net/curl.
>
> Note you will need to have libcurl installed and PHP will have to be
> compiled with curl support.
>
> There are also probably classes that allow you to do post requests, take
> a look at the script repositories, hotscripts.com and you might try
> phpclasses.org as well.
  ^^^^^^^^^^^^^^
Thanks! I found a great class in phpclasses.org.

Alex


>
> Jason
> On Fri, 2003-02-28 at 14:09, Alex Shi wrote:
> > Hi,
> >
> > Any one know in a php script, if it is possible to simulate a post
method?
> > I mean I want to header() to an url but don't like to embed the
parameters
> > into that url.
> >
> > Thanks in advance!
> >
> > Alex Shi
> >
> >
> > --
> > ==================================================
> > Cell Phone Batteries at 30-50%+ off retail prices!
> > http://www.pocellular.com
> > ==================================================
> > TrafficBuilder Network:
> > http://www.bestadv.net/index.cfm?ref=7029
> > ==================================================
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
On Friday 28 February 2003 23:28, Jim Long wrote:
> Hi,
>
> Does anyone know how to make the flag "sort_numeric" work?
> Will it work with asort?
>
> asort ($numeric_array, SORT_NUMERIC);
> I've tried this but it looks like it's having problems with the comma in
> big numbers.

What comma in big numbers? Numbers aren't supposed to have commas. If it has a 
comma it's a string.

> I'm not absolutely sure, but it looks like it's ignoring everything
> after a comma when it sorts.

Snippet from the manual "The value is given by the initial portion of the 
string. If the string starts with valid numeric data, this will be the value 
used.". As a comma is not valid numeric data, it and everything after, will 
be ignored.

-- 
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
------------------------------------------
/*
"It may be that our role on this planet is not to worship God but to
 create him."
 -Arthur C. Clarke
*/


--- End Message ---
--- Begin Message ---
On February 28, 2003 10:41 am, Leif K-Brooks wrote:
> Try $timeb <> ''.
>

Well whatta ya know I learn something new every day..  I thought the 
only valid not equal operator was !=...  I'm used to using <> only 
for SQL server stored procedures or VB..

leo

--- End Message ---
--- Begin Message ---
Data from POST is a hash table of strings, so you should use this to check
for zero:

if ($_POST['field'] == "0")
 // Zero was entered



--- End Message ---
--- Begin Message ---
On Saturday 01 March 2003 06:30, Patrick Teague wrote:
> I'm trying to compile php on Mandrake 9, but this latest error during
> compile has me stumped as I've installed all the imap-devel type rpms.
>
> .....
> checking for IMAP support... yes
> checking for pam_start in -lpam... yes
> checking for crypt in -lcrypt... (cached) yes
> configure: error: Cannot find imap library (libc-client.a). Please check
> your IMAP installation
>
> any ideas?  I checked the php.net faq on building, but I haven't found any
> info about this.  I've searched the imap rpms I have & even searched the
> whole system, but it couldn't find 'libc-client.a' anywhere.

Are you using RPMs? On a RH system that file is provided by the IMAP-devel 
package. I suppose it's similar for MDK. In general you need to install the 
devel packages of any libraries that you wish to use.

-- 
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
------------------------------------------
/*
Hanson's Treatment of Time:
        There are never enough hours in a day, but always too many days
        before Saturday.
*/


--- End Message ---
--- Begin Message ---
localhost is the name of your own machine, for others localhost means their
machines.

redirect to the network ip address or host name of your server instead of
localhost.

regds,
-----Original Message-----
From: K [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 09:47
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: JP Graph


Hi all,
I'm using JPGraph on a localhost for a website opened via a host
redirect.
My problem is that nobody can see the graphs but me ('cause I'm on
localhost).

Any clues?

Thx.


--- End Message ---
--- Begin Message ---
try:

select
        date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-%m-%d') as
dept_date1
from mytable
where
        (date_add(arrivaldate1, INTERVAL nights1 DAY) BETWEEN '2003-02-01' AND
'2003-02-10')

regds,
-----Original Message-----
From: Dhaval Desai [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 15:48
To: [EMAIL PROTECTED]
Subject: Mysql Date got prob!


Hello,

As related to my earlier question


select  date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y-
%m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN
'2003-02-01' AND '2003-02-10')

The above query is valid but returns 0 because 'dept_date1' is treated
as a
string. I want dept_date1 to be treated as  date so that it can be
compared.


I hope it is possible...


Thank you!

-Dhaval


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail



--- End Message ---
--- Begin Message ---
This is a forwarded message
From: Tom Rogers <[EMAIL PROTECTED]>
To: Richard Kurth <[EMAIL PROTECTED]>
Date: Saturday, March 1, 2003, 5:59:11 PM
Subject: [PHP] Help!! with array's Please

===8<==============Original message text===============
Hi,

Saturday, March 1, 2003, 4:28:27 PM, you wrote:
RK> Hello Tom,
RK> I would love to see a basic class to do all of this. I took what you
RK> showed me and turned it into a function that works perfect.
RK> The one thing that I have had a lot of trouble with is manipulating
RK> text based data. And out of all the books I have, none of them get
RK> into doing this type of programing.

Here it is

class groupClass {
        var $groups = array();
        var $gid = 499;         //if there are no groups, new ones start at this 
number +1
        function groupClass($file){
                $r = false;
                if(file_exists($file)){
                        $in = file($file);
                        //build an array using names as keys so we can identify 
entries easier
                        while(list($key,$val) = each($in)){
                                $val = trim($val);      //get rid of newlines
                                list($name,$pass,$gid,$userlist) = split (":", $val);
                                if($gid > $this->gid){
                                        $this->gid = $gid;              //keep track 
of the highest gid number
                                }
                                $this->groups[$name]['gid'] = $gid;
                                $this->groups[$name]['pass'] = $pass;
                                $users = explode(',',$userlist);        //get an array 
of users
                                while(list($key2,$user) = each($users)){
                                        // build an array using name as key
                                        $this->groups[$name]['users'][$user] = 1;
                                }
                        }
                        $r = true;
                        //debug
                        //echo '<pre>';
                        //print_r($this->groups);
                        //echo '</pre>';
                }
                Return $r;
        }
        function addGroup($group,$gid = 0,$pass = 'x'){
                $r = false;
                if(!isset($this->groups[$group])){
                        $gid = ($gid > 0)? $gid : $this->gid +1;        // if no gid 
then generate the next highest
                        $this->groups[$group]['gid'] = $gid;
                        $this->groups[$group]['pass'] = $pass;
                        $r = true;
                }
                Return $r;
        }
        function delGroup($group){
                $r = false;
                if(isset($this->groups[$group])){
                        unset($this->groups[$group]);
                        $r = true;
                }
                Return $r;
        }
        function addUser($group,$user){
                $r = false;
                if(isset($this->groups[$group])){
                        $this->groups[$group]['users'][$user] = 1;
                        $r = true;
                }
                Return $r;
        }
        function delUser($group,$user){
                $r = false;
                if(isset($this->groups[$group]['users'][$user])){
                        unset($this->groups[$group]['users'][$user]);
                        $r = true;
                }
                Return $r;
        }
        function dump($file){
                $r = false;
                if($handle = fopen($file,'w')){
                        $groups = $this->groups;        //get a copy of the groups 
array (saves typing :)
                        //debug
                        //echo '<pre>';
                        //print_r($this->groups);
                        //echo '</pre>';
                        while(list($key,$val) = each($groups)){ //go through the groups
                                $users = $groups[$key]['users'];                       
 //get a copy of the users array
                                $x = 0;
                                $userlist = '';
                                while(list($key2,$val2) = each($users)){        // add 
the users
                                        $userlist .= ($x > 0)? ','.$key2 : $key2; // 
don't need a comma for the first run
                                        $x++;
                                }
                                $gid = $groups[$key]['gid'];
                                $pass = $groups[$key]['pass'];
                                $list = $key.':'.$pass.':'.$gid.':'.$userlist."\n"; // 
make the entry
                                fputs($handle,$list);   //save it
                        }
                        $r = true;
                        fclose($handle);
                }
                Return $r;
        }
}

//usage
$g = new groupClass('group');
$g ->addGroup('site8');
$g ->addUser('site8','fred');
$g->delUser('site7','tester7');
$g->dump('group2');









-- 
regards,
Tom

===8<===========End of original message text===========



-- 
regards,
 Tom                            mailto:[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
hi there i am setting up a test replication slave server as a mysql db
master backup if it fails , i would like to know how to dynamically connect
to the slave if the master fails , something really strange i have set the
host like localhost:3307 for the slave but is still connecting to the master
, and if i shut down the master it wont goto the slave :|



--- End Message ---
--- Begin Message --- Is addslashes() multi-byte safe?

I will bu sing it to escape multi-byte input and wouldn't want it to mangle anything...

Thanks,

Jc


--- End Message ---
--- Begin Message ---
why not try it and let us know.
--- Jean-Christian Imbeault <[EMAIL PROTECTED]>
wrote:
> Is addslashes() multi-byte safe?
> 
> I will bu sing it to escape multi-byte input and
> wouldn't want it to 
> mangle anything...
> 
> Thanks,
> 
> Jc
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

--- End Message ---
--- Begin Message ---
Hi All,

I'm trying to get a random record each time this script runs; Only it's giving me 
everytime the first record back.. No random at all..

// generate and execute query
$query = "SELECT stedenid, naamstad, stadomschrijvk FROM steden ORDER BY RAND() LIMIT 
1";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$row = mysql_fetch_object($result);
echo $row->naamstad;


Version info;

PHP 4.3.1
Mysql 3.23.54 

When i'm trying to excute the SELECT statement in phpmyadmin; i'm only getting the 
first record back and when i'm taking off the LIMIT 1 it will display all the records 
in ascending order so also not in random..


Regards,

Frank






--- End Message ---
--- Begin Message ---
Hi all,

   are there any restrictions for mail function, when I use Bcc? how
   many email adresses can i put in Bcc, are there any PHP
   restriction, or just memory restriction, or something else?

   Thanx a lot

   Mirza
   [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Jean-Christian Imbeault <[EMAIL PROTECTED]> wrote:

> Is addslashes() multi-byte safe?
> 
> I will bu sing it to escape multi-byte input and wouldn't want it to 
> mangle anything...

Partially yes.

Strings encoded in GB2312(CP936), big5, Shift_JIS are known to be 
clobbered by addslashes().

UTF-8, EUC-JP, EUC-KR, EUC-CN and EUC-TW are not affected.

Moriyoshi


--- End Message ---
--- Begin Message --- Moriyoshi Koizumi wrote:

Partially yes.


Strings encoded in GB2312(CP936), big5, Shift_JIS are known to be clobbered by addslashes().

Sh*t ... and I just added a whole bunch of addslashes() to my code to prevent SQL attacks. And of course my web pages are for Japanese ... and most of them will be using SJIS.


If I have internal_encoding set to EUC-JP does that mean that all POST or GET vars passed in will be translated to EUC-Jp and hence my addslahes will be fine?

I sure hope so ...

Jc


--- End Message ---
--- Begin Message ---
Jean-Christian Imbeault <[EMAIL PROTECTED]> wrote:

> Moriyoshi Koizumi wrote:
> > 
> > Partially yes.
> > 
> > Strings encoded in GB2312(CP936), big5, Shift_JIS are known to be 
> > clobbered by addslashes().
> 
> Sh*t ... and I just added a whole bunch of addslashes() to my code to 
> prevent SQL attacks. And of course my web pages are for Japanese ... and 
> most of them will be using SJIS.
> 
> If I have internal_encoding set to EUC-JP does that mean that all POST 
> or GET vars passed in will be translated to EUC-Jp and hence my 
> addslahes will be fine?

That's the case as long as the browser precisely sends form contents as 
EUC-JP encoded strings and no automagical encoding conversion is performed 
there by mbstring module (I mean output_handler=mb_output_handler in ini 
settings). Then you have to prepare the page contents to be encoded in 
EUC-JP.

But it's very probable that clients send form contents in UTF-8 when GET 
method is used..

Moriyoshi


--- End Message ---
--- Begin Message ---
Hello,

I did my first PHP extension (a simple template engine), and I found out I
could not ude V_OPEN() - it simply crashed PHP.

I then searched the web and found somebody mentioning something about a
function called VCWD_OPEN(), which works perfectly, but is not
documented!!!!

Any idea why did V_OPEN() crashes PHP?



--- End Message ---
--- Begin Message ---
Check that php_gd2.dll is in your C:\PHP\ folder.

"Anthony Ritter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I run the following script:
>
> <?
> phpinfo();
> ?>
>
> // the page loads o.k. when the semi-colon remains as in:
> ;extension=php_gd2.dll
>
> but if I remove the semicolon as in:
>
> extension=php_gd2.dll
>
> the page won't load and the server hangs up.
> ..........................................
>
> \\ this is my php.ini file on MS Win 98/ PHP/ Apache
>
>
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\PHP\"
>
> ; Whether or not to enable the dl() function.  The dl() function does NOT
> work
> ; properly in multithreaded servers, such as IIS or Zeus, and is
> automatically
> ; disabled on them.
> enable_dl = On
>
> extension=php_gd2.dll
> ...................................................
>
> Any advice on how I can install GD libraries greatly appreciated.
> Thank you.
> Tony Ritter
>
>
>
>
>



--- End Message ---
--- Begin Message ---
> i am having a terrible time killing the session....
> someone please please help me...

This one works for me:
session_start();
$_SESSION = array();
session_destroy();

But I am surprised that there is no single command to kill the session.
The semantics of "session_destroy()" suggest that it does just that. But, as
you have found out, it does not...



--- End Message ---
--- Begin Message ---
how would you show a header message or basically force apache to show an
error page of its own like 401 if someone hits cancle on the php auth header
function?

and i have a line like:
header("WWW-Authenticate: basic realm='a realm name'");
//i know what that means look at next line...
header("HTTP/1.0 401 Unathorized");
//what does that line do since the first one is the login box
//dont know what the second one is for
//and third line:
echo "stuff to print on screen if person hits cancle...

so was wondering how would i use a header on the cancle part and what does
the header with unathorized mean






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


--- End Message ---
--- Begin Message ---
This recent thread from the mysql list explains a lot about the
problem.
http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:15034


hth,
Doug

On Sat, 1 Mar 2003 12:24:57 +0100, Frank Keessen wrote:

>Hi All,
>
>I'm trying to get a random record each time this script runs; Only it's giving me 
>everytime the first record back.. No random at all..
>
>// generate and execute query
>$query = "SELECT stedenid, naamstad, stadomschrijvk FROM steden ORDER BY RAND() LIMIT 
>1";
>$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
>$row = mysql_fetch_object($result);
>echo $row->naamstad;
>
>
>Version info;
>
>PHP 4.3.1
>Mysql 3.23.54 
>
>When i'm trying to excute the SELECT statement in phpmyadmin; i'm only getting the 
>first record back and when i'm taking off the LIMIT 1 it will display all the records 
>in ascending order so also not in random..
>
>
>Regards,
>
>Frank
>
>
>
>
>
>



--- End Message ---
--- Begin Message --- I am putting my gamma-epsilon-psycho telepathy beamer to the maximum but there are too many coders inbetween us, i cannot receive you.

Please give a little hint on what these functions are and what value comes from where and goes where.

At 04:00 1-3-2003, you wrote:
I'm trying to implement the following functionality into the file test.php:

When I scroll down the page and then hit a button, the page should remember
the scrolled position, refresh the page and then scroll down to the
remembered position. I've almost managed to make this work, but only almost.

The first time I click one of the buttons, the page won't scroll, but after
that it works fine. I think the reason for this is that the function
hentKoordinat() gets called before $teller is set. hentKoordinat() uses
$teller.

Anyone know a way to make this work?

Thanks alot!

Lars


File test.php:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<?php echo "

Ykoordinat: " . $yKoord . "

"; echo "Teller: " . $teller; for($i=0; $i<150; $i++) { echo '
'; } for($teller=0; $teller<2; $teller++) { ?> <?php $teller++; ?> <?php } //for($teller=0; $i<2; $i++) { ?>



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



--- End Message ---
--- Begin Message ---
Dear Sirs,

I wa using

my @InBody = <STDIN>;

To get data from email after piping. I am not sure that what I should use to
have same result with php?

I just want to have email' s data into my php script to handle.

Best Regards



--- End Message ---
--- Begin Message ---
Can anyone tell me if it is possible (and how) to use defined constants
within "here document" content?  I've not been successful finding anything
on this in the online docs.

Thanks!

Dan

--- End Message ---

Reply via email to