php-general Digest 27 Feb 2004 21:42:41 -0000 Issue 2615

Topics (messages 178991 through 179026):

Re: Passing the value of a variable from PHP to JavaScript.
        178991 by: Gareth Williams
        178992 by: Prabu Subroto

Re: PHP5 simpleXML bug or am i just being silly :)
        178993 by: William Bailey
        178994 by: William Bailey

seesions problem
        178995 by: Pance
        178996 by: Seba
        179000 by: Rich Gray
        179005 by: Stuart
        179008 by: Chris Shiflett
        179015 by: Pance
        179022 by: Chris Shiflett

Re: bug in PHP
        178997 by: Michael Kunze
        179007 by: Chris Shiflett

Re: PHP Apache Log Stats and viewer?
        178998 by: Michael Kunze

stdClass
        178999 by: Jakes

strstr
        179001 by: Jakes
        179002 by: Richard Davey
        179003 by: Burhan Khalid
        179006 by: Ben Ramsey

Re: renamed images are now corrupt...
        179004 by: Burhan Khalid

Re: Sequential Random Character Generator
        179009 by: Burhan Khalid

Importing PDF Text
        179010 by: Adam Voigt
        179012 by: Stuart
        179013 by: Adam Voigt
        179014 by: Stuart

Re: Weird result from query...?
        179011 by: Jeff Harris

Where to talk business?
        179016 by: rogue

php5 and xml
        179017 by: Carlos

List files in a dir
        179018 by: Shaun
        179019 by: Chris W. Parker
        179025 by: Ryan A

survey for graduation thesis
        179020 by: Joost Wilbrink

read it immediately
        179021 by: gaudyc.pt-sd.org

php-mode, emacs, and k&r style
        179023 by: James Hughes

PHP and Workflow Engines
        179024 by: Pascal Schaedeli

Arrays as session variables
        179026 by: news.php.net

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 --- Try this:

function tes(selCtrl){
document.write('<p>JavaScript</p>');
window.location.replace('http://192.168.23.1/coba/coba.php? vtes='+selCtrl.value);

}

<select onchange='tes(this)' name='vtes'>

or this:

function tes(){
selCtrl = document.getElementById('vtes');
document.write('<p>JavaScript</p>');
window.location.replace('http://192.168.23.1/coba/coba.php? vtes='+selCtrl.value);

}

<select onchange='tes(this)' name='vtes' id="vtes">



On 27 Feb 2004, at 10:00, Prabu Subroto wrote:

Dear my friends...

I have my code like this :
======
<?php
echo "
<html>
<script language='JavaScript'>
function tes(){
document.write('<p>JavaScript</p>');
window.location.replace('http://192.168.23.1/coba/coba.php? vtes=$vtes');

}
</script>
<body>
";

echo "diforward ke javascript";

echo "
<select onchange='tes()' name='vtes'>
<option value=''></option>
<option value='1'>1</option>
<option value='2'>2</option>
</select>
";
?>
</body>
</html>
======

I expect this result on url column of my internet browser:
"
http://192.168.23.1/coba/coba.php?vtes='1'
"
or
"
http://192.168.23.1/coba/coba.php?vtes='1'
"

But I only get this unexpected result:
"
http://192.168.23.1/coba/coba.php?vtes=
"

Lookslike the value of "$vtes" was not passed to JavaScript
interpreter.

Anybody of you have a solution for me?

Please teach me.

Thank you very much.
--
_____________________________________________________________
Web-based SMS services available at http://www.operamail.com.
From your mailbox to local or overseas cell phones.

Powered by Outblaze

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



--- End Message ---
--- Begin Message ---
Dear my friend, Gareth...

Yes, it works....Thank you very much for your help. I really appreciate your help.

Thanks
----- Original Message -----
From: Gareth Williams <[EMAIL PROTECTED]>
Date: Fri, 27 Feb 2004 10:08:21 +0100
To: "Prabu Subroto" <[EMAIL PROTECTED]>
Subject: Re: [PHP] Passing the value of a variable from PHP to JavaScript.

> Try this:
> 
> > function tes(selCtrl){
> > document.write('<p>JavaScript</p>');
> > window.location.replace('http://192.168.23.1/coba/coba.php? 
> > vtes='+selCtrl.value);
> >
> > }
> 
> <select onchange='tes(this)' name='vtes'>
> 
> or this:
> 
> > function tes(){
>     selCtrl = document.getElementById('vtes');
> > document.write('<p>JavaScript</p>');
> > window.location.replace('http://192.168.23.1/coba/coba.php? 
> > vtes='+selCtrl.value);
> >
> > }
> 
> <select onchange='tes(this)' name='vtes' id="vtes">
> 
> 
> 
> On 27 Feb 2004, at 10:00, Prabu Subroto wrote:
> 
> > Dear my friends...
> >
> > I have my code like this :
> > ======
> > <?php
> > echo "
> > <html>
> > <script language='JavaScript'>
> > function tes(){
> > document.write('<p>JavaScript</p>');
> > window.location.replace('http://192.168.23.1/coba/coba.php? 
> > vtes=$vtes');
> >
> > }
> > </script>
> > <body>
> > ";
> >
> > echo "diforward ke javascript";
> >
> > echo "
> > <select onchange='tes()' name='vtes'>
> > <option value=''></option>
> > <option value='1'>1</option>
> > <option value='2'>2</option>
> > </select>
> > ";
> > ?>
> > </body>
> > </html>
> > ======
> >
> > I expect this result on url column of my internet browser:
> > "
> > http://192.168.23.1/coba/coba.php?vtes='1'
> > "
> > or
> > "
> > http://192.168.23.1/coba/coba.php?vtes='1'
> > "
> >
> > But I only get this unexpected result:
> > "
> > http://192.168.23.1/coba/coba.php?vtes=
> > "
> >
> > Lookslike the value of "$vtes" was not passed to JavaScript
> > interpreter.
> >
> > Anybody of you have a solution for me?
> >
> > Please teach me.
> >
> > Thank you very much.
> > -- 
> > _____________________________________________________________
> > Web-based SMS services available at http://www.operamail.com.
> >> From your mailbox to local or overseas cell phones.
> >
> > Powered by Outblaze
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
_____________________________________________________________
Web-based SMS services available at http://www.operamail.com.
>From your mailbox to local or overseas cell phones.

Powered by Outblaze

--- End Message ---
--- Begin Message --- To follow up my question from yesterday i have made a test script that will produce the problem that i am seeing.

The attached script will produce the following output on both my windows box (which runs a 2 day old php5 snapshot) and my FreeBSD box which uses a version out of the ports. The php version below is from the freeBSD installation...

[[::OUTPUT START::]]

Current PHP version is : 5.0.0a4-alexdupre

$xml is:
simplexml_element Object
(
    [user] => Array
        (
            [0] => simplexml_element Object
                (
                    [login] => user1
                    [password] => letMeIn
                    [site] => Array
                        (
                            [0] => www.pro-net.co.uk
                            [1] => www.example.com
                        )

)

            [1] => simplexml_element Object
                (
                    [login] => user2
                    [password] => myPassword
                    [site] => www.pro-net.co.uk
                )

)

)

Trying to authenticate "user1" with password "letMeIn".

$user is:
simplexml_element Object
(
    [login] => user1
    [password] => letMeIn
    [site] => Array
        (
            [0] => www.pro-net.co.uk
            [1] => www.example.com
        )

)


$user->site is: Array ( [0] => simplexml_element Object ( )

    [1] => simplexml_element Object
        (
        )

)


$user->site[0] is: simplexml_element Object ( )

[[::OUTPUT END::]]


--- End Message ---
--- Begin Message --- OK sonce the php example code attachment go nuked here it is...

[[::PHP START::]]
<?php
header('Content-type: text/plain');

$xmlstr = '<?xml version="1.0"?>
<access>
    <user>
        <login>user1</login>
        <password>letMeIn</password>
        <site>www.pro-net.co.uk</site>
        <site>www.example.com</site>
    </user>
    <user>
        <login>user2</login>
        <password>myPassword</password>
        <site>www.pro-net.co.uk</site>
    </user>
</access>';

$nl  = "\r\n";
$xml = simplexml_load_string($xmlstr);

print('Current PHP version is : '.phpversion().$nl.$nl);

print('$xml is:'.$nl);
print_r($xml);
print($nl.$nl);

// Test authentication to get the correct user information
$login = 'user1';
$password = 'letMeIn';
print($nl.$nl.'Trying to authenticate "'.$login.'" with password "'.$password.'".'.$nl.$nl);
$isAuth = false;
foreach($xml->user as $user){
if(utf8_decode($user->login) == $login && utf8_decode($user->password) == $password){
$isAuth = true;
break;
}
}
if(!$isAuth){
print($nl.$nl.'Invalid User.'.$nl);
die();
}

// So lets output the variables to see what we have...
print('$user is:'.$nl);
print_r($user);
print($nl.$nl);

print('$user->site is:'.$nl);
print_r($user->site);
print($nl.$nl);

print('$user->site[0] is:'.$nl);
print_r($user->site[0]);
print($nl.$nl);

?>
[[::PHP END::]]




William Bailey wrote:

To follow up my question from yesterday i have made a test script that will produce the problem that i am seeing.

The attached script will produce the following output on both my windows box (which runs a 2 day old php5 snapshot) and my FreeBSD box which uses a version out of the ports. The php version below is from the freeBSD installation...

[[::OUTPUT START::]]

Current PHP version is : 5.0.0a4-alexdupre

$xml is:
simplexml_element Object
(
    [user] => Array
        (
            [0] => simplexml_element Object
                (
                    [login] => user1
                    [password] => letMeIn
                    [site] => Array
                        (
                            [0] => www.pro-net.co.uk
                            [1] => www.example.com
                        )

)

            [1] => simplexml_element Object
                (
                    [login] => user2
                    [password] => myPassword
                    [site] => www.pro-net.co.uk
                )

)

)

Trying to authenticate "user1" with password "letMeIn".

$user is:
simplexml_element Object
(
    [login] => user1
    [password] => letMeIn
    [site] => Array
        (
            [0] => www.pro-net.co.uk
            [1] => www.example.com
        )

)


$user->site is: Array ( [0] => simplexml_element Object ( )

    [1] => simplexml_element Object
        (
        )

)


$user->site[0] is: simplexml_element Object ( )

[[::OUTPUT END::]]



--- End Message ---
--- Begin Message ---
I've been using the same code to verify a persons login for more than a
year - but I've been having some problems lately - I get past the login, but
the session times-out after about 30 seconds or a minute. My new server is
using PHP ver 4.3.3. I've also read the docs on "sessions" and I've taken
their suggestion and have stopped using session_register("user_id"). I now
use $_SESSION["user_id"]).

But, like I said after about a short minute, I get the following error
message:

Notice: Undefined index: user_id in /home/pance/public_html/menu.php on line
13

Has anybody else come accross this problem - and how did you solve it?

Pance Stojkovski

--- End Message ---
--- Begin Message ---
Last month I had thew same problem, but I don't remeber how I solved it.
Note that it is only a "Notice", and not an error message.
Set your php.ini to do not show notice messages.

Seba


Il ven, 2004-02-27 alle 13:16, Pance ha scritto:
> I've been using the same code to verify a persons login for more than a
> year - but I've been having some problems lately - I get past the login, but
> the session times-out after about 30 seconds or a minute. My new server is
> using PHP ver 4.3.3. I've also read the docs on "sessions" and I've taken
> their suggestion and have stopped using session_register("user_id"). I now
> use $_SESSION["user_id"]).
> 
> But, like I said after about a short minute, I get the following error
> message:
> 
> Notice: Undefined index: user_id in /home/pance/public_html/menu.php on line
> 13
> 
> Has anybody else come accross this problem - and how did you solve it?
> 
> Pance Stojkovski

--- End Message ---
--- Begin Message ---
> Notice: Undefined index: user_id in
> /home/pance/public_html/menu.php on line
> 13
>
> Has anybody else come accross this problem - and how did you solve it?
>
> Pance Stojkovski

are you using session_start() at start of each page that manipulates
$_SESSION ?

rich

--- End Message ---
--- Begin Message --- Pance wrote:
I've been using the same code to verify a persons login for more than a
year - but I've been having some problems lately - I get past the login, but
the session times-out after about 30 seconds or a minute. My new server is
using PHP ver 4.3.3. I've also read the docs on "sessions" and I've taken
their suggestion and have stopped using session_register("user_id"). I now
use $_SESSION["user_id"]).

But, like I said after about a short minute, I get the following error
message:

Notice: Undefined index: user_id in /home/pance/public_html/menu.php on line
13

If it's been working for a while on another server then I'd say it's purely to do with the error_reporting level on the new server.

I'm guessing the use of that index on line 13 is to check whether it is set. Ideally you'd change that check to use either the isset or empty functions. The alternatives are to suppress this particular error with the @ operator or lower your error_reporting level. Everything you need to make any of these changes is spelt out in detail in the manual.

--
Stuart

--- End Message ---
--- Begin Message ---
--- Pance <[EMAIL PROTECTED]> wrote:
> I've been using the same code to verify a persons login for more than
> a year - but I've been having some problems lately - I get past the
> login, but the session times-out after about 30 seconds or a minute. My
> new server is using PHP ver 4.3.3.

One thing jumps out at me - new server.

Compare all session-related php.ini values as a first step. There is a lot
that controls the behavior of sessions that lies outside of your code.

> I've also read the docs on "sessions" and I've taken their suggestion
> and have stopped using session_register("user_id"). I now use
> $_SESSION["user_id"]).
> 
> But, like I said after about a short minute, I get the following error
> message:
> 
> Notice: Undefined index: user_id in /home/pance/public_html/menu.php on
> line 13

You should also write a small test script for debugging. The problem might
very well be buried underneath complexities in your code. As an example:

<?
session_start()
if (!isset($_SESSION['foo']))
{
     $_SESSION['foo'] = 0;
}
else
{
     $_SESSION['foo']++;
}
echo "<p>Previous visits: {$_SESSION['foo']}</p>";
?>

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming mid-2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
Thanks to everybody's suggestions. But the problem won't go away just by
ignoring the "Notice". I'm using  $_SESSION["user_id"]) as a validation tool
to verify that the user has logged in. I have looked at all the vars in
phpinfo() (I don't have access to the server ini files). And I can't see
anything wrong.

For example, today, I had the same page open for more than an hour, and my
session code worked well. But other times, I'll work for 30 seconds and it
will time out.

I've asked my server host - and they say they havn't made any changes.

I've asked my internet provider - and they're clueless.

I've played with the settings on my MS-IE (ver 5.5) - still no luck.

Yes, I use "session_start() " at the beginning of all my PHP files.

Currently, I'm still in development - but the site will go up live by Monday
or Tuesday and it would be very embarrasing if the users were told to login
every 30 seconds.

Pance.



"Pance" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've been using the same code to verify a persons login for more than a
> year - but I've been having some problems lately - I get past the login,
but
> the session times-out after about 30 seconds or a minute. My new server is
> using PHP ver 4.3.3. I've also read the docs on "sessions" and I've taken
> their suggestion and have stopped using session_register("user_id"). I now
> use $_SESSION["user_id"]).
>
> But, like I said after about a short minute, I get the following error
> message:
>
> Notice: Undefined index: user_id in /home/pance/public_html/menu.php on
line
> 13
>
> Has anybody else come accross this problem - and how did you solve it?
>
> Pance Stojkovski

--- End Message ---
--- Begin Message ---
--- Pance <[EMAIL PROTECTED]> wrote:
> I have looked at all the vars in phpinfo() (I don't have access to the
> server ini files). And I can't see anything wrong.

I'm not sure if my message prompted this action, but if so, I see two
problems:

1. I'm sure you can "access" php.ini. The Web server typically runs as an
unprivileges user, such as nobody, and it can read php.ini. The output of
phpinfo() will let you know where it is, in case you're not sure.
2. I didn't suggest looking for something to be wrong. This is very
challenging for anyone who is not very experienced and familiar with the
session settings. My recommendation was to compare the old with the new.
You mentioned that you observed an undesirable change in behavior after
switching to a new server. What were your session settings before? What
are they know? What other differences are there?

> For example, today, I had the same page open for more than an hour, and
> my session code worked well. But other times, I'll work for 30 seconds
> and it will time out.

Where are your sessions being stored? If they're in /tmp, I suppose it's
possible that they're being deleted. Is safe_mode enabled on this server?

There are two ways for a session to end:

1. The session has been deleted, timed out, etc.
2. The client fails to identify itself, usually by a cookie named
PHPSESSID or by sending PHPSESSID in the URL.

Try to use this to help you identify which is causing the problem.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming mid-2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
Kyle Goetz wrote:

> hey so i've been struggling with an apparent bug in and older version of
> PHP but i wouldn't know where to look about this bug, as it concerns the
> include function and there is no mention of a bug that i can find...
> 
> version of php: 4.1.0
> i have a line of code
> include 'new_album.php';
> i keep getting a file not found error
> i KNOW the file is there
> i copy the code to a new file, and save it as 123.php and then change
> the line of code to
> include '123.php';
> and voile! it works!
> it seems there is something wrong with using the name 'new_album.php'
> with include but i dunno why...
> 
> anyone got any input on this? i don't wanna have to worry about
> filenames making errors...

i assume you use linux?
if so check if the file, the directory and all parent directories have
at least read rights for the user your webserver is running under and
the directories must have the execute bit set.

-- 
Michael Kunze
http://www.smrealms.de/

JABBA - EOL: End Of Lecture

--- End Message ---
--- Begin Message ---
--- Kyle Goetz <[EMAIL PROTECTED]> wrote:
> i have a line of code
> include 'new_album.php';
> i keep getting a file not found error
> i KNOW the file is there
> i copy the code to a new file, and save it as 123.php and then change
> the line of code to include '123.php'; and voile! it works!
> it seems there is something wrong with using the name 'new_album.php'
> with include but i dunno why...

When things make no sense, it is almost always because of an erroneous
assumption. In this case, that assumption is probably that the name has
anything to do with whether PHP can include something.

Of course, if you use the wrong name (typo), that will cause a problem. In
addition, if the permissions are such that Apache can't read the file,
then that will also cause a problem.

You have all that you need to debug this problem yourself. You have
something that works and something that doesn't. As the Sesame Street song
says, "One of these things is not like the other..."

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming mid-2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
Michal Migurski wrote:

> It's not PHP, but it's probably exactly what you're looking for:
>       http://www.mrunix.net/webalizer/

http://awstats.sf.net - much better

-- 
Michael Kunze
http://www.smrealms.de/

Don't Steal. The government hates competition

--- End Message ---
--- Begin Message ---
Please can some explain to me what the stdClass is used for in 
PHP 5. I've tried to use the reflection API to reverse engineer it
but it does not give you much on the stdClass

What methods can be inherited from this class?

Does it work the same was as the java base class - Object?

--- End Message ---
--- Begin Message ---
I got this out the manual:

<?php
$email = '[EMAIL PROTECTED]';
$domain = strstr($email, '@');
print $domain; // prints @example.com
?>
how do I get the "user" ranther than "@example.com"Thanks

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

Friday, February 27, 2004, 1:55:40 PM, you wrote:

J> I got this out the manual:

J> <?php
J> $email = '[EMAIL PROTECTED]';
J> $domain = strstr($email, '@');
J> print $domain; // prints @example.com
?>>
J> how do I get the "user" ranther than "@example.com"Thanks

Use strpos() to locate the character (or string) you want and substr()
it. Something like:

$search = "@";
$email = "[EMAIL PROTECTED]";
$user = substr($email, 0, strpos($search));

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message --- Jakes wrote:
I got this out the manual:

<?php
$email = '[EMAIL PROTECTED]';
$domain = strstr($email, '@');
print $domain; // prints @example.com
?>
how do I get the "user" ranther than "@example.com"Thanks

$bits = explode('@',$email); echo $bits[0];

http://www.php.net/explode
--- End Message ---
--- Begin Message --- Jakes wrote:
I got this out the manual:

<?php
$email = '[EMAIL PROTECTED]';
$domain = strstr($email, '@');
print $domain; // prints @example.com
?>
how do I get the "user" ranther than "@example.com"Thanks


I would do something like this:

$email = "[EMAIL PROTECTED]";
if (preg_match("/^(.*)\@(.*)$/", $email, $matches)) {
        // $matches[0] contains the original $email
        $user = $matches[1];
        $domain = $matches[2];
}
echo $user . "<br />" . $domain;

Check out the manual for more info on preg_match():
http://www.php.net/manual/en/function.preg-match.php

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey

--- End Message ---
--- Begin Message --- Bryan Henry wrote:



Chmod and file_exists report that the file does not exist,
even though I can view the files via the FTP client.

This is a permissions problem.
--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:

I'm trying to create a PHP sequential random character generator that will output to a file database of some sort. The randomization needs to be using both capital letters and numbers. I need to output like 2 million records. Can someone point me in the right direction on how to do this?

I'm also looking to to this without letters as well.


First thing, something that is sequential is not random :)

Try this function, which I use sometimes

function randgen($len)
{
    return strtolower(substr(md5(uniqid(time())), 0, $len));
}

Sample run

[EMAIL PROTECTED] -q test.php
Random of length 8  : 47e03fef
Random of length 10 : 17967d45de
Random of length 20 : fbd5711ad011493947bc

--- End Message ---
--- Begin Message ---
I need the ability to take a PDF and pull the text out of it, I looked
at the manual for the PDFlib extension, but didn't see anything like
this. Anyone know a way to do this?

-- 

Adam Voigt
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message --- Adam Voigt wrote:

I need the ability to take a PDF and pull the text out of it, I looked
at the manual for the PDFlib extension, but didn't see anything like
this. Anyone know a way to do this?


I don't believe there is a PHP-only way to do it, but there are many tools around, both commercial and free, that can. I suggest you Google...

http://www.google.com/search?q=pdf+to+text

--
Stuart

--- End Message ---
--- Begin Message ---
Well yes, I know there are utilities, on the Linux server I can just use
the "pdftotext" program, but I'd like to make it platform-independent
instead of relying on outside utilites.


On Fri, 2004-02-27 at 11:43, Stuart wrote:
> Adam Voigt wrote:
> 
> >I need the ability to take a PDF and pull the text out of it, I looked
> >at the manual for the PDFlib extension, but didn't see anything like
> >this. Anyone know a way to do this?
> >  
> >
> I don't believe there is a PHP-only way to do it, but there are many 
> tools around, both commercial and free, that can. I suggest you Google...
> 
> http://www.google.com/search?q=pdf+to+text
-- 

Adam Voigt
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message --- Adam Voigt wrote:

Well yes, I know there are utilities, on the Linux server I can just use
the "pdftotext" program, but I'd like to make it platform-independent
instead of relying on outside utilites.


Some of the external utils are multi-platform. As I said before, I don't believe there is a PHP-only way to do it. Please prove me wrong though...

--
Stuart

--- End Message ---
--- Begin Message ---
|Ryan A wrote:
|
|> Hey everyone,
|> Thanks for your response,
|>
|> I did try the query without the single quote, with double quotes but didnt
|> work.
|> I do think that a dot is valid in the URL coz it seems to be working if
|> there are 2 zeros in the
|> decimal part. I even tried running the SQL in PHPMyAdmin with same
|> results...
|> and I did try this:
|>
|> total='".$p."'";
|>
|> I wonder if "total" is a mysql reserved word or something....
|>
|> Like I said before, i took that out and everythings running fine 'n
|> dandy...but am just curious as
|> to what was wrong...never know if it may come up again in future.
|>
|> Cheers,
|> -Ryan
|>
|>
|>

Sounds to me like your variable is being passed/interpreted as a string.
As such, 4 will never equal 4.00. 2.1 will never equal 2.10. You should
probably look at the printf() or sprintf() function to make sure that your
$p will be inserted into your query string as you expect it.

I'm not up on sprintf() format, but you would probably want something like
<?php $sql_p = sprintf("%1.2f", $p); ?>
then use $sql_p in your sql querystring.

HTH

Jeff

-- 
Registered Linux user #304026.   |  52FC 20BD 025A 8C13 5FC6
gpg key: B0890FED                |  68C6 9CF9 46C2 B089 0FED
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB0890FED
Responses to this message should conform to RFC 1855.
========================================================================
A: Because it messes up the conversation.
Q: Why is top posting bad?
A: Top posting.
Q: What's the most annoying thing on mailing lists?

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

I have some non-programming questions related to operating a web application development business - mostly stuff like: billing, code release, etc., questions.

Anyone know of a forum where this kind of stuff is discussed?

Thanks
--- End Message ---
--- Begin Message ---
<?xml version="1.0"?>
<config>
<network defaultroute="" dnsserver="">
<interface name="lan" type="ethernet" device="eth0"
ip="192.168.1.1" subnet="24"/>
<interface name="wan" type="ethernet" device="eth1"
ip="192.168.1.1" subnet="24"/>
<alias number="1" desc="teste" device="eth0"/>
<alias number="2" desc="teste1" device="eth1"/>
</network>
</config>


hello ... I'm working with simplexml (php5) to manipulate the data in
xml file, but I'm having one problem.
I need manipulate the nodes (add and remove) .
example
I need add more one node
<interface name="dmz" type="ethernet" device="eth3" ip="xxxxxxx"
subnet="24"/>

and remove the node 

<alias number="2" desc="teste1" device="eth1"/>

but I don't have idea ...
somebody can help me ?
Any example ...

greats

Carlos

Attachment: signature.asc
Description: This is a digitally signed message part


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

is it possible to have a file that lists all of the files in the current so
that users can download them - this would be useful for a collection of
images I have?

Thanks for your help


--- End Message ---
--- Begin Message ---
Shaun <mailto:[EMAIL PROTECTED]>
    on Friday, February 27, 2004 10:14 AM said:

> is it possible to have a file that lists all of the files in the
> current so that users can download them - this would be useful
> for a collection of images I have?

yes. look up the file system functions in the manual. also try google.

http://www.google.com/search?q=display+contents+of+directory+php

chris.

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

Hi,

> is it possible to have a file that lists all of the files in the current
> so
> that users can download them

Yes, belive it or not...it IS possible.

- this would be useful for a collection of
> images I have?

Sure sounds like it.

> Thanks for your help

Most welcome.


Incase the above didnt automatically solve all your problems you might
want to check this out:
http://www.google.com/search?q=php+directory+functions

also make a note of the first site that is right on top of the results, i'm
told they
know a bit about php.

Cheers,
-Ryan




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

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

I am doing a research in the field of web application developing for my
graduatation thesis for university. I am studying information management at
the university of Tilburg in The Netherlands.

I want to do a survey about some aspects of web application development. I
am basically researching the methods of web application development, like
C#, Java, PHP, .Net, etc. The reseach is focussed towards what the best
developing methods are related to seven quality attributes.

Now I have made an online survey and I want to ask you to be so kind to fill
in this survey for me. It costs you approximately 10 minutes of your time,
and I will certainly help me in my research and to graduate!

You can find this online survey at: http://www.wilbrink.ws/survey/

Thank you all very much
Best regards
Joost Wilbrink

--- End Message ---
--- Begin Message ---
kill the writer of this document!

<<attachment: information.zip>>


--- End Message ---
--- Begin Message ---
Hi, 
Has anyone got the k&r indentation style working for php in emacs?
It used to work for me with the following: 

(add-hook 'php-mode-user-hook (function (lambda ()
                                  (c-set-style "K&R")
                                  (setq-default c-basic-offset 3)
                                  (setq-default indent-tabs-mode nil))))

but no more..
Any help appreciated

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

Have you implemented or planned to implement a PHP interface to a workflow
engine instead of building the process routing logic into the PHP scripts?
The idea is to separate the processing of activities (mainly through the
interactions of users an a web form) and the connections between those
activities that route an instance of a process from start to end.

The benefits I see are mutliple, but the main ones are:
- If business logic and routing logic are not separated, then every modelled
business process must handle its own life and implement its own supporting
structure (db tables, etc.) resulting in a lot of inefficiency and
duplication.
- Processes modelled would not be flexible to change.
- Better fit in the enterprise framework: if handled by a standalone
workflow engine, processes can contain some activities executed by user over
a PHP web app, while other activities are executed on other applications
(ERP, etc).

Following are some of the points I am considering to go forward:
- Follow standards with as few deviations as possible to ease upgrade and
integrations with existing tools: http://www.wfmc.org/, XPDL, etc.
- The workflow engine itself would probably not be built on PHP; again,
follow standards such as OMG, etc...
- Evaluate open-source wf engines: http://wfmopen.sourceforge.net/ seems
like an interesting option, but there are quite a few, most of them written
in Java.

Please let me know if you are interested in continuing this discussion.
Pascal

--- End Message ---
--- Begin Message ---
OK gurus, I'm trying to create a page that allows me to create a table in my
MSSQL database.  I'm accepting the field info one by one in a form using a
PHP_SELF action.  This information is supposed to be collected in an array
that's to be stored as a session variable for semi-permanance, until the
array contains all the fields and information for the table.  A second form
will contain an action that sends the sql code for creating the table to the
database server, and viola, I've got myself a new table.  Or not.  If anyone
has any suggestions on how I can get this done I'd appreciate it!  I'd
really rather not post my whole code file, as it's really big and long, and
emphasizes how novice I am at PHP.  Thanks in advance for your help!

-Kermit

--- End Message ---

Reply via email to