php-general Digest 10 Dec 2001 02:29:40 -0000 Issue 1043

Topics (messages 77148 through 77175):

Re: PREG
        77148 by: Hank Marquardt

Help!
        77149 by: ryan adorable
        77150 by: Alex Shi
        77151 by: Miles Thompson
        77152 by: ryan adorable
        77153 by: ryan adorable
        77161 by: Jason Lotito
        77165 by: Miles Thompson

Re: How to compute time to load page...
        77154 by: Hugh Bothwell

introduction
        77155 by: Oliver Keller
        77157 by: Andrew Forgue

- References Clarification Please -
        77156 by: Matt Friedman
        77160 by: Jason Lotito

help with ftp command
        77158 by: Kansas Territory
        77159 by: Andrew Brampton

passing form values
        77162 by: AAustin
        77163 by: Fred

Running WML (WAP services) under PHP
        77164 by: M
        77166 by: Jack Dempsey
        77169 by: Shane Wright
        77171 by: Gianluca Baldo

eval on a form
        77167 by: Paul Roberts
        77172 by: Diego Pérez

Re: SQL Query Question
        77168 by: Fred

how do i get the browser's screen resolution?
        77170 by: Roel Derckx

Store locator / postcode proximity
        77173 by: Jason Murray
        77174 by: Smith, Benjamin

Doing statistics with MySql data?
        77175 by: Daniel Alsén

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi Matt,

first it might be easier to just use split here --

$fields = split("\t",$line);

.... I say might because I suspect that the records you have that are
converting incorrectly perhaps don't follow the tab convention? ... said
another way, I've never seen preg break because the file got over a meg
in size;)

On Fri, Dec 07, 2001 at 11:50:51PM -0000, Matthew Moreton wrote:
> Hi people.  I am having some trouble with the PREG functions in php.
> 
> Here's what I am trying to do...
> 
> First of all I am reading in a file which is 1.5mb's in size, it could be many more, 
>going up to 8mb's, the contents of the file is input to a string.
> 
> The format of the file is as follows...
> 
> #    #    #    "quoted text"    "quoted text"    #    #
> 
> the # represents a number, in the case of the first 3 numbers they are only ever 1 
>or 2 digits long.  The final two digits can get to be rather big in size, thousands 
>and millions.  Each element is seperated by a tab space and then a carriage return 
>(\r) terminates each record.
> 
> I use preg_match_all to find all the lines that start with 1 and 1 as there first 
>numbers, typically there will be 25 entries of 1 1.  So I am looking for all lines in 
>this format:
> 
> 1    1    #    "quoted text"    "quoted text"    #    #
> 
> I have the search pattern figured out, it is as follow:
> 
> 
>preg_match_all("/($first)\t($second)\t([0-9]{1,2})\t\"([^\"]*)\"\t\"([^\"]*)\"\t([0-9]*)\t([0-9]*)\r/",
> $input, $output, PREG_SET_ORDER );
> 
> When this pattern finds a matching line beginning equal to $first and $second it 
>will put all the elements of the record into the array $output. $output[0] being the 
>array of the first elements found, $array[1] being the second line that was matched, 
>and so on.
> 
> This pattern does actually work to some extent.  When the filesize is low (100kb) it 
>works fine, but when I start to get over that filesize it becomes greedy and the 
>$second value doesnt seem to be taken into account when it searchs.  It seems to 
>return everything that equals the following:
> 
> 1    #    #    "quoted text"    "quoted text"    #    #
> 
> Obviously not what I want.  Could this be some sort of overflow problem?  I am at a 
>lost end here, so if anyone could offer some insight as to why it is not functioning 
>correctly I would most welcome it.  Overwise the only solution I can think of is 
>chopping up the input, I dont really want to go down that path, as it seems like a 
>rather cheap workaround.
> 
> Thanks.
> 
> Matt

-- 
Hank Marquardt <[EMAIL PROTECTED]>
http://web.yerpso.net
GPG Id: 2BB5E60C
Fingerprint: D807 61BC FD18 370A AC1D  3EDF 2BF9 8A2D 2BB5 E60C
*** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD
*** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild 
*** Beginning PHP -- Starts January 7, 2002 
*** See http://www.hwg.org/services/classes
--- End Message ---
--- Begin Message ---
Hi,

   I created a poll program for my homepage. When i vote some field in my database 
gets incremented, but after successfully voting when i clicked on reload/refresh of my 
browser the said field is also incremented. How can I fix/avoid this problem?

   Hoping for a reply.
   Thanks

Ryan

_____________________________________________________________
Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
--- End Message ---
--- Begin Message ---
Have the page expired at once!

Alex

----- Original Message -----
From: "ryan adorable" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 09, 2001 10:07 AM
Subject: [PHP] Help!


> Hi,
>
>    I created a poll program for my homepage. When i vote some field in my
database gets incremented, but after successfully voting when i clicked on
reload/refresh of my browser the said field is also incremented. How can I
fix/avoid this problem?
>
>    Hoping for a reply.
>    Thanks
>
> Ryan
>
> _____________________________________________________________
> Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

--- End Message ---
--- Begin Message ---

Pause for a moment and think about it. You're obviously doing a good job in 
maintaining state, but after your update to the database the var which 
transfers the data isn't being cleared.

Regards - Miles Thompson

At 07:07 AM 12/9/2001 -0800, ryan adorable wrote:
>Hi,
>
>    I created a poll program for my homepage. When i vote some field in my 
> database gets incremented, but after successfully voting when i clicked 
> on reload/refresh of my browser the said field is also incremented. How 
> can I fix/avoid this problem?
>
>    Hoping for a reply.
>    Thanks
>
>Ryan
>
>_____________________________________________________________
>Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
how to do that?

ryan

--- "Alex Shi" <[EMAIL PROTECTED]> wrote:
>Have the page expired at once!
>
>Alex
>
>----- Original Message -----
>From: "ryan adorable" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, December 09, 2001 10:07 AM
>Subject: [PHP] Help!
>
>
>> Hi,
>>
>>    I created a poll program for my homepage. When i vote some field in my
>database gets incremented, but after successfully voting when i clicked on
>reload/refresh of my browser the said field is also incremented. How can I
>fix/avoid this problem?
>>
>>    Hoping for a reply.
>>    Thanks
>>
>> Ryan
>>
>> _____________________________________________________________
>> Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

_____________________________________________________________
Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
--- End Message ---
--- Begin Message ---
yup, that is my problem, i can't clear the data on a variable. 

The data is from a <form> tag (radio button). I know you know what im talking about 
here :)

Ryan

--- Miles Thompson <[EMAIL PROTECTED]> wrote:
>
>Pause for a moment and think about it. You're obviously doing a good job in 
>maintaining state, but after your update to the database the var which 
>transfers the data isn't being cleared.
>
>Regards - Miles Thompson
>
>At 07:07 AM 12/9/2001 -0800, ryan adorable wrote:
>>Hi,
>>
>>    I created a poll program for my homepage. When i vote some field in my 
>> database gets incremented, but after successfully voting when i clicked 
>> on reload/refresh of my browser the said field is also incremented. How 
>> can I fix/avoid this problem?
>>
>>    Hoping for a reply.
>>    Thanks
>>
>>Ryan
>>
>>_____________________________________________________________
>>Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

_____________________________________________________________
Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
--- End Message ---
--- Begin Message ---
What you need to do is make sure the same person doesn't vote twice
either via cookie, session, or comparing IP address.  These are all
simple solutions.  For example, if the IP address is the same as stored
in the DB, then the person as tried to vote twice, and you can prevent
that.

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net

> -----Original Message-----
> From: ryan adorable [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 09, 2001 10:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Help!
> 
> 
> Hi,
> 
>    I created a poll program for my homepage. When i vote some
> field in my database gets incremented, but after successfully 
> voting when i clicked on reload/refresh of my browser the 
> said field is also incremented. How can I fix/avoid this problem?
> 
>    Hoping for a reply.
>    Thanks
> 
> Ryan
> 
> _____________________________________________________________
> Sign up for FREE email from FloppyDisk at
> http://www.floppydiskonline.com
> 
> --
> PHP General Mailing List 
> (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED] To contact the list 
> administrators, e-mail: [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---

What do you do with the var when you finish updating the database? Do you 
unset it?
Are you passing the value of your "submit" button as a default?

Use a few echo statements and find out what's going on.

Miles

At 07:17 AM 12/9/2001 -0800, ryan adorable wrote:
>yup, that is my problem, i can't clear the data on a variable.
>
>The data is from a <form> tag (radio button). I know you know what im 
>talking about here :)
>
>Ryan
>
>--- Miles Thompson <[EMAIL PROTECTED]> wrote:
> >
> >Pause for a moment and think about it. You're obviously doing a good job in
> >maintaining state, but after your update to the database the var which
> >transfers the data isn't being cleared.
> >
> >Regards - Miles Thompson
> >
> >At 07:07 AM 12/9/2001 -0800, ryan adorable wrote:
> >>Hi,
> >>
> >>    I created a poll program for my homepage. When i vote some field in my
> >> database gets incremented, but after successfully voting when i clicked
> >> on reload/refresh of my browser the said field is also incremented. How
> >> can I fix/avoid this problem?
> >>
> >>    Hoping for a reply.
> >>    Thanks
> >>
> >>Ryan
> >>
> >>_____________________________________________________________
> >>Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>_____________________________________________________________
>Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---

"Alex Shi" <[EMAIL PROTECTED]> wrote in message
006b01c18063$336e9f90$0105050a@pony">news:006b01c18063$336e9f90$0105050a@pony...
> Basically I agree with you. But the second time to get time must be done
> after the page is rendered on local browser. So I suggest to use
Javascript
> for the second time to get time, and pass the first time value into a js
> function.

As another person noted, there may be significant differences
between client and server clocks.  For accuracy, you must use
the same clock for both measurements - and you cannot use
the client-side clock, because javascript will not run until the
page is fully loaded.

How about this: embed 'start' and 'end' timestamps in the page
when it is generated, then use a javascript fake preload (call
another script instead of an image) to pass them back - the
time they are received is your timestamp for the page being
loaded.  This will obviously include a small additional delay for
the second request, but it should give you a close upper bound
on the actual time.




--- End Message ---
--- Begin Message ---
hi folks, 



being new to php, I just subscribed to this list - so I find someone to answer my dumb 
questions :-). 

i´m working thru some tutorials on mysql and php, just making the first steps. it´s a 
great experience so far !




cu


oliver




--- End Message ---
--- Begin Message ---
Glad to hear it :-)

----- Original Message -----
From: "Oliver Keller" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 09, 2001 12:16 PM
Subject: introduction


> hi folks,
>
>
>
> being new to php, I just subscribed to this list - so I find someone to
answer my dumb questions :-).
>
> i´m working thru some tutorials on mysql and php, just making the first
steps. it´s a great experience so far !
>
>
>
>
> cu
>
>
> oliver
>
>
>
>

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

I'm just trying to get my head around references and the uses etc... I
have reviewed the manual section on this a few times but I'm still a bit
fuzzy on it.

First of all, here's some code I'm using to pass a reference to an
object (which has global scope) to the constructor of a class "Site":

function Site(&$dbObj)
{
 $this->db = $dbObj;
}

I think what should happen here is that $this->db is now a reference to
the global version of the object, by way of the "&" in the function
defn. Is this correct? 

Also, I'm not sure about the benefits of using references as opposed to
copies. If anyone would like to elaborate on the reasons for using a
reference instead of a copy, please do so; it would be much appreciated.


Many Thanks,
Matt Friedman




--- End Message ---
--- Begin Message ---
Actually, $this->db will be a copy of $dbObj.

Here is what you have:

<?php
$db = function2createDBObject();

Site($db);

function Site(&$dbObj)
{
 $this->db = $dbObj;
}

?>

What this means is that $dbObj is a reference to $db.  However,
$this->db is a copy.  If you want $this->db to be a reference of $db,
you have to create a reference to $dbObj.

function Site(&$dbObj)
{
 $this->db =& $dbObj;
}

Like that.

Jason Lotito
[EMAIL PROTECTED]
www.NewbieNetwork.net


> -----Original Message-----
> From: Matt Friedman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 09, 2001 1:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] - References Clarification Please -
> 
> 
> Hi,
> 
> I'm just trying to get my head around references and the uses
> etc... I have reviewed the manual section on this a few times 
> but I'm still a bit fuzzy on it.
> 
> First of all, here's some code I'm using to pass a reference
> to an object (which has global scope) to the constructor of a 
> class "Site":
> 
> function Site(&$dbObj)
> {
>  $this->db = $dbObj;
> }
> 
> I think what should happen here is that $this->db is now a
> reference to the global version of the object, by way of the 
> "&" in the function defn. Is this correct? 
> 
> Also, I'm not sure about the benefits of using references as
> opposed to copies. If anyone would like to elaborate on the 
> reasons for using a reference instead of a copy, please do 
> so; it would be much appreciated.
> 
> 
> Many Thanks,
> Matt Friedman
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED] To contact the list 
> administrators, e-mail: [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---
Trying to use the ftp function in PHP3. I've been able to use it to ftp 
an existing file, but what I would like to do is create a file on the 
fly, and then ftp that file to a remote location.

for example, if I have some text defined in a variable like so:

$mytext = "here is some text"

I would like to be able to ftp this file and save it as "myfile.txt"

any suggestions would be appreciated.

Kansast

--- End Message ---
--- Begin Message ---
How about you just create the file locally (with some random name) upload it
(with correct name) then delete the local copy...

Andrew
----- Original Message -----
From: "Kansas Territory" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 09, 2001 5:32 PM
Subject: [PHP] help with ftp command


> Trying to use the ftp function in PHP3. I've been able to use it to ftp
> an existing file, but what I would like to do is create a file on the
> fly, and then ftp that file to a remote location.
>
> for example, if I have some text defined in a variable like so:
>
> $mytext = "here is some text"
>
> I would like to be able to ftp this file and save it as "myfile.txt"
>
> any suggestions would be appreciated.
>
> Kansast
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

--- End Message ---
--- Begin Message ---
Hi

I have a slight design problem. I have some form values (user details) which I want to 
pass to a web page which is two pages away. I.e. I have the variables as hidden values 
in a form (username, address, password etc) and the user submits these and cc details. 
If the credit card processing centre gives a yes answer to processing the cc 
transaction the address details are added to the db   if not they are lost. At present 
the cc script is a single include on a blank page which runs for a couple of seconds 
and then the user is transferred to a success or failure page depending on the cc 
transaction processing companies answer. 

Problem is how do I maintain state of the users address... values for the two pages.  

1. make them session- global values which seems a bit overkill
2. Make the cc an include and post back to itself.
3. Is it possible to have a hidden form which runs itself so carrying the form values 
to the final page.

I am sure there is a simple answer and thanks in advance. Hope I have explained it OK.

Andrew
--- End Message ---
--- Begin Message ---
This is precisely the type of situation session variables are designed for.
I'm not sure why you would think that using sessions is overkill.  You can
accomplish your task with sessions in less lines of code than it would take
to implement another solution and the sessions solution is more elegant.

Fred

Aaustin <[EMAIL PROTECTED]> wrote in message
000a01c180ef$51d7a2b0$[EMAIL PROTECTED]">news:000a01c180ef$51d7a2b0$[EMAIL PROTECTED]...
Hi

I have a slight design problem. I have some form values (user details) which
I want to pass to a web page which is two pages away. I.e. I have the
variables as hidden values in a form (username, address, password etc) and
the user submits these and cc details. If the credit card processing centre
gives a yes answer to processing the cc transaction the address details are
added to the db   if not they are lost. At present the cc script is a single
include on a blank page which runs for a couple of seconds and then the user
is transferred to a success or failure page depending on the cc transaction
processing companies answer.

Problem is how do I maintain state of the users address... values for the
two pages.

1. make them session- global values which seems a bit overkill
2. Make the cc an include and post back to itself.
3. Is it possible to have a hidden form which runs itself so carrying the
form values to the final page.

I am sure there is a simple answer and thanks in advance. Hope I have
explained it OK.

Andrew



--- End Message ---
--- Begin Message ---
Hello, I am trying to develop some WML apps using PHP.
To run WML apps into my local Apache (win98) server, I added

AddType application/x-httpd-php .wml

into httpd.conf. This works ok when calling directly from netscape
http://localhost/mywml.wml ,
treating script like a true PHP program.

BUT.... when writing a REAL WML app. (cards and so) and trying to run on
NOKIA simulator (by calling URL), it shows a parse error on line 1 (for
all scripts).
The same script, when executed in file mode on NOKIA sim (that is first
load .wml file and then press SHOW button) , works fine, proving the
error is not in script, but in way PHP interpret .WML pages.

I suspect PHP introduces some invisible code (just 1 byte?) or something
at beginning of .WML page.


Thanks for your attn.

Miguel


--- End Message ---
--- Begin Message ---
i think that php sends out headers showing that the page is html.....not
sure bout this, but you might have to send a diff header......

-----Original Message-----
From: M [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 09, 2001 5:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Running WML (WAP services) under PHP


Hello, I am trying to develop some WML apps using PHP.
To run WML apps into my local Apache (win98) server, I added

AddType application/x-httpd-php .wml

into httpd.conf. This works ok when calling directly from netscape
http://localhost/mywml.wml ,
treating script like a true PHP program.

BUT.... when writing a REAL WML app. (cards and so) and trying to run on
NOKIA simulator (by calling URL), it shows a parse error on line 1 (for
all scripts).
The same script, when executed in file mode on NOKIA sim (that is first
load .wml file and then press SHOW button) , works fine, proving the
error is not in script, but in way PHP interpret .WML pages.

I suspect PHP introduces some invisible code (just 1 byte?) or something
at beginning of .WML page.


Thanks for your attn.

Miguel



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Hi

> i think that php sends out headers showing that the page is html.....not
> sure bout this, but you might have to send a diff header......

This is true - you should send a content type of either text/x-wap.wml or 
text/vnd.wap.wml (for WML 1.0 and 1.1 respectively)...

header('Content-Type: text/x-wap.wml');

PHP doesnt insert anything extra into the output that isn't in the script you 
write - check there is no leading whitespace before the first '<?'  (same 
applies in all include files)

--
Shane


> -----Original Message-----
> From: M [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 09, 2001 5:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Running WML (WAP services) under PHP
>
>
> Hello, I am trying to develop some WML apps using PHP.
> To run WML apps into my local Apache (win98) server, I added
>
> AddType application/x-httpd-php .wml
>
> into httpd.conf. This works ok when calling directly from netscape
> http://localhost/mywml.wml ,
> treating script like a true PHP program.
>
> BUT.... when writing a REAL WML app. (cards and so) and trying to run on
> NOKIA simulator (by calling URL), it shows a parse error on line 1 (for
> all scripts).
> The same script, when executed in file mode on NOKIA sim (that is first
> load .wml file and then press SHOW button) , works fine, proving the
> error is not in script, but in way PHP interpret .WML pages.
>
> I suspect PHP introduces some invisible code (just 1 byte?) or something
> at beginning of .WML page.
>
>
> Thanks for your attn.
>
> Miguel
--- End Message ---
--- Begin Message ---
Try

<?
header("Content-type: text/vnd.wap.wml;charset=iso-8859-1");
echo "<?xml version=\"1.0\"?>\n";
?>

Cheers,

            Gianluca


JD> i think that php sends out headers showing that the page is html.....not
JD> sure bout this, but you might have to send a diff header......

JD> -----Original Message-----
JD> From: M [mailto:[EMAIL PROTECTED]]
JD> Sent: Sunday, December 09, 2001 5:08 PM
JD> To: [EMAIL PROTECTED]
JD> Subject: [PHP] Running WML (WAP services) under PHP


JD> Hello, I am trying to develop some WML apps using PHP.
JD> To run WML apps into my local Apache (win98) server, I added

JD> AddType application/x-httpd-php .wml

JD> into httpd.conf. This works ok when calling directly from netscape
JD> http://localhost/mywml.wml ,
JD> treating script like a true PHP program.

JD> BUT.... when writing a REAL WML app. (cards and so) and trying to run on
JD> NOKIA simulator (by calling URL), it shows a parse error on line 1 (for
JD> all scripts).
JD> The same script, when executed in file mode on NOKIA sim (that is first
JD> load .wml file and then press SHOW button) , works fine, proving the
JD> error is not in script, but in way PHP interpret .WML pages.

JD> I suspect PHP introduces some invisible code (just 1 byte?) or something
JD> at beginning of .WML page.


JD> Thanks for your attn.

JD> Miguel



JD> --
JD> PHP General Mailing List (http://www.php.net/)
JD> To unsubscribe, e-mail: [EMAIL PROTECTED]
JD> For additional commands, e-mail: [EMAIL PROTECTED]
JD> To contact the list administrators, e-mail: [EMAIL PROTECTED]






--
ALBASOFTWARE
C/ Mallorca 186 - 3º 1ª
08036 Barcelona (Spain)
Tel./Fax +34 934549324
[EMAIL PROTECTED]
http://www.gianlucabaldo.com
http://www.phpauction.org

--- End Message ---
--- Begin Message ---
Hi

I'm trying to pre-fill a form ( the data is passed via sessions or from
another script).

i have some check boxes on the form that i would like checked if the
variable is present.

any ideas


Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++

--- End Message ---
--- Begin Message ---


> Hi
>
> I'm trying to pre-fill a form ( the data is passed via sessions or from
> another script).
>
> i have some check boxes on the form that i would like checked if the
> variable is present.
>
> any ideas
>
    Hi Paul:

    I think that you can use JavaScript or VBScript to check the variable
and the checkbox.

    When the user click on the send Button, you can call a fuction that
evaluate all that you need. When the evaluation is OK you can send the data
to another page in parameters.

    You can use window.open in javascript.

    I don't know if i can help you with this notes.

    Bye.

                        Diego

--- End Message ---
--- Begin Message ---
You could simply execute a second query where score > $score and return the
number of rows in the result + 1.

For instance:

$return = mysql_query("select ID, Name, Score, COUNT(Name) as total from
members where ID = '$ID'");
$row = mysql_fetch_assoc($return);
extract ($row);
$return = mysql_query("select * from members where Score > '$Score'");
$rank = mysql_num_rows($return) + 1;
echo "$Name is ranked $rank of  $total";

Fred


Andrew Brampton <[EMAIL PROTECTED]> wrote in message
00c101c18029$8b2ed040$2528260a@STUDENT5830">news:00c101c18029$8b2ed040$2528260a@STUDENT5830...
Hi,
This isn't a php question, more of a SQL question, but I don't know any
where better to send it, and I guess its trival enough for someone here to
answer.

Anyway, I have a list of members each with a score field. How can I say that
Member 3 is ranked 10 out of 100 members for example.

Here is the layout of the members table:
ID, Name, Score

I can get the total count of members in the table, but I don't know how to
determine what rank they are, unless I return all the rows in the table
(sorted), and cycle through them until I find the member I want, counting
how many people are above him... This method would work, but would be slow
(and wastful), is there a better way to determine his position with a SQL
Query?

Thanks in advance
Andrew

P.S
If it matters I'm using MySQL & PHP 4.0.6 on WinXP under Apache 1.3.22



--- End Message ---
--- Begin Message ---
Hi

I'm working on a large portal-like php/html site with some large graphics.
The original design is for 1024x768 and up, but i also want it to be well
viewable under 800x600 so parts of the design have to be resized for that.

BUT, i can't seem to get that kind of information from within PHP. I found a
way around (check it with Javascript and store it as a cookie), but that's
not working fine for me.

Can someone tell me:
- how do i get the browser's screen resolution returned in a variable?
OR
- how can i read Javascript variables under PHP?

Help please.

Regards,
Roel


--- End Message ---
--- Begin Message ---
Hi folks,

I've seen messages on here in the past about "Store Locator" tools,
where someone enters a postcode and the nearest store to that postcode
is found.

I'm wondering if anyone has any information about how to get the 
proximity data for postcodes in Australia? Or is it safe to assume
that if a postcode is, say, 3107, that 3120 or 3110 (for example) 
are nearby as well as 3108 (so, perhaps, 10 above and 10 below could
be safely assumed to be "nearby"?)

I saw some mention of this a few months ago here from some of the
other Aussies on the list, but I've long since lost the archived
messages.

Could someone please help me a little with this? :)

Thanks

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"
--- End Message ---
--- Begin Message ---
I wouldn't trust a 10-above or 10-below rule, personally, unless you
weren't too concerned about the accuracy of your information.

Why don't you give Australia Post a call?

-----Original Message-----
From: Jason Murray [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 10 December 2001 10:22 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Store locator / postcode proximity

Hi folks,

I've seen messages on here in the past about "Store Locator" tools,
where someone enters a postcode and the nearest store to that postcode
is found.

I'm wondering if anyone has any information about how to get the 
proximity data for postcodes in Australia? Or is it safe to assume
that if a postcode is, say, 3107, that 3120 or 3110 (for example) 
are nearby as well as 3108 (so, perhaps, 10 above and 10 below could
be safely assumed to be "nearby"?)

I saw some mention of this a few months ago here from some of the
other Aussies on the list, but I've long since lost the archived
messages.

Could someone please help me a little with this? :)

Thanks

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

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

i have a MySql table with five columns that are filled with different
numerical values. I need some pointers to where i can learn how to build
statistics out of this data (ie the average value of a column, how many
instances there is of a certain value etc).

Regards
# Daniel Alsén    | www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   | +46 8 694 82 22  #
# PGP: http://www.mindbash.com/pgp/  #

--- End Message ---

Reply via email to