[PHP] web based admin - was: Re: [PHP] Restart Apache with PHP???

2003-09-05 Thread Raditha Dissanayake
You are right anil,

I think we should collectively discourage people from attempting this 
sort of this. I am no fan of webmin, cpanel or any of the other 
vhost/admin stuff but at least they are likely to be more secure than 
what can be scratched together in a hurry.

Anil Kumar K. wrote:

Writing something like this as part of a Web application is definitely a 
bad idea.

The requirement is more like that of a remote administration system and
Webmin (http://www.webmin.com/) cleanly and safely fits the bill. 
Webmin can actually do more than just restarting Apache. But it 
can be configured to do only that. 

best regards.
  Anil
On Wed, 3 Sep 2003, Jason Sheets wrote:

 

More safely maybe, but even that solution could be exploited somewhat 
easily.  The script that writes the file would be better off as a CGI 
than executed through the Apache module, this would allow you to 
restrict write access to the directory where the file that triggers the 
restart is stored to the owner of the script, you could then further 
restrict access to this script through .htccess or other means.  If you 
make a file trigger a cronned job to restart the server if you are using 
mod_php the directory must be writable to the user the web server runs 
as which means that anyone who can execute php code through the 
webserver can trigger a server restart by writing the file, you could 
even cron it to write the file every  minute effectively shutting the 
server down (whether it be web or the actual system itself).

Doing something like this takes a lot of thought, it can be made 
difficult to exploit but you need to do more than just make a cron 
pickup a file, excellent starting place though.

Jason



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] session.save_path is a big security hole!

2003-09-05 Thread Raditha Dissanayake

   

Unfortunetly setting quotes (eg for apache user)doesnt prevent from flooding
out entire disk. For example i can have running a script that will check
user directories every 15 minutes and if some directory will contain large
amount of apache generated files, user account will be disabled and files
will be removed. But what to do if for example i have 500 users and every
user directory is flooded out with bogus files? Actually i can imaging some
sort of terrorising the server this that kind of attack :)
 

AFAIK it's possible to set a limit on the number of inodes as well as 
space. So that prevents a gazillion 1byte files from killing the server.


 

 

--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
   

 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PEAR

2003-09-05 Thread Catalin Trifu
Hi,

Let's say you have PEAR installed in
/usr/local/php/lib/php
To use PEAR related classes, you should add
/usr/local/php/lib/php to your include_path; then restart the server ;)
or you can use ini_set() on top of your scripts.

Cheers,
Catalin

"Richard Baskett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Ok I have loaded the new version of php 4.3.3, but now how in the world do I
enable PEAR? I have a couple of scripts that just call a pear php script,
but it says it doesn¹t exist.. does this mean that I need to change the
include path?  How do I include all those pear classes?

Thanks!

Rick

"Too much caution is bad for you. By avoiding things you fear, you may let
yourself in for unhappy consequences. It is usually wiser to stand up to a
scary-seeming experience and walk right into it, risking the bruises as hard
knocks. You are likely to find it is not as tough as you had thought.  Or
you may find it plenty tough, but also discover you have what it takes to
handle it." - Norman Vincent Peale

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



Re: [PHP] Persistent database connections in PHP

2003-09-05 Thread Mika Tuupola
On Fri, 5 Sep 2003, Shivanischal wrote:

> I wanted help on how to achieve persistent database connections in PHP. The
> database i use is MySQL. I would be grateful if u could also guide me to
> resources that tell me how to do it.

http://www.php.net/manual/en/function.mysql-pconnect.php

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/

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



[PHP] using fwrite to create PHP files

2003-09-05 Thread Vince LaMonica
Hi all,

I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:

$new_id = mysql_insert_id();
// create brand new file
$new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
$new_file_content = "\n"
." http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id&preview=y\");
 \n"
." } else { \n"
." readfile(\"http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id\"); \n"
." } \n"
." ?>";

write($new_file, $new_file_content);
fclose($new_file);

Note that $sitename is defined earlier in the script.

I know that $new_id and $sitename get expanded, as I tried this:

$new_file_content = "hello world. Look at my ${'sitename'}.display and my $new_id";

and the new file was created with the above text and the two vars
expanded. My problem lies in the fact that I need to put "  116 Social Ecology I, Irvine, CA 92697
 [EMAIL PROTECTED]  http://www.seweb.uci.edu/techsupport

 Tower: "Delta Zulu Romeo, turn right now and report your heading."
 Pilot: "Wilco. 341, 342, 343, 344, 345..."

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



RE: [PHP] mysql Pattern Matching

2003-09-05 Thread Ralph Guzman
Is there an advantage or difference in running FIND_IN_SET() instead of
LIKE?

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 04, 2003 5:53 AM
To: Ralph Guzman; PHP General Mailing List
Subject: Re: [PHP] mysql Pattern Matching

From: "Ralph Guzman" <[EMAIL PROTECTED]>


> I know this question is best for the mySQL mailing list, but I am
unable
> to subscribe to their list at this moment so perhaps somebody here can
> help me out.
>
> I have a table with a field where amenities are listed together using
a
> comma delimiter like: pool,spa,fitness-center
>
> To search this table I use a query that looks something like this:
>
> SELECT * FROM properties WHERE amenities LIKE '%pool%' AND amenities
> LIKE '%spa%' AND amenities LIKE '%fitness-center%'
>
> This works, however let's say the user chooses to search for more
> amenities. This means the query would need multiple 'AND amenities
LIKE
> '%%' statements.
>
> Is there a better way to write this?

You could use FIND_IN_SET().

SELECT * FROM properties WHERE FIND_IN_SET('pool',amenities) AND
FIND_IN_SET('spa',amenities) AND ...

It'll still grow as the number of amentities grow, but there's no
getting
around that.

---John Holmes...

-- 
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



[PHP] Email to database

2003-09-05 Thread Enda Nagle
Hi

I am using a PHP / MySQL combination to send an email to all users in a
table.

When I run the script, say address1 in the resultset is [EMAIL PROTECTED],
address2 is [EMAIL PROTECTED] & address3 is [EMAIL PROTECTED] ­ When I run
the script, mail is sent to address1,address2 & address3. Problem is I get
copies of all mails sent to the first address pulled from the table.

Any help appreciated.

Thanks

Enda
--

=
PHP Code
=
$result1=mysql_query("select DISTINCT first_name,last_name,email_address
from  WHERE 1 ORDER BY id",$link);

//-

while($row = mysql_fetch_array($result1))
  {
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Website \r\n";
$headers .= "To: $row[email_address]\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: MyWebsite";
$subject = "$subject";
$message = "aa";

   mail($to, $subject, $message, $headers)
or print "Could not send mail to customer";

print "mail sent to
$row[email_address]";
}


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




[PHP] URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread David T-G
Hi, all --

I thought I knew the trick for this, but I don't, and I have about an
hour to figure it out.

We're going to be taking down our web server for some unavoidable
maintenance and we want to put up a polite "we're not here" page rather
than just look like we went out of business.  We're going to bring up
httpd but leave all databases etcetc turned off.

How can i make a script, perhaps with an htaccess trick file, which will
take

  example.com/
  example.com/login.php
  example.com/index.php?some¶ms&etc

and always be found?  The trick I knew depended on looking in a
subdirectory so that I could fake the name, but this has to work from the
root.


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] suggestion: recursive calls

2003-09-05 Thread Ronald van Raaphorst
Yep, but then I expect a timeout error because my script is running more
than say 20 seconds...

Ronald

"Marco Schuler" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> Hi
>
> Am Don, 2003-09-04 um 12.40 schrieb Ronald van Raaphorst:
> > I normally program in clarion (www.softvelocity.com) and an infinite
> > recursive call will cause a heap overflow...
> >
> > As I only got a "This page cannot be displayed" page, an error must have
> > occurred, but it's not displayed...
>
> A computer cannot decide when a recursion is to deep. Imagine traversing
> a realy big tree. There a recursion can get realy deep.
>
> I don't know about the internals of php. But as it is an interpreter
> language, I would say that all variables or even the parsing tree are
> located on the heap. So this heap will probably be quite big! Thus, to
> produce a heap overflow will take a rather long time. (Correct me if I
> am wrong with my tought)
>
> A workaround could be that you have a counter (static variable!) in your
> recursion procedure or methode respectively. You increment this counter
> on every entry into the procedure and compare it to a limit that _you_
> specifiy.
>
> --
> Cheers!
>  Marco
>
>
> > At first I thought I had lost contact with the site, but then, after a
lot
> > of tracing, I found the source of the error.
> >
> > Ronald
> >
> >
> >
> > "Marek Kilimajer" <[EMAIL PROTECTED]> schreef in bericht
> > news:[EMAIL PROTECTED]
> > > I don't think it is even possible, if the recursive calls don't seem
> > > infinite to inteligent human being, how should a stupid computer
program
> > > find out.
> > >
> > > Ronald van Raaphorst wrote:
> > >
> > > > Hi all,
> > > >
> > > > Not a real bug, but a suggestion:
> > > > It would be nice if inifite recursive calls would somehow give an
error.
> > > > I spend quite some time to find the error in my php script.
> > > >
> > > > Ronald
> > > >
> >
> > -- 
> > 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



Re: [PHP] suggestion: recursive calls

2003-09-05 Thread Ronald van Raaphorst
yeah, but my unix server is located at my providers place, and I can't get a
core dump.

Ronald

"Robert Cummings" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> I've accidentally had infinite recursion at times. Under Linux if
> configured, you can get a core dump which can be loaded in GDB to see
> the stack. I usually know Its infinite recursion when GDB shows a
> backtrack in the 10s of thousands.
>
> Cheers,
> Rob.
>
>
> On Thu, 2003-09-04 at 06:04, Ronald van Raaphorst wrote:
> > Hi all,
> >
> > Not a real bug, but a suggestion:
> > It would be nice if inifite recursive calls would somehow give an error.
> > I spend quite some time to find the error in my php script.
> >
> > Ronald
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> -- 
> .-.
> | Worlds of Carnage - http://www.wocmud.org   |
> :-:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.|
> `-'

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



[PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread Bogdan Stancescu
Typing "Apache custom 404" and clicking on "I feel lucky" would get you 
to this information:

Apache

Add the following directive to your httpd.conf file (this file should be 
edited by someone knowledgeable about configuring an Apache Web server) 
or to an .htaccess file in your root (top-level) Web document directory: 
ErrorDocument 404 /404.html.

ErrorDocument is a directive that tells Apache that you are specifying a 
custom error handler, and 404 tells Apache which error you are 
customizing. Finally, /404.html specifies the location of the Web page 
to be used as the custom 404 message--in this case a file named 404.html 
located in the top-level document directory for this site.

Good luck! :)

Bogdan

David T-G wrote:

Hi, all --

I thought I knew the trick for this, but I don't, and I have about an
hour to figure it out.
We're going to be taking down our web server for some unavoidable
maintenance and we want to put up a polite "we're not here" page rather
than just look like we went out of business.  We're going to bring up
httpd but leave all databases etcetc turned off.
How can i make a script, perhaps with an htaccess trick file, which will
take
  example.com/
  example.com/login.php
  example.com/index.php?some¶ms&etc
and always be found?  The trick I knew depended on looking in a
subdirectory so that I could fake the name, but this has to work from the
root.
TIA & HAND

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


[PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread Bogdan Stancescu
Errr... that is, in Google. ;)

Bogdan

Bogdan Stancescu wrote:

Typing "Apache custom 404" and clicking on "I feel lucky" would get you 
to this information:

Apache

Add the following directive to your httpd.conf file (this file should be 
edited by someone knowledgeable about configuring an Apache Web server) 
or to an .htaccess file in your root (top-level) Web document directory: 
ErrorDocument 404 /404.html.

ErrorDocument is a directive that tells Apache that you are specifying a 
custom error handler, and 404 tells Apache which error you are 
customizing. Finally, /404.html specifies the location of the Web page 
to be used as the custom 404 message--in this case a file named 404.html 
located in the top-level document directory for this site.

Good luck! :)

Bogdan

David T-G wrote:

Hi, all --

I thought I knew the trick for this, but I don't, and I have about an
hour to figure it out.
We're going to be taking down our web server for some unavoidable
maintenance and we want to put up a polite "we're not here" page rather
than just look like we went out of business.  We're going to bring up
httpd but leave all databases etcetc turned off.
How can i make a script, perhaps with an htaccess trick file, which will
take
  example.com/
  example.com/login.php
  example.com/index.php?some¶ms&etc
and always be found?  The trick I knew depended on looking in a
subdirectory so that I could fake the name, but this has to work from the
root.
TIA & HAND

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


RE: [PHP] Display after a certain date

2003-09-05 Thread Jay Blanchard
[snip]
Anyone have a quick fix for a part of an html page that I do not want to
display until after October 1st, and not after October 31st ?
[/snip]

You must have missed the conditionals part of the manual

= $display_start) && (date("Y-m-d") <=
$display_end)){
print($stuff);
}
?>

Now, if you are getting the stuff out of the database you can select
according to date if you have start and end dates as columns (as would
be in most CMS databases);

SELECT paragraph 
FROM tblArticles
WHERE CURRENT_DATE() BETWEEN '2003-10-01' AND '2003-10-31'

HTH and Have a pleasant day.

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



[PHP] Re: using fwrite to create PHP files

2003-09-05 Thread Bogdan Stancescu
To answer your question, you probably can do 
$new_file_content="<"."?"."php\n" . [...] . "?".">";

But why in the world do you need this complication?

Bogdan

Vince Lamonica wrote:

Hi all,

I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:
$new_id = mysql_insert_id();
// create brand new file
$new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
$new_file_content = "\n"
." http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id&preview=y\"); 
\n"
." } else { \n"
." readfile(\"http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id\"); \n"
." } \n"
." ?>";
write($new_file, $new_file_content);
fclose($new_file);
Note that $sitename is defined earlier in the script.

I know that $new_id and $sitename get expanded, as I tried this:

$new_file_content = "hello world. Look at my ${'sitename'}.display and my $new_id";

and the new file was created with the above text and the two vars
expanded. My problem lies in the fact that I need to put "
I'm running 4.3.3 under apache 1.3.28.

Any help would be most appreciated!

/vjl/

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


[PHP] Re: Header()

2003-09-05 Thread Bogdan Stancescu
I don't think you can using headers. Why not Javascript?

Bogdan

Mixmastr wrote:

How can i do so header opens a new page in a new browser, instead of opening
the page inside the current browser?
-kjetil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Header()

2003-09-05 Thread Jay Blanchard
[snip]
How can i do so header opens a new page in a new browser, instead of
opening
the page inside the current browser?
[/snip]

header does not do this, but you can do it with a target="_blank" attrib
in your href tag or with JavaScript.

Have a pleasant and productive day.

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



Re: [PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread David T-G
Bogdan --

...and then Bogdan Stancescu said...
% 
% Typing "Apache custom 404" and clicking on "I feel lucky" would get you 
% to this information:

Ah!  That's a good point; just make everything on the site a 404.  It
means I'll have to muck about in my httpd.conf instead of just in the doc
root dir, but that's still pretty straightforward.


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] using fwrite to create PHP files

2003-09-05 Thread Jay Blanchard
[snip]
I wish to use fwrite() to create a small PHP file. So far, when I
attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:
[/snip]

Vince I did this

\n");

fclose($newphp);
?>

And it worked fine. fputs() places the string in the file properly. I
also noticed at the end of your script

write($new_file, $new_file_content);

Since I saw no write() function in your script I would have to assume
that you are calling an undefined function, which is probably where your
errors are coming from. Try changing the line to

fputs($new_file, $new_file_content);

And you should have much luck. Have a pleasant, productive and
meaningful day.

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



RE: [PHP] Email to database

2003-09-05 Thread Jay Blanchard
[snip]
while($row = mysql_fetch_array($result1))
  {
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Website \r\n";
$headers .= "To: $row[email_address]\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: MyWebsite";
$subject = "$subject";
$message = "aa";

   mail($to, $subject, $message, $headers)
or print "Could not send mail to customer";

print "mail sent to
$row[email_address]";
}
[/snip]

At first glance  $to is undefined. When testing set
error_reporting(E_ALL); to catch these kinds of things. Is it possible
that you define $to as your e-mail address somewhere else and each time
the thing loops it sends you a copy?


Have a pleasant, productive and prosperous day.

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



Re: [PHP] Email to database

2003-09-05 Thread Marek Kilimajer


Enda Nagle wrote:


   mail($to, $subject, $message, $headers)
or print "Could not send mail to customer";

print "mail sent to
$row[email_address]";
Email was sent to $to, and not to $row[email_address]

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


[PHP] How can I get IP of ppp0?

2003-09-05 Thread Erick Okasaki
Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
's the function?

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


Re: [PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread David Robley
In article <[EMAIL PROTECTED]>, davidtg-
[EMAIL PROTECTED] says...
> Bogdan --
> 
> ...and then Bogdan Stancescu said...
> % 
> % Typing "Apache custom 404" and clicking on "I feel lucky" would get you 
> % to this information:
> 
> Ah!  That's a good point; just make everything on the site a 404.  It
> means I'll have to muck about in my httpd.conf instead of just in the doc
> root dir, but that's still pretty straightforward.

Well, no - I am sure you can do it with an entry in .htaccess in the 
server root.


-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



RE: [PHP] How can I get IP of ppp0?

2003-09-05 Thread Jay Blanchard
[snip]
How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
's the function?
[/snip]

shootin' from the hip  because I am looking for something like this
as well. I would also like to be able to activate PPP...need some serial
port control. Here are my thoughts on your question...from the hip and
very much untested...

Load ifconfig into a variable something like

$strIfconfig = exec("ifconfig");

Then use regex to parse $strIfconfig for the info you need.

Let me know what happens.

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



RE: [PHP] How can I get IP of ppp0?

2003-09-05 Thread Javier Tacon


function getRemoteIP() {
 if(getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
 else if(getenv("HTTP_X_FORWARDED_FOR)) $ip = getenv("HTTP_X_FORWARDED_FOR");
 else return getenv("REMOTE_ADDR");
 return $ip;
}


-Mensaje original-
De: Erick Okasaki [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 05 de septiembre de 2003 14:47
Para: [EMAIL PROTECTED]
Asunto: [PHP] How can I get IP of ppp0?


Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
's the function?


thanks
Erick

-- 
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



Re: [PHP] How can I get IP of ppp0?

2003-09-05 Thread MuToGeN
Hello Erick,

   ipconfig

EO> Hello List,

EO> How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
EO> 's the function?


EO> thanks
EO> Erick



-- 
Best regards,
 MuToGeNmailto:[EMAIL PROTECTED]

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



Re: [PHP] How can I get IP of ppp0?

2003-09-05 Thread Raditha Dissanayake
Hardly what you call a php question.
just type
ifconfig -a
Erick Okasaki wrote:

Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? 
What 's the function?

thanks
Erick


--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How can I get IP of ppp0?

2003-09-05 Thread Maciek Ruckgaber Bielecki
I would use  something like this

$ifconfMess = shell_exec("ifconfig tun0");
if(preg_match("/\d{2,3}(\.(\d){1,3}){3}/",$ifconfMess,$ip))
  $tunip = $ip[0];

see ya !
  

On Fri, Sep 05, 2003 at 09:46:41AM -0300, Erick Okasaki wrote:
> Hello List,
> 
> How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
> 's the function?
> 
> 
> thanks
> Erick
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 

Maciek Ruckgaber Bielecki



"An empty stomach is not a good political advisor." 
--Albert Einstein--

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



Re: [PHP] How can I get IP of ppp0?

2003-09-05 Thread Curt Zirzow
* Thus wrote Erick Okasaki ([EMAIL PROTECTED]):
> Hello List,
> 
> How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
> 's the function?
> 

This might work.

$ip = `ifconfig ppp0 | grep netmask | cut -f 2 -d ' ' | tail -1`;


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[Fwd: Re: [PHP] How can I get IP of ppp0?]

2003-09-05 Thread Erick Okasaki
 Sorry  if I was not clear enough but it's a php question because I 
want get IP Address from connection ppp0 (in Linux) with some function 
in PHP!

thanks
Erick
 Original Message

Hardly what you call a php question.
just type
ifconfig -a
Erick Okasaki wrote:

Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? 
What 's the function?

thanks
Erick


--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Email to database

2003-09-05 Thread Enda Nagle
I¹ve defined $to earlier on ­ only thing is it still doesn¹t work correctly
with the mail() function inside the while loop.
The reason I wanted it in here was I¹m using the person¹s first name in the
body of the mail.

Should I just populate an array with the details of the users (first_name,
email_address) in the while loop, and then use this to send the mail? This
would just produce the same result though?

Is there something like MoveNext I should use for the mail function?
If I put the $headers in the while loop it just keeps adding to the $headers
instead of sending each mail separately as I want it to.

Thanks for the help

Enda
--




 9/5/03 1:15 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> while($row = mysql_fetch_array($result1))
>   {
> $headers .= "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers .= "From: Website \r\n";
> $headers .= "To: $row[email_address]\r\n";
> $headers .= "X-Priority: 1\r\n";
> $headers .= "X-MSMail-Priority: Normal\r\n";
> $headers .= "X-Mailer: MyWebsite";
> $subject = "$subject";
> $message = "aaa bgcolor=ff>aaa";
> 
>mail($to, $subject, $message, $headers)
> or print "Could not send mail to customer";
> 
> print "mail sent to
> $row[email_address]";
> }
> [/snip]
> 
> At first glance  $to is undefined. When testing set
> error_reporting(E_ALL); to catch these kinds of things. Is it possible
> that you define $to as your e-mail address somewhere else and each time
> the thing loops it sends you a copy?
> 
> 
> Have a pleasant, productive and prosperous day.


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




RE: [PHP] Email to database

2003-09-05 Thread Jay Blanchard
[snip]
Is there something like MoveNext I should use for the mail function?
If I put the $headers in the while loop it just keeps adding to the
$headers
instead of sending each mail separately as I want it to.

..
> while($row = mysql_fetch_array($result1))
>   {
> $headers .= "MIME-Version: 1.0\r\n";

[/snip]

I just noticed thischange the first header varaible line to

$headers = "MIME-Version: 1.0\r\n";

You are concatting the headers each time instead of resetting them

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



Re: [Fwd: Re: [PHP] How can I get IP of ppp0?]

2003-09-05 Thread Raditha Dissanayake
And i am sorry for being trigger happy.

Erick Okasaki wrote:

 Sorry  if I was not clear enough but it's a php question because I 
want get IP Address from connection ppp0 (in Linux) with some function 
in PHP!

thanks
Erick
 Original Message

Hardly what you call a php question.
just type
ifconfig -a
Erick Okasaki wrote:

Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? 
What 's the function?

thanks
Erick




--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Email to database

2003-09-05 Thread Enda Nagle
Jay,

The $to variable is [EMAIL PROTECTED]
Then the emails are pulled from the database in the following order:
email1, email2, email3

The result is:
[EMAIL PROTECTED] ­ gets a copy of each message (fine since its the
$to address for each mail)
email1 ­ gets a copy of each message
email2 ­ gets his message and  the one for email3
email3 ­ gets his own message

Any ideas?

Enda
--



 On 9/5/03 2:29 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> Is there something like MoveNext I should use for the mail function?
> If I put the $headers in the while loop it just keeps adding to the
> $headers
> instead of sending each mail separately as I want it to.
> 
> ..
>> > while($row = mysql_fetch_array($result1))
>> >   {
>> > $headers .= "MIME-Version: 1.0\r\n";
> 
> [/snip]
> 
> I just noticed thischange the first header varaible line to
> 
> $headers = "MIME-Version: 1.0\r\n";
> 
> You are concatting the headers each time instead of resetting them


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




RE: [PHP] Email to database

2003-09-05 Thread Jay Blanchard
[snip]
email1 - gets a copy of each message
email2 - gets his message and  the one for email3
email3 - gets his own message
[/snip]

Did you change that header line as recommended?

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



Re: [PHP] Email to database

2003-09-05 Thread Enda Nagle
Its working ok now ­ I changed the error in the headers, but I had added in
another BCC item which was causing the repeated emails.

Working great now Jay ­ thanks a mil for your help!

Regards

Enda
--


On 9/5/03 2:59 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> email1 - gets a copy of each message
> email2 - gets his message and  the one for email3
> email3 - gets his own message
> [/snip]
> 
> Did you change that header line as recommended?


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




[PHP] POST security

2003-09-05 Thread bob pilly
Hi all, i know this isnt strictly a php question but
thought you would be a good group to ask because of
your experience. 

Is there any security issues with passing data via the
POST method from a webserver to a different webserver
running ssl. For example:

webserver1




and then just using  on
webserver 2 to retrieve the data?

Thanks for any help in advance.




Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

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



Re: [PHP] POST security

2003-09-05 Thread Chris Shiflett
--- bob pilly <[EMAIL PROTECTED]> wrote:
> Is there any security issues with passing data via the
> POST method from a webserver to a different webserver
> running ssl.

There are always security concerns, regardless of your approach. Nothing is
perfect. However, sending data over an SSL connection offers a very high level
of security.

> For example:
> 
> webserver1
> 
>  action='https://webserver2/login.php'>
> 
> 
> and then just using  on
> webserver 2 to retrieve the data?

I'm not sure if it is relevant to your task, but you might like to know that
the client, not the Web server, is who sends the POST request to "webserver2".

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] Java based HTML editor

2003-09-05 Thread Todd Cary




I would like to have a HTML editor on a Web site so the user can create
HTML based text.  Google brings up too many matches when I type in
"Browser HTML editor Java" that do not match my needs.  Does anyone
have a suggestion?


Todd
-- 



<>

RE: [PHP] using fwrite to create PHP files

2003-09-05 Thread Chris Hubbard
Vince,
You also need to escape the $, so instead of
." if ($_GET..
use
." if (\$_GET.

You may have to escape the single quotes.

I have written two pretty lame code generators.  The first one did not use
"templates", the second one does.  You've got the lines of code in your
"builder" script.  I recommend moving those lines of code out, and put them
into a template, then use str_replace() to change the template as/where
needed.
chris

-Original Message-
From: Vince LaMonica [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 1:20 AM
To: PHP-General
Subject: [PHP] using fwrite to create PHP files


Hi all,

I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:

$new_id = mysql_insert_id();
// create brand new file
$new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
$new_file_content = "\n"
." http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id&
preview=y\"); \n"
." } else { \n"
."
readfile(\"http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id\
"); \n"
." } \n"
." ?>";

write($new_file, $new_file_content);
fclose($new_file);

Note that $sitename is defined earlier in the script.

I know that $new_id and $sitename get expanded, as I tried this:

$new_file_content = "hello world. Look at my ${'sitename'}.display and my
$new_id";

and the new file was created with the above text and the two vars
expanded. My problem lies in the fact that I need to put "  116 Social Ecology I, Irvine, CA 92697
 [EMAIL PROTECTED]  http://www.seweb.uci.edu/techsupport

 Tower: "Delta Zulu Romeo, turn right now and report your heading."
 Pilot: "Wilco. 341, 342, 343, 344, 345..."

--
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



Re: [PHP] Java based HTML editor

2003-09-05 Thread Raditha Dissanayake
Yes java newsgroups :-)
but seriously there is a good on at sourceforge.
Todd Cary wrote:

I would like to have a HTML editor on a Web site so the user can 
create HTML based text.  Google brings up too many matches when I type 
in "Browser HTML editor Java" that do not match my needs.  Does anyone 
have a suggestion?

Todd
--


--
http://www.radinks.com/upload/
Drag And Drop file Upload with Progress Bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Java based HTML editor

2003-09-05 Thread Chris Hubbard



I 
recommend htmlarea, it's _javascript_, not java.
http://www.interactivetools.com/products/htmlarea/
there's a couple similar scripts available.  
chris

  -Original Message-From: Todd Cary 
  [mailto:[EMAIL PROTECTED]Sent: Friday, September 05, 2003 
  6:48 AMTo: [EMAIL PROTECTED]Subject: [PHP] Java 
  based HTML editorI would like to have a HTML editor on a 
  Web site so the user can create HTML based text.  Google brings up too 
  many matches when I type in "Browser HTML editor Java" that do not match my 
  needs.  Does anyone have a suggestion? Todd 
  -- 


RE: [PHP] How can I get IP of ppp0?

2003-09-05 Thread Dan Anderson
> [snip]
> How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
> 's the function?
> [/snip]

Well, you can (if I'm not mistaken) create PHP modules using C++.  You
could also create shell scripts you could exec().  PHP isn't really
meant to be a server control though.  So anything you do should be
really beefy security.  (i.e. make sure any idiot can't just go to your
web site, pass in a get, and change the settings of your ethernet.  :-D
)

-Dan

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



Re: [PHP] POST security

2003-09-05 Thread Dan Anderson
Be careful about hidden variables and form variables.  A clever user can
create a new form with custom edited fields and ACTION="yoursite.com" 

For instance, if you keep a hidden variable:



It's not very hard for a computer saavy person to create a new form
where it says:



And circumvent your authorization.

-Dan

On Fri, 2003-09-05 at 10:32, bob pilly wrote:
> Hi all, i know this isnt strictly a php question but
> thought you would be a good group to ask because of
> your experience. 
> 
> Is there any security issues with passing data via the
> POST method from a webserver to a different webserver
> running ssl. For example:
> 
> webserver1
> 
>  action='https://webserver2/login.php'>
> 
> 
> and then just using  on
> webserver 2 to retrieve the data?
> 
> Thanks for any help in advance.
> 
> 
> 
> 
> Want to chat instantly with your online friends?  Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk

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



[PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Dan Anderson
I'm trying to figure out ways to tweak my scripts for performance.

I've figured out that all mySQL queries should use indexed ids for
speed.  (For anyone who doesn't know: mySQL indexes fields with PRIMARY
KEY, UNIQUE, or AUTO_INCREMENT in them.  This means they're stored in
binary trees internally, so access time is negligible for an INT PRIMARY
KEY AUTO_INCREMENT).

But how much overhead is there in:

$link = mysql_connect($hostname,$username,$password) or die("");
$db = mysql_select_db($database,$link) or die("");

Would it be beneficial to run a single one at the beginning of every
script?  Currently I have a bunch of functions each with their own
calls.

Best Regards,

Dan 

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



Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Chris Sherwood
check this out dan

It may help

http://www.mysql.com/doc/en/EXPLAIN.html


- Original Message - 
From: "Dan Anderson" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, September 05, 2003 8:38 AM
Subject: [PHP] mySQL overhead: Tweaking Scripts for Speed


> I'm trying to figure out ways to tweak my scripts for performance.
> 
> I've figured out that all mySQL queries should use indexed ids for
> speed.  (For anyone who doesn't know: mySQL indexes fields with PRIMARY
> KEY, UNIQUE, or AUTO_INCREMENT in them.  This means they're stored in
> binary trees internally, so access time is negligible for an INT PRIMARY
> KEY AUTO_INCREMENT).
> 
> But how much overhead is there in:
> 
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");
> 
> Would it be beneficial to run a single one at the beginning of every
> script?  Currently I have a bunch of functions each with their own
> calls.
> 
> Best Regards,
> 
> Dan 
> 
> -- 
> 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



Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Chris Shiflett
--- Dan Anderson <[EMAIL PROTECTED]> wrote:
> I've figured out that all mySQL queries should use indexed ids for
> speed.  (For anyone who doesn't know: mySQL indexes fields with ...

You can create an index yourself:

KEY [index_name] (index_col_name,...)

Find more on this page:

http://www.mysql.com/doc/en/CREATE_TABLE.html

> But how much overhead is there in:
> 
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");

This much:

|--|


> Would it be beneficial to run a single one at the beginning of every
> script?  Currently I have a bunch of functions each with their own
> calls.

Of course. One call is faster than a bunch of calls.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Scott Fletcher
Hi!

I looked at the rand() at php.net which spoke about min and max random
number.  So, I use rand(0,99) to get a 10 digit random number but it
only return an 1 digit random number that is displayed at '0'.  So, I tried
rand(0,) with 4 digit random number and got the random number.  So, why
does it not work with 10 digit numbers?

Scott F.

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



[PHP] [Thoughts About This] [Newbie Guide] For the benefit of new members

2003-09-05 Thread Joe Harman
Great guide here Ma Siva Kumar... I am a little guilty of not doing
this, actually recently too... As I think most of us are at one point or
another... Although I would like to add alittle something, maybe just
alittle guidance for newbies and seasoned professionals like yourself!

1. Helping those newbies out there helps promote PHP & Opensource
stuff... This is HUGE... Even if we have to hold someones hand through
the first steps. 

2. Most of understand the descriptions and explinations on the PHP.nt
site... But sometimes they are alittle vague (seldom though)... And most
people see them as very very technical... And they need some people to
translate for them... 

3. Tutorials are a great way to learn PHP... There is so much out there.
I am by no means an advance PHP programmer... But more of an
intermediate one... Often I do go through tutorials, but still am left a
little puzzled... So I ask people on these mailinglist for
clarification... I found that people here have a wealth of knowledge to
make people like me(RIGHT BRAINERS) understand... Heck if it wasn't for
some of these guys here, I would still be trying to understand
arrays

Bravo Ma Siva Kumar... Good guide...

Cheers!
Joe

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, September 01, 2003 12:33 AM
> To: PHP Mailing List
> Subject: [PHP] [Newbie Guide] For the benefit of new members
> 
> 
> =
> This message is for the benefit of new subscribers and those 
> new to PHP.  
> Those who  do not want to be bothered just filter out the 
> [Newbie Guide] 
> mails. Please feel free to add more points and send to the 
> list. ==
> 1. If you have any queries/problems about PHP try 
> http://www.php.net/manual/en 
> first. You can download a copy and use it offline also.
> 
> 2. If you can not get answer here try http://www.google.com next. Try 
> searching for "php YOUR QUERY" and you may be lucky to get an 
> answer within 
> the first 10 results.
> 
> 3. Glancing through the list archive at 
> http://marc.theaimsgroup.com/?l=php-general , you can find 
> many of the 
> common topics discussed repeatedly and can get your answer from those 
> discussions. 
> 
> 4. If you are stuck with a script and do not understand what 
> is wrong, instead 
> of posting the whole script, try doing some research 
> yourself. One useful 
> trick is to print the variable/sql query using print or echo 
> command and 
> check whether you get what you expected. 
> 
> After diagnosing the problem, send the details of your 
> efforts (following 
> steps 1,2 & 3) and ask for help in the list.
> 
> 5. Provide a clear descriptive subject line. Avoid general 
> subjects like 
> "Help!!", "A Question" etc.  Especially avoid blank subjects. 
> 
> 6. When you want to start a new topic, open a new mail and 
> enter the mailing 
> list address [EMAIL PROTECTED] instead of replyting 
> to an existing 
> thread and replacing the subject and body with your message.
> 
> 7. PHP is a server side scripting language. Whatever 
> processing PHP does takes 
> place BEFORE the output reaches the client. Therefore, it is 
> not possible to 
> access the users'  computer related information (OS, screen 
> size etc) using 
> PHP. You need to go for Java Script and ask the question in a 
> Java Script 
> list.
> 
> 8. It's always a good idea to post back to the list once 
> you've solved your problem. People usually add [SOLVED] to 
> the subject line of their email when posting solutions. By 
> posting your solution you're helping the next person with the 
> same question. [contribued by Chris W Parker]
> 
> 9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
> [contributed by Jay Blanchard)
> 
> Hope you have a good time programming with PHP.
> 
> Best regards,
> 
> -- 
> Ma Siva Kumar,
> 
> INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY
> BSG LeatherLink,
> Chennai.
> Ph: +91 44 55191757
> URL : http://www.leatherlink.net
> 
> -- 
> 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



[PHP] Remove vars from memory?

2003-09-05 Thread \[cz\]Emo
Hi all.
Will PHP remove variables from memory when script will NOT use them in rest
of code?
for example:



or I must use allways unset()?

Thanx

Emo

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



Re: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Robert Cummings
It probably wraps the standard C rand() function which only takes an
unsigned integer which is usually 16 bits.

Cheers,
Rob.

On Fri, 2003-09-05 at 12:34, Scott Fletcher wrote:
> Hi!
> 
> I looked at the rand() at php.net which spoke about min and max random
> number.  So, I use rand(0,99) to get a 10 digit random number but it
> only return an 1 digit random number that is displayed at '0'.  So, I tried
> rand(0,) with 4 digit random number and got the random number.  So, why
> does it not work with 10 digit numbers?
> 
> Scott F.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Remove vars from memory?

2003-09-05 Thread murugesan
You must use unset()

-Murugesan

- Original Message -
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Scott Fletcher" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 05, 2003 10:25 PM
Subject: Re: [PHP] Using rand() for 10 digit numbers


> It probably wraps the standard C rand() function which only takes an
> unsigned integer which is usually 16 bits.
>
> Cheers,
> Rob.
>
> On Fri, 2003-09-05 at 12:34, Scott Fletcher wrote:
> > Hi!
> >
> > I looked at the rand() at php.net which spoke about min and max
random
> > number.  So, I use rand(0,99) to get a 10 digit random number
but it
> > only return an 1 digit random number that is displayed at '0'.  So, I
tried
> > rand(0,) with 4 digit random number and got the random number.  So,
why
> > does it not work with 10 digit numbers?
> >
> > Scott F.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> .-.
> | Worlds of Carnage - http://www.wocmud.org   |
> :-:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.|
> `-'
>
> --
> 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



RE: [PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread Chris W. Parker
David Robley 
on Friday, September 05, 2003 5:59 AM said:

> Well, no - I am sure you can do it with an entry in .htaccess in the
> server root.

Yeah, like a rewrite rule.

RewriteRule ^*$ down.html



Chris.

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



Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread CPT John W. Holmes
From: "Dan Anderson" <[EMAIL PROTECTED]>
> But how much overhead is there in:
>
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");
>
> Would it be beneficial to run a single one at the beginning of every
> script?  Currently I have a bunch of functions each with their own
> calls.

You should only "connect" once in your script. It's usually in an include
file to make things easy.

While multiple connections will just return the first connection, anyhow,
why do the extra work, right?

---John Holmes...

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



RE: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Jay Blanchard
[snip]
I looked at the rand() at php.net which spoke about min and max
random
number.  So, I use rand(0,99) to get a 10 digit random number
but it
only return an 1 digit random number that is displayed at '0'.  So, I
tried
rand(0,) with 4 digit random number and got the random number.  So,
why
does it not work with 10 digit numbers?
[/snip]

How may tests did you run? I just did this 

901,476,090
1,161,662,632
1,133,163,790
116,198,549
862,072,958
160,284,836
368,780,044
1,561,820,920
1,407,692,572
1,480,574,886
473,849,932
380,642,419
167,966,462
466,661,331
1,266,542,359
160,809,301
215,539,845
85,493,351
103,799,041
950,218,662
417,076,793
1,190,550,903
658,771,070
1,388,939,508
1,357,822,101

with this

 0){
$random=rand (0,9);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

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



Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Dan Anderson
> While multiple connections will just return the first connection, anyhow,
> why do the extra work, right?

Yes that was what I was thinking.  But I was also thinking that I would
need to global the $link and $db variables and run mysql_query() with
them in options.  So I'm wondering how much work coding it will save.  
Or will it default to the mysql connection active in the main program?

-Dan

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



[PHP] PHP code generation

2003-09-05 Thread Chris Hubbard
I'm working on a code generation project.  Is there anyone on the list who
has experience building these things, and, would like to discuss
architecture/patterns/structure of code generation off-list?


Chris Hubbard
[EMAIL PROTECTED]
www.wildcharacters.com
425 481 2020

php based web application development

Y! [EMAIL PROTECTED]
MSN [EMAIL PROTECTED]
AIM ganeshacph

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



Re: [PHP] mysql Pattern Matching

2003-09-05 Thread CPT John W. Holmes
From: "Ralph Guzman" <[EMAIL PROTECTED]>


> Is there an advantage or difference in running FIND_IN_SET() instead of
> LIKE?

Actually no, I guess there isn't. Neither one will use an index.

mysql> desc test;
+---+-+--+-+-+---+
| Field | Type| Null | Key | Default | Extra |
+---+-+--+-+-+---+
| b | varchar(50) |  | MUL | |   |
+---+-+--+-+-+---+
1 row in set (0.01 sec)

mysql> explain select * from test where b like '%two%';
+---++---+--+-+--+--+---+
| table | type   | possible_keys | key  | key_len | ref  | rows | Extra |
+---++---+--+-+--+--+---+
| test  | system | NULL  | NULL |NULL | NULL |1 |   |
+---++---+--+-+--+--+---+
1 row in set (0.00 sec)

mysql> explain select * from test where find_in_set('two',b);
+---++---+--+-+--+--+---+
| table | type   | possible_keys | key  | key_len | ref  | rows | Extra |
+---++---+--+-+--+--+---+
| test  | system | NULL  | NULL |NULL | NULL |1 |   |
+---++---+--+-+--+--+---+
1 row in set (0.00 sec)

---John Holmes...

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



[PHP] RH9.0: Upgrade to 4.3, mysql functions not working

2003-09-05 Thread Wouter van Vliet
Hi Folks,

I've got a (in my eyes) very strange behaviour from my RedHat Linux 9.0 box.
I needed to upgrade my PHP version to 4.3, since that's the version on the
production server and well .. test and production should match pretty good
;). Since self compiling didn't work. All errors with apxs and stuff. And I
just found out about the new RH9 version with php4.3 I decided to get the
packages from that distribution into my test server.

Started with downloading the php packages. Ended up installing 20+ packages
because of all dependences. From httpd->mod_perl->Perl, pam, sendmail even.
Glibc of course. All seemed quite well. And from the commandline it works
quite well. PHP files get parsed through apache, but somehow it fatals on
"undefined function mysql_select". I've tried restarting apache a coupla
times. Restarted mysql a coupla times. Even rebooted the server a coupla
times. Installed the new mysql package. But nothing works. The mysql
functions stay undefined.

>From the commandline it all works normally, though..

(ow, now suddenly the error changed to just "Error 500, Internal server
error")

thanks for any help ..

--- some info ---

=== errors from error_log ===
PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol:
OnUpdateBool in Unknown on line 0

=== rpm -qa | grep php
php-4.3.2-7
php-ldap-4.3.2-7
php-pgsql-4.3.2-7
php-mysql-4.3.2-7

=== rpm -qa | grep mysql
mysql-3.23.57-1
php-mysql-4.3.2-7
mysql-server-3.23.57-1

=== rpm -qa | grep httpd
httpd-2.0.47-4
httpd-manual-2.0.40-21.3
redhat-config-httpd-1.0.1-18

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



Re: [PHP] Remove vars from memory?

2003-09-05 Thread Tyler Lane
On Fri, 2003-09-05 at 09:38, [cz]Emo wrote:
> Hi all.
> Will PHP remove variables from memory when script will NOT use them in rest
> of code?
> for example:
> 
>  $tmp=true;
> if ($tmp)  // here is $tmp used last time, will it be removed from memory?
> ...
> ... // $tmp is NOT in the rest of code
> ...
> ...
> ?>
> 
> or I must use allways unset()?
> 
yes, you must use unset() to remove a variable, otherwise it will stay
for the duration of the script.

> Thanx
> 
> Emo
-- 
Tyler Lane <[EMAIL PROTECTED]>
Lyrical Communications


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


Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread CPT John W. Holmes
From: "Dan Anderson" <[EMAIL PROTECTED]>


> > While multiple connections will just return the first connection,
anyhow,
> > why do the extra work, right?
>
> Yes that was what I was thinking.  But I was also thinking that I would
> need to global the $link and $db variables and run mysql_query() with
> them in options.  So I'm wondering how much work coding it will save.
> Or will it default to the mysql connection active in the main program?

It'll default. You only need to pass $link and $db to mysql_query() and the
other functions when you have multiple connections open to multiple
databases at the same time (something that is rarely needed).

---John Holmes...

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



RE: [PHP] RH9.0: Upgrade to 4.3, mysql functions not working

2003-09-05 Thread Jay Blanchard
[snip]
"undefined function mysql_select". 
[/snip]

mysql_select by itself isn't a function. Are you using other code to
define this function? Or are you just using shorthand here?

[snip]
=== errors from error_log ===
PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library
'/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol:
OnUpdateBool in Unknown on line 0
[/snip]

Are those libs in place? Just checking...

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



[PHP] Virus Detected by Network Associates, Inc. Webshield SMTP V4.5

2003-09-05 Thread postmaster
Network Associates WebShield SMTP V4.5 on fzkmail2 detected virus W32/[EMAIL 
PROTECTED] in
attachment document_9446.pif from <[EMAIL PROTECTED]> and it was Cleaned and
Quarantined.

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



Re: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Scott Fletcher
How interesting.  Yours work while mine doesn't.  All I did was ..

--snip--
$randomNumber = rand(0,99);
echo $randomNumber;
--snip--

What PHP version do you use?  I only have version 4.3.1 on the machine.


"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
I looked at the rand() at php.net which spoke about min and max
random
number.  So, I use rand(0,99) to get a 10 digit random number
but it
only return an 1 digit random number that is displayed at '0'.  So, I
tried
rand(0,) with 4 digit random number and got the random number.  So,
why
does it not work with 10 digit numbers?
[/snip]

How may tests did you run? I just did this 

901,476,090
1,161,662,632
1,133,163,790
116,198,549
862,072,958
160,284,836
368,780,044
1,561,820,920
1,407,692,572
1,480,574,886
473,849,932
380,642,419
167,966,462
466,661,331
1,266,542,359
160,809,301
215,539,845
85,493,351
103,799,041
950,218,662
417,076,793
1,190,550,903
658,771,070
1,388,939,508
1,357,822,101

with this

 0){
$random=rand (0,9);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

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



Re: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Scott Fletcher
Could be

"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It probably wraps the standard C rand() function which only takes an
> unsigned integer which is usually 16 bits.
>
> Cheers,
> Rob.
>
> On Fri, 2003-09-05 at 12:34, Scott Fletcher wrote:
> > Hi!
> >
> > I looked at the rand() at php.net which spoke about min and max
random
> > number.  So, I use rand(0,99) to get a 10 digit random number
but it
> > only return an 1 digit random number that is displayed at '0'.  So, I
tried
> > rand(0,) with 4 digit random number and got the random number.  So,
why
> > does it not work with 10 digit numbers?
> >
> > Scott F.
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> -- 
> .-.
> | Worlds of Carnage - http://www.wocmud.org   |
> :-:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.|
> `-'

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



[PHP] PHP 4.3.3 compile error

2003-09-05 Thread Adam Williams
Hello,

I'm trying to compile PHP 4.3.3.  My configure is:

./configure --enable-track-vars --without-mysql --with-mail 
--with-apxs2=/usr/local/apache2/bin/apxs --with-informix

and when doing make I get:

[EMAIL PROTECTED] php-4.3.3]# make
/bin/sh /root/php-4.3.3/libtool --silent --preserve-dup-deps 
--mode=compile gcc -I/usr/informix/incl/esql -Iext/informix/ 
-I/root/php-4.3.3/ext/informix/ -DPHP_ATOM_INC -I/root/php-4.3.3/include 
-I/root/php-4.3.3/main -I/root/php-4.3.3 -I/root/php-4.3.3/Zend 
-I/root/php-4.3.3/ext/xml/expat  -I/root/php-4.3.3/TSRM  -g -O2  
-prefer-pic -c /root/php-4.3.3/ext/informix/ifx.c -o ext/informix/ifx.lo
/root/php-4.3.3/ext/informix/ifx.ec: In function `zm_info_ifx':
/root/php-4.3.3/ext/informix/ifx.ec:402: parse error before '/' token
/root/php-4.3.3/ext/informix/ifx.ec:3127:17: operator '<' has no left 
operand
make: *** [ext/informix/ifx.lo] Error 1



I'm not a programmer, so any advice on why its breaking on making the 
informix code and how to fix it would be appreciated.  Thanks!

Adam

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



[PHP] Re: PHP code generation

2003-09-05 Thread Scott Fletcher
What are the example of code generation project?  Are you referring to the
generation of the random characters?

"Chris Hubbard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm working on a code generation project.  Is there anyone on the list who
> has experience building these things, and, would like to discuss
> architecture/patterns/structure of code generation off-list?
>
>
> Chris Hubbard
> [EMAIL PROTECTED]
> www.wildcharacters.com
> 425 481 2020
>
> php based web application development
>
> Y! [EMAIL PROTECTED]
> MSN [EMAIL PROTECTED]
> AIM ganeshacph

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



RE: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Jay Blanchard
[snip]
What PHP version do you use?  I only have version 4.3.1 on the machine.
[/snip]

Did this on a 4.2.1 and a 4.3...no probs. Have you tried the code I
posted on your machine?

 0){
$random=rand (0,9);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

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



RE: [PHP] Re: PHP code generation

2003-09-05 Thread Chris Hubbard
No, not random character generation.

Currently the application I'm working does the following:
1.  from an array that defines HTML components (like a table row, input
field, file upload, etc), and,
2.  from an array that defines PHP components (like sql queries, file
upload, assigning values to variables, etc), and,
3.  a library of HTML components (like the HTML to display; a table row, a
search box, a text area, etc),
4.  take all three of the above and do a (fairly) complex suite of
str_replaces and then file writes, output .php and .tpl files, resulting in
a (hopefully) functional application.

Primary advantage:
as the application developer (as distinct from the code generation
developer), you only have to build arrays.  The arrays can be built from
HTML forms, or XML, or ...?

Secondary advantage:
if you need to build multiple instances of the application with minor
changes, it's trivial to build and maintain.

Tertiary advantage:
you have a common "framework" (though not technically a framework) for all
deployed applications.  It's relatively easy to "upgrade" the applications,
or swap out sections of the code with improved code.

chris



-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 9:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: PHP code generation


What are the example of code generation project?  Are you referring to the
generation of the random characters?

"Chris Hubbard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm working on a code generation project.  Is there anyone on the list who
> has experience building these things, and, would like to discuss
> architecture/patterns/structure of code generation off-list?
>
>
> Chris Hubbard
> [EMAIL PROTECTED]
> www.wildcharacters.com
> 425 481 2020
>
> php based web application development
>
> Y! [EMAIL PROTECTED]
> MSN [EMAIL PROTECTED]
> AIM ganeshacph

--
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



[PHP] Parse error?

2003-09-05 Thread Mike Zornek
I'm trying to give PEAR a try and am currently following it's tutorial at:
http://pear.php.net/manual/en/package.database.db.intro-fetch.php

Now when I put this code into a PHP file I get a parse error on line 49
which has:

while ($row = $result->fetchRow()) {

I don't see what would cause the error, maybe the object syntax? I'm new to
PHP objects so little help.

~ Mike
-- 
Mike Zornek
Extreme geek in training
http://MikeZornek.com 

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



[PHP] previous and next link

2003-09-05 Thread phpu
I have this code and I wanna display only 10 records on page. For the rest of them I 
wanna use a "next" link(or a previous link).
Please tell me hoe can I do that.
 

$sql = "SELECT * FROM categorie" ;
$rezultat = mysql_query($sql); 
$num_rows = mysql_num_rows($rezultat);

while ($row=mysql_fetch_array($rezultat)) {


 print ' '.$row['nume_categorie'].'';
  
}

 


Re: [PHP] previous and next link

2003-09-05 Thread Chris Shiflett
--- phpu <[EMAIL PROTECTED]> wrote:
> I have this code and I wanna display only 10 records on page.

Use the LIMIT clause in your select statement:

http://www.mysql.com/doc/en/SELECT.html

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] Re: Java based HTML editor

2003-09-05 Thread Dan Phiffer
Assuming you mean that the user isn't typing HTML code (like an online IDE),
you might want to take a look at:

http://www.bris.ac.uk/is/projects/cms/ttw/ttw.html#os

Best,
-Dan

"Todd Cary" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I would like to have a HTML editor on a Web site so the user can create
> HTML based text.  Google brings up too many matches when I type in
> "Browser HTML editor Java" that do not match my needs.  Does anyone have
> a suggestion?
>
> Todd
> -- 
>






> I would like to have a HTML editor on a Web site so the user can create
HTML based text.  Google brings up too many matches when I type in "Browser
HTML editor Java" that do not match my needs.  Does anyone have a
suggestion?
>
> Todd
> -- 
>

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



[PHP] Very interesting.....

2003-09-05 Thread Scott Fletcher
I tried your code on this machine and I got this...

--snip--
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--snip--

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



[PHP] previous and next link

2003-09-05 Thread phpu
I've tried but i don't know how to put it in my script. And also i don't know  how to 
display it in page. Here is my script and I hope you could help me with this one.
thanks


$sql = "SELECT * FROM categorie" ;
$rezultat = mysql_query($sql); 
$num_rows = mysql_num_rows($rezultat);

while ($row=mysql_fetch_array($rezultat)) {


 print ' '.$row['nume_categorie'].'';
  
}



RE: [PHP] Very interesting.....

2003-09-05 Thread Jay Blanchard
[snip]
I tried your code on this machine and I got this...

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.
[/snip]

What is your numeric precesion set to in the php.ini?

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



Re: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Scott Fletcher
Very Interesting.  I tried your code on my machine and I got this...

--snip--
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--snip--

Weird...  I other quick question.  What the heck is going on?

Scott F.


"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
What PHP version do you use?  I only have version 4.3.1 on the machine.
[/snip]

Did this on a 4.2.1 and a 4.3...no probs. Have you tried the code I
posted on your machine?

 0){
$random=rand (0,9);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

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



RE: [PHP] previous and next link

2003-09-05 Thread Jay Blanchard
[snip]
I've tried but i don't know how to put it in my script. And also i don't
know  how to display it in page. Here is my script and I hope you could
help me with this one.
thanks
[/snip]

Google is SO cool!!! :)
http://www.onlamp.com/pub/a/php/2000/11/02/next_previous.html

Have a pleasant and productive day!

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



Re: [PHP] Very interesting.....

2003-09-05 Thread Scott Fletcher
There isn't one in php.ini.  Could this be the problem?

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
I tried your code on this machine and I got this...

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.
[/snip]

What is your numeric precesion set to in the php.ini?

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



RE: [PHP] Very interesting.....

2003-09-05 Thread Jay Blanchard
[snip]
There isn't one in php.ini.  Could this be the problem?
[/snip]

Look for these lines in your php.ini

; The number of significant digits displayed in floating point numbers.
precision=  14

What is precision equal to?

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



Re: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Scott Fletcher
Continue(ing) of this replying go into the title, 'Very Interesting'.


"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Very Interesting.  I tried your code on my machine and I got this...
>
> --snip--
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0
0
> 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> --snip--
>
> Weird...  I other quick question.  What the heck is going on?
>
> Scott F.
>
>
> "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> [snip]
> What PHP version do you use?  I only have version 4.3.1 on the machine.
> [/snip]
>
> Did this on a 4.2.1 and a 4.3...no probs. Have you tried the code I
> posted on your machine?
>
>  $i=25;
> while($i > 0){
> $random=rand (0,9);
> echo number_format($random, 0, '', ',')."\n";
> $i--;
> }
> ?>

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



Re: [PHP] previous and next link

2003-09-05 Thread Chris Shiflett
--- phpu <[EMAIL PROTECTED]> wrote:
> I've tried but i don't know how to put it in my script.

Here is your SQL statement (between the quotes):

> $sql = "SELECT * FROM categorie";

Add a LIMIT clause to that statement. The syntax is described at the URL I sent
you.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Very interesting.....

2003-09-05 Thread Scott Fletcher
It is not there, so I added it and restarted Apache.  Still got the same
result.

How is PHP is built into Apache was done by downloading the tar.gz file from
php.net and compile it.  Then compile Apache, had it take in PHP.  So, when
it was done, there is never a php.ini there.  So, I create one and add some
of hte coding into php.ini file.  This is for the Unix machine.  The only
scripting I have in php.ini so far is ...

--snip--
mcrypt.algorithms_dir =
/usr/local/lib/source_libmcrypt-2.5.3/modules/algorithms
mcrypt.modes_dir = /usr/local/lib/source_libmcrypt-2.5.3/modules/modes

#sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED]

precision = 14
--snip--

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
There isn't one in php.ini.  Could this be the problem?
[/snip]

Look for these lines in your php.ini

; The number of significant digits displayed in floating point numbers.
precision=  14

What is precision equal to?

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



Re: [PHP] using fwrite to create PHP files

2003-09-05 Thread John W. Holmes
Vince LaMonica wrote:

I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:
$new_id = mysql_insert_id();
// create brand new file
$new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
$new_file_content = "\n"
." You need to escape the dollar signs in your string.

." if (\$_GET['preview'] == \"y\") { \n"

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] mysql Pattern Matching

2003-09-05 Thread Curt Zirzow
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]):
> From: "Ralph Guzman" <[EMAIL PROTECTED]>
> 
> 
> > Is there an advantage or difference in running FIND_IN_SET() instead of
> > LIKE?
> 
> Actually no, I guess there isn't. Neither one will use an index.

There will be a slight diffence in the resuls though, depending on
the term searched and the contents

id   field
---  --
 1   one,two
 2   fooone,footwo 
 3   onefoo,twofoo

> 
> mysql> explain select * from test where b like '%two%';

select id from test where b like '%two%'

id
---
 1
 2
 3

> mysql> explain select * from test where find_in_set('two',b);

select id from test where find_in_set('two',b);

id
---
1


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] using fwrite to create PHP files

2003-09-05 Thread Chris Sherwood
this is a sample of what I do when I need to write a php file

$stringtowrite = "
> Vince LaMonica wrote:
>
> > I wish to use fwrite() to create a small PHP file. So far, when I
attempt
> > to do this, php parses the contents of the file that fwrite needs to
> > create. Eg, I have this:
> >
> > $new_id = mysql_insert_id();
> > // create brand new file
> > $new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
> > $new_file_content = "\n"
> > ."  > ." if ($_GET['preview'] == \"y\") { \n"
>
> You need to escape the dollar signs in your string.
>
> ." if (\$_GET['preview'] == \"y\") { \n"
>
> -- 
> ---John Holmes...
<-- snip -->

Chris Sherwood

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



Re: [PHP] Remove vars from memory?

2003-09-05 Thread Curt Zirzow
* Thus wrote murugesan ([EMAIL PROTECTED]):
> You must use unset()

How you keep doing this, I have no clue. but your subject and content has
nothing to do with the thread or quoted content.

Please reply and quote the proper messages with the proper subject
so it doesn't confuse people.

> 
> -Murugesan
> 
> - Original Message -
> From: "Robert Cummings" <[EMAIL PROTECTED]>
> To: "Scott Fletcher" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, September 05, 2003 10:25 PM
> Subject: Re: [PHP] Using rand() for 10 digit numbers
> [...]


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Using rand() for 10 digit numbers????

2003-09-05 Thread Curt Zirzow
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]):
> How interesting.  Yours work while mine doesn't.  All I did was ..
> 
> --snip--
> $randomNumber = rand(0,99);
> echo $randomNumber;
> --snip--
> 
> What PHP version do you use?  I only have version 4.3.1 on the machine.

I believe its the OS he's using.  to avoid this use mt_rand()
instead since this one is more efficient and system INdependent.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] [SOLVED] Re: [PHP] Parse error?

2003-09-05 Thread Mike Zornek
On 9/5/03 1:50 PM, "Mike Zornek" <[EMAIL PROTECTED]> wrote:

> I'm trying to give PEAR a try and am currently following it's tutorial at:
> http://pear.php.net/manual/en/package.database.db.intro-fetch.php
> 
> Now when I put this code into a PHP file I get a parse error on line 49
> which has:
> 
> while ($row = $result->fetchRow()) {
> 
> I don't see what would cause the error, maybe the object syntax? I'm new to
> PHP objects so little help.
> 
> ~ Mike

Ok, the reason I was getting this error seems to be related to Safari on OS
X. When I copy code segments in Safari and paste them in BBEdit they
generally looked ok, although there were extra spaces inserted in some
places. I then turned on show invisible characters and it made it even more
clear that something was up.

I'll detail it more later in my blog and then forward it to apple in a bug
report. For now I'll move to Mozilla for this.

~ Mike
-- 
Mike Zornek
Extreme geek in training
http://MikeZornek.com 

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



RE: [PHP] Very interesting.....

2003-09-05 Thread Jay Blanchard
[snip]
It is not there, so I added it and restarted Apache.  Still got the same
result.

How is PHP is built into Apache was done by downloading the tar.gz file
from
php.net and compile it.  Then compile Apache, had it take in PHP.  So,
when
it was done, there is never a php.ini there.  So, I create one and add
some
of hte coding into php.ini file.  This is for the Unix machine.  The
only
scripting I have in php.ini so far is ...
[/snip]

You should have 2 or 3 php.ini filesusually

php.ini-dist
php.ini-optimized
php.ini-recommended

(from the command line 'locate php.ini')

You pick the one that you want to use and copy it into /etc/apache while
renaming it php.ini. My current php.ini file is comprised of 775 lines
of information and directives. As I understand it the .ini is not
required, and probaly is not affecting the rand on your machine.

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



Re: [PHP] RH9.0: Upgrade to 4.3, mysql functions not working

2003-09-05 Thread Curt Zirzow
* Thus wrote Wouter van Vliet ([EMAIL PROTECTED]):
> Hi Folks,
> 
> I've got a (in my eyes) very strange behaviour from my RedHat Linux 9.0 box.
> I needed to upgrade my PHP version to 4.3, since that's the version on the
> production server and well .. test and production should match pretty good
> ;). Since self compiling didn't work. All errors with apxs and stuff. And I
> just found out about the new RH9 version with php4.3 I decided to get the
> packages from that distribution into my test server.
> 
> Started with downloading the php packages. Ended up installing 20+ packages
> because of all dependences. From httpd->mod_perl->Perl, pam, sendmail even.
> Glibc of course. All seemed quite well. And from the commandline it works
> quite well. PHP files get parsed through apache, but somehow it fatals on
> "undefined function mysql_select". I've tried restarting apache a coupla
> times. Restarted mysql a coupla times. Even rebooted the server a coupla
> times. Installed the new mysql package. But nothing works. The mysql
> functions stay undefined.

It sounds like you're having problems using the rpm package system.
I would suggest you ask these questions over on redhat for support
on using rpm's.  


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Very interesting.....

2003-09-05 Thread Scott Fletcher
Will do that once I get a newer PHP version.  No time for it right now.  :-)

The workaround to rand() I did was to use it twice and add up the result.
For ex.

--snip--
$randomNumberLeft = rand(0,9);
$randomNumberRight = rand(0,9);
$randomNumber = $randomNumberLeft.$randomNumberRight;

echo $randomNumber.
--snip--

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
It is not there, so I added it and restarted Apache.  Still got the same
result.

How is PHP is built into Apache was done by downloading the tar.gz file
from
php.net and compile it.  Then compile Apache, had it take in PHP.  So,
when
it was done, there is never a php.ini there.  So, I create one and add
some
of hte coding into php.ini file.  This is for the Unix machine.  The
only
scripting I have in php.ini so far is ...
[/snip]

You should have 2 or 3 php.ini filesusually

php.ini-dist
php.ini-optimized
php.ini-recommended

(from the command line 'locate php.ini')

You pick the one that you want to use and copy it into /etc/apache while
renaming it php.ini. My current php.ini file is comprised of 775 lines
of information and directives. As I understand it the .ini is not
required, and probaly is not affecting the rand on your machine.

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



[PHP] Opening Zip Files in Linux

2003-09-05 Thread John Ryan
This is kinda off topic, well.. depending on the answer.

I downloaded a ZIP file to my server, and want to open it. My version of PHP
wasnt compiled with the Zip uncompressing functions, otherwise Id do it with
php,  so I was wondering if there was a linux-x86 binary that just opens zip
files!

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



[PHP] Re: Opening Zip Files in Linux

2003-09-05 Thread John Herren
John Ryan wrote:
This is kinda off topic, well.. depending on the answer.

I downloaded a ZIP file to my server, and want to open it. My version of PHP
wasnt compiled with the Zip uncompressing functions, otherwise Id do it with
php,  so I was wondering if there was a linux-x86 binary that just opens zip
files!
Try unzip :)

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


[PHP] dl() problem

2003-09-05 Thread Alex
Hello..

Is there a way of setting the extension_dir by not modifying php.ini ?

i've tried with 

ini_set("extension_dir","/home/alexcos/www/phps");
dl("first_module.so");
Warning: Unable to load dynamic library '/usr/lib/php4/first_module.so' 



then , i've tried setting the extension_dir in a .htaccess file..
still , the same result..


i have developed a small module , but I can't use it..
my site is hosted on an service provider , and they don't allow me to copy the module 
to extension_dir or to change the php.ini..


what should I do ?

Thanks 

Alex

RE: [PHP] RH9.0: Upgrade to 4.3, mysql functions not working

2003-09-05 Thread Wouter van Vliet
No I'm not using a shorthand or other code to define the function ..  I just
typed select instead of connect. ;)

And yep, I can both stat and vim ;) those libs.

 -> -Oorspronkelijk bericht-
 -> Van: Jay Blanchard [mailto:[EMAIL PROTECTED]
 -> Verzonden: vrijdag 5 september 2003 19:21
 -> Aan: Wouter van Vliet; PHP General
 -> Onderwerp: RE: [PHP] RH9.0: Upgrade to 4.3, mysql functions not working
 ->
 ->
 -> [snip]
 -> "undefined function mysql_select".
 -> [/snip]
 ->
 -> mysql_select by itself isn't a function. Are you using other code to
 -> define this function? Or are you just using shorthand here?
 ->
 -> [snip]
 -> === errors from error_log ===
 -> PHP Warning:  Unknown(): Unable to load dynamic library
 -> '/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol:
 -> OnUpdateInt in Unknown on line 0
 -> PHP Warning:  Unknown(): Unable to load dynamic library
 -> '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
 -> OnUpdateInt in Unknown on line 0
 -> PHP Warning:  Unknown(): Unable to load dynamic library
 -> '/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol:
 -> OnUpdateBool in Unknown on line 0
 -> [/snip]
 ->
 -> Are those libs in place? Just checking...
 ->
 ->

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



[PHP] global array, can't assign values from variables

2003-09-05 Thread Chris Edwards
Hi

I'm just going to give the code and output.  It should be self explanatory.
The array, $criteria, is having the issue.  I don't know what it's doing.  I
cannot seem to assign the value from the $data variable to the
$criteria[index] value.  You will see some attempts to debug the situation
which leads me to more puzzlement.

CODE:

// run when cdata is found
function characterDataHandler($parser, $data)
  {
  switch( $GLOBALS['currentTag'] )
{
case "MINSTARTDATE" : echo $data;/*$GLOBALS['criteria']['minstartdate']
= $data;*/break;
case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
"junk";/*$data;*/break;
case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
case "MAXSTAY" : $GLOBALS['criteria']['maxstay'] = $data; break;
case "MINRENT" : $GLOBALS['criteria']['minrent'] = $data; break;
case "MAXRENT" : $GLOBALS['criteria']['maxrent'] = $data; break;
case "RENTINC" : $GLOBALS['criteria']['rentinc'] = $data; break;
case "MINBEDS" : $GLOBALS['criteria']['minbeds'] = $data; break;
case "MAXBEDS" : $GLOBALS['criteria']['maxbeds'] = $data; break;
case "PROPCOUNT" : $GLOBALS['criteria']['propcount'] = $data; break;
default: break;
}
  }




echo "\n";
print_r($criteria);
echo "\n";


OUTPUT:
9/6/2003
Array
(
[maxstartdate] => junk
[minstay] =>

[maxstay] =>

[minrent] =>

[maxrent] =>

[rentinc] =>

[minbeds] =>

[maxbeds] =>

[propcount] =>

)
Thanks.-- 
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
[EMAIL PROTECTED]
http://www.OuterBanksInternet.com

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



Re: [PHP] global array, can't assign values from variables

2003-09-05 Thread John W. Holmes
Chris Edwards wrote:

I'm just going to give the code and output.  It should be self explanatory.
The array, $criteria, is having the issue.  I don't know what it's doing.  I
cannot seem to assign the value from the $data variable to the
$criteria[index] value.  You will see some attempts to debug the situation
which leads me to more puzzlement.
CODE:

// run when cdata is found
function characterDataHandler($parser, $data)
  {
  switch( $GLOBALS['currentTag'] )
{
case "MINSTARTDATE" : echo $data;/*$GLOBALS['criteria']['minstartdate']
= $data;*/break;
case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
"junk";/*$data;*/break;
case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
[snip]
echo "\n";
print_r($criteria);
echo "\n";
OUTPUT:
9/6/2003
Array
(
[maxstartdate] => junk
[minstay] =>
[snip]

$data is empty. How are you calling this function?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] dl() problem

2003-09-05 Thread Curt Zirzow
* Thus wrote Alex ([EMAIL PROTECTED]):
> Hello..
> 
> Is there a way of setting the extension_dir by not modifying php.ini ?
> 
> i've tried with 
> 
> ini_set("extension_dir","/home/alexcos/www/phps");
> 
> then , i've tried setting the extension_dir in a .htaccess file..
> still , the same result..

according to ini_set() documentation, extension_dir can only be set
in php.ini or apache.conf

   http://php.net/ini_set


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] global array, can't assign values from variables SOLVED

2003-09-05 Thread Chris Edwards
Hi

$data is not empty.  It's obvious from the :
> > OUTPUT:
> > 9/6/2003

Anyways, it is overwriting itself because of begin and start tags.  I didn't
realize that.
Thanks.
-- 
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
[EMAIL PROTECTED]
http://www.OuterBanksInternet.com

- Original Message - 
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Chris Edwards" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 05, 2003 4:11 PM
Subject: Re: [PHP] global array, can't assign values from variables


> Chris Edwards wrote:
>
> > I'm just going to give the code and output.  It should be self
explanatory.
> > The array, $criteria, is having the issue.  I don't know what it's
doing.  I
> > cannot seem to assign the value from the $data variable to the
> > $criteria[index] value.  You will see some attempts to debug the
situation
> > which leads me to more puzzlement.
> >
> > CODE:
> >
> > // run when cdata is found
> > function characterDataHandler($parser, $data)
> >   {
> >   switch( $GLOBALS['currentTag'] )
> > {
> > case "MINSTARTDATE" : echo
$data;/*$GLOBALS['criteria']['minstartdate']
> > = $data;*/break;
> > case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
> > "junk";/*$data;*/break;
> > case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
> [snip]
> >
> > echo "\n";
> > print_r($criteria);
> > echo "\n";
> >
> >
> > OUTPUT:
> > 9/6/2003
> > Array
> > (
> > [maxstartdate] => junk
> > [minstay] =>
> [snip]
>
>
> $data is empty. How are you calling this function?
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> -- 
> 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



Re: [PHP] global array, can't assign values from variables

2003-09-05 Thread Curt Zirzow
* Thus wrote Chris Edwards ([EMAIL PROTECTED]):
> Hi
> 
> I'm just going to give the code and output.  It should be self explanatory.
> The array, $criteria, is having the issue.  I don't know what it's doing.  I
> cannot seem to assign the value from the $data variable to the
> $criteria[index] value.  You will see some attempts to debug the situation
> which leads me to more puzzlement.

This code can't be clearly evaluated, There are several things that
can be wrong

> 
> CODE:
> 
>   switch( $GLOBALS['currentTag'] )
> {
> case "MINSTARTDATE" : echo $data;/*$GLOBALS['criteria']['minstartdate']
> = $data;*/break;
> case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
> "junk";/*$data;*/break;
> case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
> case "MAXSTAY" : $GLOBALS['criteria']['maxstay'] = $data; break;
> case "MINRENT" : $GLOBALS['criteria']['minrent'] = $data; break;
> case "MAXRENT" : $GLOBALS['criteria']['maxrent'] = $data; break;
> case "RENTINC" : $GLOBALS['criteria']['rentinc'] = $data; break;
> case "MINBEDS" : $GLOBALS['criteria']['minbeds'] = $data; break;
> case "MAXBEDS" : $GLOBALS['criteria']['maxbeds'] = $data; break;
> case "PROPCOUNT" : $GLOBALS['criteria']['propcount'] = $data; break;
> default: break;
> }

global $currentTag may be:
  not assigned
  not all uppercase
  have a leading or trailing space
  not be one of the 'case' values

$data is empty.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



  1   2   >