php-general Digest 3 Aug 2002 05:13:32 -0000 Issue 1502

Topics (messages 110847 through 110932):

HELP with forms
        110847 by: Dave Leather
        110848 by: Michael Sweeney
        110914 by: Bob Lockie

Re: include hassle
        110849 by: Reuben D. Budiardja

HELP with fOpen
        110850 by: Shane

Re: isset($var) && !empty($var) same time!
        110851 by: Analysis & Solutions

Gracias
        110852 by: Sebastian Tomasino

Thanks Matt
        110853 by: Sebastian Tomasino

Function search utility
        110854 by: Brian V Bonini
        110860 by: Lars Olsson
        110897 by: Brian V Bonini

Re: Need help to choose hosting!
        110855 by: Michael Sweeney

Re: Protect PHP coding
        110856 by: Randy Johnson
        110905 by: Manuel Lemos
        110906 by: Manuel Lemos

fsockopen limits
        110857 by: Ilja Polivanovas

Reading in contents of URL
        110858 by: Mike C

ODBC
        110859 by: Ashley M. Kirchner
        110879 by: Scott Fletcher
        110912 by: Bob Lockie

wonder why php as apache module can work with virtual host
        110861 by: Ryan

Re: value submit button
        110862 by: Ryan

test
        110863 by: Ryan

share librearies from repository
        110864 by: Ricardo Javier Aranibar León

xml/mysql experts
        110865 by: ibi

re:Using PHP to reboot the linux server
        110866 by: Harpreet Kaur
        110868 by: Nick Oostveen

Re: Using PHP to reboot the linux server
        110867 by: Ryan
        110874 by: Scott Fletcher

Vars passed via URL disappearing
        110869 by: Monty
        110871 by: Steve Edberg
        110887 by: Monty
        110904 by: David Freeman

User Authentication Problem.
        110870 by: Tony Harrison

Re: ldap_add() - null values in fields produce an "value #0 invalid per syntax" error 
on ldap server
        110872 by: Stig Venaas

Re: ldap_modify parameters?
        110873 by: Stig Venaas

PHP and MySQL
        110875 by: Erich Kolb
        110878 by: Shane
        110880 by: Monty
        110916 by: Jason Wong

share libraries from repository
        110876 by: Ricardo Javier Aranibar León

Parsing XML into PHP array.
        110877 by: Scott Fletcher
        110900 by: Analysis & Solutions

Email failure????
        110881 by: Scott Fletcher
        110882 by: Shane

Help!!! CVS install broke for me!
        110883 by: Rick Kukiela
        110886 by: R'twick Niceorgaw

PHP4 and MySql - Search Results Question?
        110884 by: Jason Caldwell
        110893 by: Julio Nobrega
        110894 by: Jason Caldwell
        110923 by: Jason Wong

Regular expressions test code
        110885 by: Børge Strand

php backtraces with gdb print gibberish for function name
        110888 by: Joe Morris

server to server post
        110889 by: Purushotham Komaravolu
        110891 by: Purushotham Komaravolu
        110896 by: skeller.healthtvchannel.org

difference
        110890 by: Bob Lockie
        110892 by: Joe Morris

Creating variables...
        110895 by: Ashley M. Kirchner
        110898 by: Bas Jobsen

Need Help with register_globals OFF
        110899 by: Monty
        110921 by: Jason Wong

Re: include()
        110901 by: Chris Knipe
        110915 by: Lord Loh.

FreeType 2 support ?
        110902 by: R'twick Niceorgaw

string questions
        110903 by: webmaster
        110926 by: Jason Wong

mail problems
        110907 by: Bob Lockie
        110928 by: Jason Stechschulte
        110932 by: Manuel Lemos

Question about sessions
        110908 by: Varsha Agarwal
        110917 by: Lord Loh.
        110919 by: Jason Wong

Re: still need help with crash on make
        110909 by: Bob Lockie

Re: Problems with HTML forms and PHP. Please Help !!
        110910 by: Bob Lockie

Reg-Cache problem
        110911 by: SenthilVelavan

variables
        110913 by: Bob Lockie
        110918 by: Jason Wong
        110931 by: Bob Lockie

File Phrasing & Mark-ups
        110920 by: Lord Loh.

Re: question about references
        110922 by: Tom Rogers

My SQL speed.
        110924 by: Lord Loh.
        110925 by: Tyler Longren
        110927 by: Manuel Lemos
        110929 by: Jason Stechschulte

Re: mktime() question
        110930 by: Tom Rogers

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
Is there a way to read a FORM varaiable into PHP variable.  The kicker here
is the form variable is in a framed window.

Example, I have my main page in a 2 part frame (90%/10%).  The bottom 10%
has a form on it called 'fileform' with one text box called filevalue

-- source snippit --
<FORM METHOD=POST NAME="fileform">
  <input type="text" name="filevalue" readonly maxlength=11 size=11>
</FORM>
-- end snippit --

Now inside the 90% window, I have ANOTHER frameset (broken into 3 parts.. a
left menu bar, a bottom instructional bar, and a main window.  I NEED the
main window to grab the value from the 'fileform.filevalue' and return it to
a PHP variable.

Any ideas????
Dave



--- End Message ---
--- Begin Message ---
What do you mean, "return it to a php variable"?

The closest I can come to understanding your question is that you want
the form input in your bottom frame to be sent to another frame in your
top window for submission.

If that's any place close to correct, you need a javascript solution. In
any case, it won't/can't become a "php variable" until it is sent back
to the server. So why not submit the form from your bottom frame with a
target of the frame that you need the variable in and refresh that
frame?

..michael..

On Fri, 2002-08-02 at 10:14, Dave Leather wrote:
> Is there a way to read a FORM varaiable into PHP variable.  The kicker here
> is the form variable is in a framed window.
> 
> Example, I have my main page in a 2 part frame (90%/10%).  The bottom 10%
> has a form on it called 'fileform' with one text box called filevalue
> 
> -- source snippit --
> <FORM METHOD=POST NAME="fileform">
>   <input type="text" name="filevalue" readonly maxlength=11 size=11>
> </FORM>
> -- end snippit --
> 
> Now inside the 90% window, I have ANOTHER frameset (broken into 3 parts.. a
> left menu bar, a bottom instructional bar, and a main window.  I NEED the
> main window to grab the value from the 'fileform.filevalue' and return it to
> a PHP variable.
> 
> Any ideas????
> Dave
> 



--- End Message ---
--- Begin Message ---
On Fri, 2 Aug 2002 12:14:51 -0500, Dave Leather wrote:

>Is there a way to read a FORM varaiable into PHP variable.  The kicker here
>is the form variable is in a framed window.
>
>Example, I have my main page in a 2 part frame (90%/10%).  The bottom 10%
>has a form on it called 'fileform' with one text box called filevalue
>
>-- source snippit --
><FORM METHOD=POST NAME="fileform">
>  <input type="text" name="filevalue" readonly maxlength=11 size=11>
></FORM>
>-- end snippit --
>
>Now inside the 90% window, I have ANOTHER frameset (broken into 3 parts.. a
>left menu bar, a bottom instructional bar, and a main window.  I NEED the
>main window to grab the value from the 'fileform.filevalue' and return it to
>a PHP variable.

You wan to submit the form and display the results in another frame?
What is you FORM action above?
I assume some PHP program.
You have to submit the form, PHP is server side.
You want the results to go to a certain frame window.
I have no idea, maybe the TARGET="frame window name" attribute as part of your FORM.



--- End Message ---
--- Begin Message ---
On Friday 02 August 2002 10:41 am, lallous wrote:
> I mean this:
>
> i have this tree:
>
> ./libs/*.php
> ./user/file1.php
>
> now i'm in ./user/ directory
> i run file1.php
> it includes ../libs/lib1.php which in turn will include helper.php
> (./users/helper.php) <-- will fail!
>
> how can i programmatically set the include path?
>
> Elias
>
- You can use an absolute path. 
- You can also specified all the includes path that will be find by php 
automatically in your php.ini. You might want to specify your /libs directory 
there, if you're including a lot of files from that directory.
Either or both should work

Rdb
--- End Message ---
--- Begin Message ---
No lock in the archives, so here it goes...
Greetings all, I am using fOpen to try and create a new file in a local directory on a 
remote server. Each time I run my script is says "PERMISSION DENIED" but the sys admin 
swears the entire directory is set to 777.

Does anyone know if a setting has to be set in PHP for dynamic file creation to take 
place?
I can use fOpen to read a file, I just cant write without the above error.

Please, any help is appreciated, my deadline is looming.

Thanks
- NorthBayShane
--- End Message ---
--- Begin Message ---
Folks:

On Fri, Aug 02, 2002 at 07:01:38PM +0200, Jürgen wrote:
> 
> Why would i ever want to use isset() then?

Because sometimes you just want to check if something is set due to null, 
'' and 0 being important.

   $var = '';
   empty($var);  // evaluates to true
   isset($var);  // evaluates to true

   unset($var);
   empty($var);  // evaluates to true
   isset($var);  // evaluates to false


> If i understood you correctly, would the following
> 
> op = isset($_GET['op']) && !empty($_GET['op']) ? $_GET['op'] : '';
> 
> be the same as
> 
> op = !empty($_GET['op']) ? $_GET['op'] : '';

Yes.  They do the same thing.  Couple things to think about, though.  If 
$_GET['op'] is 0, those commands will turn it into ''.  Probably not what 
you want.  Also, though less important, if it's already '', there's no 
need to do the step of resetting it to ''.  Sometimes, a cleaner test is:

  $op = isset($_GET['op']) ? $_GET['op'] : '';

--Dan

PS:  Don't be lazy.  Trim unneeded parts of prior postings.

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
Muchas gracias fernando por tu explicacion !!  Con Mas detalle Imposible  !!
todavia no se como es que me llego tu respuesta a mi correo y no aparece 
aca en el news group (soy nuevo usando news) pero igual muchas gracias..

Sebastian.

--- End Message ---
--- Begin Message ---
thank you matt for explain what´s wrong.. short but helpfull !!!

Sebastian

--- End Message ---
--- Begin Message ---
There used to be a utility that let you search php functions from the
address bar in your browser by simply appening PHP to the function name eg,
php mail I thikn it might of been an IE only thing...

I can't remember were I originally got it form and can not find it again,
does anyone know?

-Brian

--- End Message ---
--- Begin Message ---
It still works...try http://www.php.net/mysql or 
http://www.php.net/fopen for example...

/lasso ([EMAIL PROTECTED])



Brian V Bonini wrote:
> There used to be a utility that let you search php functions from the
> address bar in your browser by simply appening PHP to the function name eg,
> php mail I thikn it might of been an IE only thing...
> 
> I can't remember were I originally got it form and can not find it again,
> does anyone know?
> 
> -Brian
> 

--- End Message ---
--- Begin Message ---
Nope, it was this http://www.php.net/tips.php that I was thiking of....
But thanks, I didn't know you could do that.... ;-)

-Brian

> -----Original Message-----
> From: Lars Olsson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 02, 2002 2:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Function search utility
> 
> 
> It still works...try http://www.php.net/mysql or 
> http://www.php.net/fopen for example...
> 
> /lasso ([EMAIL PROTECTED])
> 
> 
> 
> Brian V Bonini wrote:
> > There used to be a utility that let you search php functions from the
> > address bar in your browser by simply appening PHP to the 
> function name eg,
> > php mail I thikn it might of been an IE only thing...
> > 
> > I can't remember were I originally got it form and can not find 
> it again,
> > does anyone know?
> > 
> > -Brian
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
--- End Message ---
--- Begin Message ---
I just moved my domain over to phpwebhosting.com. The transfer went very
smoothly and so far I've been satisfied. The only hitch I can see in
your requirements might be the background processes (bots, what?). But
it's probably worth asking them about. 

..michael..

On Thu, 2002-08-01 at 23:31, Mantas Kriauciunas wrote:
> Hey php-general,
> 
>   i want to buy hosting. but i can't find good one for me. maybe
>   someone could point some links. but this is what i need!
> 
>   Storage up to 100MB
>   normal transfer limit(best would be without)
>   CGI/Perl/PHP/ASP/SSI/SSL
>   MySQL database (can be only 1)
>   some pop3 mailboxes
>   free domain transfer (maybe free domain if i pay for 1 year ahead)
>   FTP access
>   SSH access
>   Shell capability
>   up to 3 background processes
> 
>   if anyone know combination like that i would appreaciate your help!
>   thanks
> 



--- End Message ---
--- Begin Message ---
Does the bcompiler below improve performance?  

make scripts run  faster?

anybody have a testimonials on it's use??


Thanks,

Randy
----- Original Message ----- 
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 9:14 PM
Subject: [PHP] Re: Protect PHP coding


> Hello,
> 
> On 08/01/2002 01:58 PM, Yc Nyon wrote:
> > Is there any method to encrypt PHP files.
> 
> Use bcompiler which is free and is part of PEAR/PECL official PHP 
> extensions repository:
> 
> http://pear.php.net/package-info.php?pacid=95
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

On 08/02/2002 11:06 AM, Lallous wrote:
> So...
> Is this equivalent to Zend Encoder?

Not exactly, but in some aspects it is/will be better like the ability 
to generate executable standalone PHP programs that you can distribute 
independently. There is also the question of the price that for Zend 
Encoder is ridiculously expensive.

Other than that, if you're main concerne is protecting your PHP code, 
you can do very well with bcompiler.


> Elias
> "Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>Hello,
>>
>>On 08/01/2002 01:58 PM, Yc Nyon wrote:
>>
>>>Is there any method to encrypt PHP files.
>>
>>Use bcompiler which is free and is part of PEAR/PECL official PHP
>>extensions repository:
>>
>>http://pear.php.net/package-info.php?pacid=95
>>
>>--
>>
>>Regards,
>>Manuel Lemos
>>
> 
> 
> 



-- 

Regards,
Manuel Lemos

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

On 08/02/2002 02:39 PM, Randy Johnson wrote:
> Does the bcompiler below improve performance?  
> 
> make scripts run  faster?

Definetly YES, because you do not need compile the scripts before each 
execution as they are already executed. Think about the speedup more or 
less like you were using Zend Cache, except that you do not need to pay 
a fortune to use it! :-)

Regards,
Manuel Lemos

> 
> anybody have a testimonials on it's use??
> 
> 
> Thanks,
> 
> Randy
> ----- Original Message ----- 
> From: "Manuel Lemos" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, August 01, 2002 9:14 PM
> Subject: [PHP] Re: Protect PHP coding
> 
> 
> 
>>Hello,
>>
>>On 08/01/2002 01:58 PM, Yc Nyon wrote:
>>
>>>Is there any method to encrypt PHP files.
>>
>>Use bcompiler which is free and is part of PEAR/PECL official PHP 
>>extensions repository:
>>
>>http://pear.php.net/package-info.php?pacid=95
>>
>>-- 
>>
>>Regards,
>>Manuel Lemos
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 
> 



-- 

Regards,
Manuel Lemos

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


1. does any body know how to limit number of attempts to connect to the
remote pc. not by time but for attempts.
(sorry, offtopic ) 2. can anybody explain why sometimes connection attempt
to a closed ports hangs-up remote link, and sometimes not? the remote pc is
the same.


Thanks.


--- End Message ---
--- Begin Message ---
I am trying to create a really simple proxy using PHP.

Basically, i need to:

1. read in the contents of a URL.
2. get the content-type
3. set the content type for the response
4. write the contents of the URL to the response.

here is what i have thus far:

$dataURL = "http://www.foo.com/data.xml";;
$fp = fopen($dataURL, "r");
$content = fread($fp, true);
echo($content);
fclose($fp);

I am running into two problems. One, the second param for fread takes 
the size of the file / content. how do i get this?

there is a comment at:
http://www.php.net/manual/en/function.fread.php

which says to just specify a constant and it will work, but what ever 
number i specify, that is the amount of data that is read.

how do i retrieve the content type?

thanks for any help...

mike c

[EMAIL PROTECTED]

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

    Can PHP be used on an Apache server (linux) to connect to a (remote) MS
Access server (NT) through ODBC?  If so, does anyone have examples of how this
is done?  And if not, what other choices do I have?

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.



--- End Message ---
--- Begin Message ---
Yes!  Unfortunately, you'll have to install the special driver on the
Linux/Unix becuase of the communication difference between UNIX & Windows as
well as the language difference between these two.  I tried using iODBC and
openLINK.  After 1 1/2 years, I decided that open source code for this is no
good because they are not compactable and it is such a big, big pain in the
butt!!!  So, I ended up moving the website on UNIX to windows.  Why, because
of the way the data type is being coverted between 2 platform and character
length or type is strictly limited.  I have not tried to buy such a $600 or
$800 driver software to see how well it does because it is a waste of money
and MS kept changing the programming in the MS Access and MS SQL making the
drivers useless.

"Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>     Can PHP be used on an Apache server (linux) to connect to a (remote)
MS
> Access server (NT) through ODBC?  If so, does anyone have examples of how
this
> is done?  And if not, what other choices do I have?
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
>   +--------------------------------------------------------------------
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
>   http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
>
>
>


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

>    Can PHP be used on an Apache server (linux) to connect to a (remote) MS
>Access server (NT) through ODBC?

Yes.


> If so, does anyone have examples of how this
>is done?

Nope, never done it.
It'll use the same PHP database commands probably.
Read www.php.net



--- End Message ---
--- Begin Message ---
I dunno why some webhosting company can do virtual host by php as apache
module. That means they seem to work fine with the virtual host uid/gid
permission when using php. But they use php as apache module....how do
to that ??

Thx all !!

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

Florian SchäFer wrote:
> Hallo out there,
> 
> i hava an document, with one form and two Submit buttons.
> How can i check in the target document wich button is pressed?
> tried something like   if ($submit == 'xxx') .
> anyone has a hint?
> 
> 

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

--- End Message ---
--- Begin Message ---
Hi List,
I need your help.
I wrote my classes with php where I defined my objects, then I created my 
repository in  /usr/share/php , in this directory are my clasess.
Now, from my directory web I like to call to my classes, then I modified my 
php.ini (/etc/php.ini) and inserted this line, in the option "Paths and 
Directories"
       include_path = ".:/usr/share/php"
and restart apache.
In my page index.php I call to my class with this form
       <?
           include ("plantilla.class")
       ?>
But when I like to see my page I have two message:
1) Warning: Failed opening 'plantilla.class' for inclusion 
(include_path='.:/usr/share/php')in /usr/local/httpd/htdocs/index.php on 
line 2

2)Fatal error: Cannot instantiate non-existent class: pagina in
/usr/local/httpd/htdocs/index.php on line 3

If somebody can help me I'll tahnkfull, my box linux is SuSE 7.3, PHP 4.04 
and Apache.

_________________________________________________________________
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
Looking for people who understand the xml/php/mysql/.
Has anyone seen an xml/php application with mysql.   If you have
please send me the link.  thanks.   For those wanting to try an xml
server,
this is the place ixiasoft.    http://www.ixiasoft.com/?from=textmldemo

--- End Message ---
--- Begin Message ---
I am using the below command in the php page to reboot the linux server. But 
nothing happens . Where am i wrong or do i have to give a path or nething . 
Please help.


$output = shell_exec(`reboot`);
echo $output;



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---
Does the user apache is running as have access to reboot the server?

At 07:18 PM 8/2/2002 +0000, you wrote:
>I am using the below command in the php page to reboot the linux server. 
>But nothing happens . Where am i wrong or do i have to give a path or 
>nething . Please help.
>
>
>$output = shell_exec(`reboot`);
>echo $output;
>
>
>
>_________________________________________________________________
>Join the world's largest e-mail service with MSN Hotmail. 
>http://www.hotmail.com
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Is it `reboot -n` ??

Harpreet Kaur wrote:
> I am using the below command in the php page to reboot the linux server. 
> But nothing happens . Where am i wrong or do i have to give a path or 
> nething . Please help.
> 
> 
> $output = shell_exec(`reboot`);
> echo $output;
> 
> 
> 
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
> 

--- End Message ---
--- Begin Message ---
First thing first!  Open up the terminal and log in.  Then type the command,
if the machine doesn't reboot or if you got an error message, it meant the
command is not correct.  Once you get the correct command then use it in
PHP.  It's much simplier that way.  If PHP can't reboot the machine then it
mean many things, like no authority to do it or path statement, shell, etc.

For linux, it use "shutdown -r now"
For some UNIX, it use "shutdown -Fr" or "shutdown -r", etc.

"Ryan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is it `reboot -n` ??
>
> Harpreet Kaur wrote:
> > I am using the below command in the php page to reboot the linux server.
> > But nothing happens . Where am i wrong or do i have to give a path or
> > nething . Please help.
> >
> >
> > $output = shell_exec(`reboot`);
> > echo $output;
> >
> >
> >
> > _________________________________________________________________
> > Join the world's largest e-mail service with MSN Hotmail.
> > http://www.hotmail.com
> >
>


--- End Message ---
--- Begin Message ---
I just upgraded to PHP 4.2.2 and am trying to make my sites work with
register_globals turned OFF. I notice, however, that with register_globals
turned off any variables I pass via the URL don't seem to be recognized by
the script it was passed to.

So, if I pass "http://my.site.com/page.php?id=2002";, the variable "id" is
empty when I try to access it in page.php ...

if (!empty($id)) { do stuff...}
else { echo "error"; }

With register_globals OFF, the above produces the error message. With
register_globals ON, it works fine.

I thought register_globals only affected session, cookie and get type
variables? Why is PHP ignoring the variables passed via the URL?

Thanks. 

Monty

--- End Message ---
--- Begin Message ---
At 3:29 PM -0400 8/2/02, Monty wrote:
>I just upgraded to PHP 4.2.2 and am trying to make my sites work with
>register_globals turned OFF. I notice, however, that with register_globals
>turned off any variables I pass via the URL don't seem to be recognized by
>the script it was passed to.
>
>So, if I pass "http://my.site.com/page.php?id=2002";, the variable "id" is
>empty when I try to access it in page.php ...
>
>if (!empty($id)) { do stuff...}
>else { echo "error"; }
>
>With register_globals OFF, the above produces the error message. With
>register_globals ON, it works fine.
>
>I thought register_globals only affected session, cookie and get type
>variables? Why is PHP ignoring the variables passed via the URL?


'variables passed via the URL' = 'GET variables'

        -steve


-- 
+------------------------------------------------------------------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| The end to politics as usual:                                          |
|                 The Monster Raving Loony Party (http://www.omrlp.com/) |
+------------------------------------------------------------------------+
--- End Message ---
--- Begin Message ---
Thanks, Steve.  So, does this mean I now have to re-declare all vars passed
via the URL or a form POST in every script that uses them? Or is there a
quicker, easier way to make use of these vars with register_globals off in a
script?

Thanks!


> From: [EMAIL PROTECTED] (Steve Edberg)
> Newsgroups: php.general
> Date: Fri, 2 Aug 2002 12:45:41 -0700
> To: Monty <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: [PHP] Vars passed via URL disappearing
> 
> 'variables passed via the URL' = 'GET variables'
> 
> -steve
> 

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

 > I just upgraded to PHP 4.2.2 and am trying to make my sites work with
 > register_globals turned OFF. I notice, however, that with 
 > register_globals turned off any variables I pass via the URL don't
seem to be 
 > recognized by the script it was passed to.

 > I thought register_globals only affected session, cookie and get type
 > variables? Why is PHP ignoring the variables passed via the URL?

Variables passed via the URL are GET variables.  In v4.2.2 you can use
$_GET['variable_name'] to access them.

CYA, Dave



--- End Message ---
--- Begin Message ---
Hi, I need to authenticate users on an included page on my website, but the
problem is, I cant get it to work.
view it included at http://members.lycos.co.uk/ajohnh/ (Source at
http://members.lycos.co.uk/ajohnh/source/index.txt)
the actual file:
http://members.lycos.co.uk/ajohnh/templates/twoShea/head.php (source at
http://members.lycos.co.uk/ajohnh/source/head.txt)
the location of the script that sets the cookie (I hard-coded the user and
password combo for user ramonezrule into it):
http://members.lycos.co.uk/ajohnh/templates/twoShea/setcookie.php (source
at: http://members.lycos.co.uk/ajohnh/source/setcookie.txt)


--- End Message ---
--- Begin Message ---
On Thu, Jul 18, 2002 at 08:17:59PM -0500, Richard Lynch wrote:
> #0 is basically just LDAP's way to represent NULL, most likely.
> 
> >    $info["mail"]="";  // <----- NULL VALUE HERE
> >    // The following lines also produce the same result.......
> >    //$info["mail"]=NULL;  // <------- NULL value here
> >    //$info["mail"]="\0";  // <------- NULL value here
> >    //$info["mail"];       // <------- NULL value here
> 
> Whoa!
> 
> Never mind.
> 
> Something is very broken in the LDAP stuff if '' and NULL from PHP are being
> turned into NULL in LDAP, and then LDAP complains about it...

Nah... "" and NULL (and I suppose "\0") are all being changed to the
string "" before PHP attempts to add it. What I think the LDAP server
tries to say, is that the syntax doesn't accept an empty string as
value. I tried to create an LDIF file containing an attribute with no
value, like this:

dn: cn=stig,o=photos,dc=venaas,dc=no
objectClass: photo
cn: stig
description:

and I got exactly the same error from ldap_add(1). So this is in my
opinion an LDAP issue and not a PHP issue. OpenLDAP 2 has more
proper schema checking. Perhaps you could try to turn off schema
checking? Or I guess in theory the syntax for the relevant attribute
could be made more relaxed. You could try to ask about this on the
openldap-software list if you need more LDAP help.

Stig
--- End Message ---
--- Begin Message ---
On Thu, Aug 01, 2002 at 09:52:12AM -0400, Chad Day wrote:
> Also tried that, no success, unless I am missing something.
> 
> ...
>               $info["st"]="stchanged!";
> ...
> 
>               ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
> 
> Fatal error: LDAP: Unknown Attribute in the data in
> /usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

The problem is that $info contains not just the LDAP data, but also
a list of attributes, like say $info[2] == "st". I wish that were
never put in there, but we have to live with it now. You either have
to create a new array with exactly you want in the entry (or I guess
remove these extra values, use var_dump($info) and you should see
what I'm talking of), or instead use ldap_mod_replace() using say

$mods["st"] = "stchamged";
ldap_mod_replace($ds, 'uid=testing,cn=online-leagues.com', $mods);

Stig
--- End Message ---
--- Begin Message ---
Is there any way to speed up MySQL queries?


--- End Message ---
--- Begin Message ---
-----Original Message-----
here any way to speed up MySQL queries?
--------------------------
Sure, ask for only the data you need. or halt your query when you have what you need.

HTH
--- End Message ---
--- Begin Message ---
Indexes

Putting strings in single quotes instead of double (WHERE id = 'something')

Normalized database design.

- Monty

> From: [EMAIL PROTECTED] (Erich Kolb)
> Organization: R&B Receivables Management, Inc.
> Reply-To: "Erich Kolb" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Date: Fri, 2 Aug 2002 15:13:24 -0500
> To: [EMAIL PROTECTED]
> Subject: PHP and MySQL
> 
> Is there any way to speed up MySQL queries?
> 
> 

--- End Message ---
--- Begin Message ---
On Saturday 03 August 2002 04:13, Erich Kolb wrote:
> Is there any way to speed up MySQL queries?

1) Use a faster computer
2) Read the mysql manual
3) Ask on the mysql list
4) Ask google

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I left my WALLET in the BATHROOM!!
*/

--- End Message ---
--- Begin Message ---
Hi List,
I need your help.
I wrote my classes with php where I defined my objects, then I created my 
repository in  /usr/share/php , in this
directory are my clasess.
Now, from my directory web I like to call to my classes, then I modified my 
php.ini (/etc/php.ini) and inserted
this line, in the option "Paths and Directories"
       include_path = ".:/usr/share/php"
and restart apache.
In my page index.php I call to my class with this form
       <?
           include ("plantilla.class")
       ?>
But when I like to see my page I have two message:
1) Warning: Failed opening 'plantilla.class' for inclusion 
(include_path='.:/usr/share/php')in
/usr/local/httpd/htdocs/index.php on line 2

2)Fatal error: Cannot instantiate non-existent class: pagina in
/usr/local/httpd/htdocs/index.php on line 3

If somebody can help me I'll tahnkfull, my box linux is SuSE 7.3, PHP 4.04 
and Apache.



_________________________________________________________________
Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
I'm having trouble getting the XML string to be broken up into the PHP
array.  Here's how it work.  I send the XML request in a string to the
credit bureau through cURL and vice versa.  Most of the PHP scripting I
found everywhere spoke about breaking up the xml tag into the array only
when they come from the file and is use for parsing.  Problem here is it is
illegal to store the credit inquiry information to a file on the server
except temporary storing it in the RAM but then it will have to be destroyed
when it is done.  I don't need to parse it, just want to use the tag name as
the name in the array with the data from the tag as data to that array name.
What is the work around for this??

Thanks,
 FletchSOD


--- End Message ---
--- Begin Message ---
> I send the XML request in a string to the
> credit bureau through cURL and vice versa.  Most of the PHP scripting I
> found everywhere spoke about breaking up the xml tag into the array only
> when they come from the file and is use for parsing.

The example on my page you looked at does get the stuff from a file, BUT,
it takes that content and puts it into a string.  All the xml_parse()
function needs is the string.  So, just feed it the string you get back
from the agency.

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
What give??  I post the command and replied to some other posting.  It made
it through and was posted without a problem!  I kept getting the email from
PHP server saying "
Sorry. Your message could not be delivered to:

brian-phplist,emc (The name was not found at the remote site. Check that

the name has been entered correctly.)"   This for every other users??????



--- End Message ---
--- Begin Message ---
Yes Scott, I get that too. But hey, it's friday!
--- End Message ---
--- Begin Message ---
ok, i do a make and it makes fine but when the make install i get an
infinite loop of this error:

Warning: mkdir(): File exists in /usr/local/src/php4/pear/System.php on line
235

I went to the code and i tried putting a line that says this:

if(file_exists("$newdir")) { $ret = exec("/bin/rm -rf $newdir"); }

I put that right above the line thats erroring in the while loop. It fixed
the problem with that but then when it gets to XML_RPC the CPU usage goes up
to 100% and will not output any errors or anything. It looks  like its
caught in a loop....

anyway, anyone have any ideas??

my systems is FreeBSD 4.6
apache 1.3.26
libtool 1.4
autoconf 2.53
automake 1.5

configure line:
./configure --with-imap=/usr/local --with-xml --with-mysql --enable-track-va
rs --with-mm=/usr/local --with-gettext --with-mcrypt=/usr/local --enable-ftp
 --enable-sockets --with-apache=../apache_1.3.26




--- End Message ---
--- Begin Message ---
I also got exactly the same errors this morning. Thought may be its
because I'm using a beta version of RedHat Linux (Limbo).

-----Original Message-----
From: Rick Kukiela [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 02, 2002 4:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help!!! CVS install broke for me!

ok, i do a make and it makes fine but when the make install i get an
infinite loop of this error:

Warning: mkdir(): File exists in /usr/local/src/php4/pear/System.php on
line
235

I went to the code and i tried putting a line that says this:

if(file_exists("$newdir")) { $ret = exec("/bin/rm -rf $newdir"); }

I put that right above the line thats erroring in the while loop. It
fixed
the problem with that but then when it gets to XML_RPC the CPU usage
goes up
to 100% and will not output any errors or anything. It looks  like its
caught in a loop....

anyway, anyone have any ideas??

my systems is FreeBSD 4.6
apache 1.3.26
libtool 1.4
autoconf 2.53
automake 1.5

configure line:
./configure --with-imap=/usr/local --with-xml --with-mysql
--enable-track-va
rs --with-mm=/usr/local --with-gettext --with-mcrypt=/usr/local
--enable-ftp
 --enable-sockets --with-apache=../apache_1.3.26





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




--- End Message ---
--- Begin Message ---
I'm using PHP4 and MySQL --

I'm trying to write a small search engine -- got it working, however, what
I'd like to do is return the TOTAL records found.

You see, right now I am using LIMIT within my SQL -- so I only return 15
results at a time.

How do I get the total (say for example there are 2000 records) -- do I need
to COUNT(*) first, then perform another SELECT query for my search?

Or, is there a PHP/MYSQL command that returns the total records matching my
SELECT query irregardless of the LIMIT ??

Thanks
Jason


--- End Message ---
--- Begin Message ---
  You could select everything, count the results, and just show 15 results.

  I am not sure that a COUNT() with LIMIT will perform the desired effect.

--
Julio Nobrega
Pode acessar:
http://www.inerciasensorial.com.br


"Jason Caldwell" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm using PHP4 and MySQL --
>
> I'm trying to write a small search engine -- got it working, however, what
> I'd like to do is return the TOTAL records found.
>
> You see, right now I am using LIMIT within my SQL -- so I only return 15
> results at a time.
>
> How do I get the total (say for example there are 2000 records) -- do I
need
> to COUNT(*) first, then perform another SELECT query for my search?
>
> Or, is there a PHP/MYSQL command that returns the total records matching
my
> SELECT query irregardless of the LIMIT ??
>
> Thanks
> Jason
>
>


--- End Message ---
--- Begin Message ---
You cannot have COUNT(*) without having GROUP BY -- hence, by search query
will not produce the desired results -- I'm thinking that there may be
something within PHP or MySQL (a Function) that reports the total found for
a query whether or not a LIMIT clause is used?

Thanks


"Julio Nobrega" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>   You could select everything, count the results, and just show 15
results.
>
>   I am not sure that a COUNT() with LIMIT will perform the desired effect.
>
> --
> Julio Nobrega
> Pode acessar:
> http://www.inerciasensorial.com.br
>
>
> "Jason Caldwell" <[EMAIL PROTECTED]> escreveu na mensagem
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'm using PHP4 and MySQL --
> >
> > I'm trying to write a small search engine -- got it working, however,
what
> > I'd like to do is return the TOTAL records found.
> >
> > You see, right now I am using LIMIT within my SQL -- so I only return 15
> > results at a time.
> >
> > How do I get the total (say for example there are 2000 records) -- do I
> need
> > to COUNT(*) first, then perform another SELECT query for my search?
> >
> > Or, is there a PHP/MYSQL command that returns the total records matching
> my
> > SELECT query irregardless of the LIMIT ??
> >
> > Thanks
> > Jason
> >
> >
>
>


--- End Message ---
--- Begin Message ---
On Saturday 03 August 2002 07:01, Jason Caldwell wrote:
> You cannot have COUNT(*) without having GROUP BY -- hence, by search query

Not sure what you mean -- SELECT COUNT(*) FROM table; -- works fine.

> will not produce the desired results -- I'm thinking that there may be
> something within PHP or MySQL (a Function) that reports the total found for
> a query whether or not a LIMIT clause is used?

You need 2 queries. 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
An optimist believes we live in the best world possible; 
a pessimist fears this is true.
*/

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

I'm starting work on regular expressions in PHP these days. Just
thought I'd share my test code for others out there who are fresh
starters with the language and regular expressions.


file parser.php:
<?php
    // copyright Børge Strand
    // use this code as you feel like!

    print "<html>\n";
    print "<head>\n";
    print "<title>Testing regular expressions</title>\n";
    print "</head>\n";
    print "<body>\n";

    $string = $_REQUEST['string'];
    $pattern = $_REQUEST['pattern'];

    print '<form action="parser.php" method="POST">' . "\n";
    print 'STRING:<input name="string" value="' . $string . '" size="10"><br><br>' . 
"\n";
    print 'PATTERN:<input name="pattern" value="' . $pattern . '" size="10"><br><br>' 
. "\n";
    print '<input type="submit" value="OK"><br><br>' . "\n";
    print '</form>' . "\n";
    print 'preg_match("' . $pattern . '","' . $string . '") says: <br>' . "\n";

//    $pattern = "/^[a-z\-0-9]+_[a-z\-0-9]+_[0-9]+$/"; // example pattern
    if (preg_match($pattern, $string))
        print 'YES';
    else
        print 'NO';

    print "</body>\n";
    print "</html>\n"

?>


--
Børge
--- End Message ---
--- Begin Message ---
I have have a PHP script that is core dumping, I'm trying to find out
exactly where.  I carefully followed the instructions on

http://bugs.php.net/bugs-generating-backtrace.php

with a little help in creating an apache debug build using:

http://www.bowiesnyder.com/writings/gdb_apache.htm

however, when I get to the end bit where it's supposed to print out the
function that was causing the seg fault (I've already typed "frame x"
where x is the lowest-numbered execute() call), I get crap:

(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$2 = 0x83a2be0 "´\221/\b\024àJ\bÜï[\b´ì0\b"

where it should say, according to the bugs.php.net page above, something
like:

(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$14 = 0x80fa6fa "pg_result_error"

I can't find any docs anywhere on what else I can ask executor_globals
for... getting executor_globals.active_op_array->function_name returns
one of my functions, but that's not terribly useful without knowing what
line of it caused the segfault.

Any suggestions for futher probing?

joe

--- End Message ---
--- Begin Message ---
Hi all,
        I am new to php, can anybody pls help me out with my query?
 How to do a server to server post in php, without client knowing about it.
Thanks
Puru
--- End Message ---
--- Begin Message ---


Hi all,
        I am new to php, can anybody pls help me out with my query?
 How to do a server to server post in php, without client knowing about it.
Thanks
Puru
--- End Message ---
--- Begin Message ---
>         I am new to php, can anybody pls help me out with my query?
>  How to do a server to server post in php, without client
> knowing about it.

There's a function called Post2Host. Look in the archives of this newsletter
or in Google Groups and you'll find the code for it.

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

What is the difference from using $_GET['some_var'] from using $_REQUEST['some_var']?
I think the documentation says either can be used to do the same thing.

What is the performance difference from having register_globals turned off from having 
it turned on?
I assume the default was changed for performance reasons?



--- End Message ---
--- Begin Message ---
It was changed for security reasons:

http://www.php.net/release_4_1_0.php

joe

Bob Lockie wrote:

> What is the difference from using $_GET['some_var'] from using $_REQUEST['some_var']?
> I think the documentation says either can be used to do the same thing.
>
> What is the performance difference from having register_globals turned off from 
>having it turned on?
> I assume the default was changed for performance reasons?

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

    I don't know what else to title this message with, hence the subject.

    I have a script that defines a few variables like this:

    $var_list1 = Array(...);
    $var_list2 = Array(...);
    $var_list3 = Array(...);
    etc.

    Further down the script I have this piece:

    while (list($key,$value) = each($var_list)) {   // which $var_list?
      if ($$value == '') {
        $url .= "&".$value."=";
        $error = 1;
      } else {
        $url .= "&".$value."=". urlencode(stripslashes($$value)) ."";
      }
    }


    That same script also gets a value ($step) from another one.  Now I need to
figure out which $var_list# to use based on this $step value.  Any suggestion
on how to do this?



--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.



--- End Message ---
--- Begin Message ---
>     That same script also gets a value ($step) from another one.  Now I
> need to figure out which $var_list# to use based on this $step value.  Any
> suggestion on how to do this?
${'var_list'.$step}
--- End Message ---
--- Begin Message ---
I'm trying to use the more secure "register_globals=Off" setting for some
simple scripts that do authentication and use sessions. But I'm ready to rip
all my hair out!

Can someone recommend a good article online that clearly discusses what's
different when you have register_globals=Off? I've spent hours looking
through the PHP site but I'm just as confused as I was before I started. I
thought this setting only affected global variables, but, there are all
kinds of things not working properly, like the header() function. It just
won't work at all with register_globals=Off, but works just fine when I
switch it back on! 

Thanks.

--- End Message ---
--- Begin Message ---
On Saturday 03 August 2002 07:37, Monty wrote:
> I'm trying to use the more secure "register_globals=Off" setting for some
> simple scripts that do authentication and use sessions. But I'm ready to
> rip all my hair out!

Look at the chapter "Session handling functions". The setting of 
register_globals affects the using of sessions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
panic: kernel segmentation violation. core dumped               (only kidding)
*/

--- End Message ---
--- Begin Message ---
> If you run your own server, you can set it up so that each webmaster is
> locked into a private environment, but it's messy.  According to me, you
> would need a separate copy of apache for each site, each running under a
> different user, and they would need to run on separate ports, which is a
> nuisance.

It's called SuEXEC in Apache and compiled in the core of Apache, it's not a
module.

What it does, it allows Apache to use the Group and User directives inside
virtual hosts.

For example:

<VirtualHost whatever>
  DocumentRoot /blah
  User cust001
  Group cust001
</VirutalHost>

In this case, all files in /blah would be owned by cust001:cust001 and
permissions as strict as 0600 can be given on the files in the directory.
Apache's processes serving requests on this virutal host, will drop
permissions to user and group cust001 as specified in the configuration, so
apache would have access to read it.

In other virtualhosts, either the default user / group is used, or they are
specified uniquely in a per-virtualhost basis.  The other virtual hosts will
thus run with different uid/gid meaning that other virtualhosts will not be
able to include code in other virtualhosts, even when they know the paths.

Because Apache drop permissions to the user/group specified, they will not
have access to read/write/execute the included filename in a different
virtualhost.

--
me


--- End Message ---
--- Begin Message ---
How ever can ant of the apache restrictions stop any one from including the
script by giving the whole path.

ie /home/htdocs/include.inc or /home/abc/include.inc

Yes or No ?
I use win 2000 so it is not possible for me to experiment! but I have
hostings on servers like www.f2s.net and a project on www.sourceforge.net

If you are familiar with these systems, what do you comment?

Lord Loh.


--- End Message ---
--- Begin Message ---
Hi all,
I'm getting this error while running a simple script.

Warning: imageftbbox(): No FreeType 2 support in this PHP build in
/home/www/htdocs/button_create.php on line 11

Here's my phpinfo https://utkalika.yi.org/phpinfo.php (note the https)

While compiling PHP, It says freetype(2) support yes. FreeType 1.x no

What might be the problem ?

R'twick





--- End Message ---
--- Begin Message ---
I know there has to be an easy way to do this, but I just can't find the
answer.  I need to strip out the first part of a text string.  I've
figured out out to strip out the last part of a string using the
following:

$address = (4455 N. 45th St.);

$test = strstr($address, " ");
echo $test;

The variable $test returns N. 45th St. without the 4455.  Is there a way
to reverse this so I can just return 4455?

Thanks,
-Elkan

--- End Message ---
--- Begin Message ---
On Saturday 03 August 2002 00:35, webmaster wrote:
> I know there has to be an easy way to do this, but I just can't find the
> answer.  I need to strip out the first part of a text string.  I've
> figured out out to strip out the last part of a string using the
> following:
>
> $address = (4455 N. 45th St.);
>
> $test = strstr($address, " ");
> echo $test;
>
> The variable $test returns N. 45th St. without the 4455.  Is there a way
> to reverse this so I can just return 4455?

Use strpos() to find the position of the first space then substr() to extract 
from beginning to the space.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The San Diego Freeway.  Official Parking Lot of the 1984 Olympics!
*/

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

I can't get mail to work on my system.
It always tries to send mail as the user 'nobody' which my Apache 1.3.26 runs as.
phpinfo() reports I have the correct path to the php.ini file which specifies it is 
supposed
to send as the user 'bob'.
I have sendmail 8.12.5 and PHP 4.2.2 on the same RedHat Linux machine?



--- End Message ---
--- Begin Message ---
On Fri, Aug 02, 2002 at 09:34:20PM -0400, Bob Lockie wrote:
> I can't get mail to work on my system.
> It always tries to send mail as the user 'nobody' which my Apache 1.3.26 runs as.
> phpinfo() reports I have the correct path to the php.ini file which specifies it is 
>supposed
> to send as the user 'bob'.
> I have sendmail 8.12.5 and PHP 4.2.2 on the same RedHat Linux machine?

I'm not sure how sendmail works, but I think exim has a setting that you
have to set so it will allow you to send email as a different user.
Maybe there is something like that you need to set for sendmail also.

-- 
Jason Stechschulte
[EMAIL PROTECTED]
http://www.ypisco.com
--
Do you think that illiterate people get the full effect of alphabet soup?
--- End Message ---
--- Begin Message ---
Hello,

On 08/02/2002 10:34 PM, Bob Lockie wrote:
> I can't get mail to work on my system.
> It always tries to send mail as the user 'nobody' which my Apache 1.3.26 runs as.
> phpinfo() reports I have the correct path to the php.ini file which specifies it is 
>supposed
> to send as the user 'bob'.
> I have sendmail 8.12.5 and PHP 4.2.2 on the same RedHat Linux machine?

Use mail() 5th argument like this "[EMAIL PROTECTED]",


-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
Hi,
I am creating a session for user autentication. As I
read from the help there are two ways for passing
session IDs
-Cookies
-URL parameter.

By default its passing it through cookies. I don't
want to use any cookies in my program. Can anyone tell
me how to go for the other way? i.e. through URL
parameter??
Thanks,
Varsha

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--- End Message ---
--- Begin Message ---
>From the php docs(XC. Session handling functions)
======================================
<?php
session_register ("count");
$count++;
?>

Hello visitor, you have seen this page <?php echo $count; ?> times.<p>;

<?php
# the <?=SID?> is necessary to preserve the session id
# in the case that the user has disabled cookies
?>

To continue, <A HREF="nextpage.php?<?=SID?>">click here</A>
===============================================



--- End Message ---
--- Begin Message ---
On Saturday 03 August 2002 10:19, Varsha Agarwal wrote:
> Hi,
> I am creating a session for user autentication. As I
> read from the help there are two ways for passing
> session IDs
> -Cookies
> -URL parameter.
>
> By default its passing it through cookies. I don't
> want to use any cookies in my program. Can anyone tell
> me how to go for the other way? i.e. through URL
> parameter??

Look in php.ini and set "session.use_cookies" to 0.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
sticktion
*/

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

>Yes, there are many users they recommend to use apache 1.3.26 and php 4.2.2 !
>What useful of CVS ?

Apache2 is not supported yet.
The latest version from CVS (Concurrent Version System) might work.
If you don't have CVS then use Apache 1. :-)

>Bob Lockie wrote:
>
>> >Thanks, Tyler, I will if I have to, but is there someone out there who has
>> >done this on Linux?
>>
>> There are a bunch of people (I use 1.3.26) because Apache 2 support is experimental.
>> Grab the latest source of Apache from CVS and it should work.



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

Is register_globals off in your php.ini?
Try $var = $_REQUEST['var'];

>Hi! i have instaled PHP 4.2.2 in a slack 8.1 running apache 2.0.39.
>i have a proble with a very basic script (pass variables to a php
>script). Is seems not recieve variables, because print somthing like this:
>
>Your first name is .
>Your last name is .
>Your E-mail address is .
>This is what you had to say:
>
>In the server log say the variables appear don´t exist.
>Here i send this windows files (i try in XP with iis 5.1 and PJP 4.2.2 
>and is the same problem) to help you to help me :)
>ah! php is working because i test the <? phpinfo(); ?> stuff and works !!!
>
>Tanks
>
>



--- End Message ---
--- Begin Message ---
Hello All,
        I have the following lines in my program to disable the caching with the 
client.    

<?
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// always modified
header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

But still the clients cache my pages.Installed versions in my server is PHP 4.2.2 and 
Apache 2.0.39.
Is there any other way to go.
Any help is appreciated.

Advance thanks and regards,
Senthil.
--- End Message ---
--- Begin Message ---
What is the difference from using $_GET['some_var'] from using $_REQUEST['some_var']?
I think the documentation says either can be used to do the same thing.



--- End Message ---
--- Begin Message ---
On Saturday 03 August 2002 10:43, Bob Lockie wrote:
> What is the difference from using $_GET['some_var'] from using
> $_REQUEST['some_var']? I think the documentation says either can be used to
> do the same thing.

$_REQUEST holds everything from $_GET, $_POST, and $_COOKIE combined, thus you 
cannot differentiate where the value came from.

If you want to be sure, be specific and use one of $_GET/$_POST/$_COOKIE.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Mark's Dental-Chair Discovery:
        Dentists are incapable of asking questions that require a
        simple yes or no answer.
*/

--- End Message ---
--- Begin Message ---
On Sat, 3 Aug 2002 12:19:15 +0800, Jason Wong wrote:

>On Saturday 03 August 2002 10:43, Bob Lockie wrote:
>> What is the difference from using $_GET['some_var'] from using
>> $_REQUEST['some_var']? I think the documentation says either can be used to
>> do the same thing.
>
>$_REQUEST holds everything from $_GET, $_POST, and $_COOKIE combined, thus you 
>cannot differentiate where the value came from.
>
>If you want to be sure, be specific and use one of $_GET/$_POST/$_COOKIE.

There is no reason other than knowing where it came from to choose one method over the 
other?
For *most* applications it would seem that using REQUEST is better planning.




--- End Message ---
--- Begin Message ---
A function I have written to accept filenames, read it and phrase it's mark
ups. Is the second function of one line file a good idea ? Is there an
alternative ? Can problems arise if the size of the file being phrased is
very large ?
==================================
<?php
//Phrases Files. Acknoledges certains special mark-ups if present.
function phrase($file)
{
    $output=onelinefile($file);
    $output=str_replace("[TITLE]",": ".$GLOBALS["title"],$output);
    $output=str_replace("[LOGO]",onelinefile("_logos"),$output);
    $output=str_replace("[COPYRIGHT]","Copyright (C) 2002
Findmaan.",$output);
    return $output;
}

//reads a file and returns a variable with the entire file in one line.
function onelinefile($file)
{
    $fa=file($file);
    $i=0;
    do
    {
        $output=$output.$fa[$i];
        $i++;
    }while($i<count($fa));
    return $output;
}
?>
=========================


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

Friday, August 2, 2002, 11:29:39 PM, you wrote:
JV> Tried to post this to the news group before, but I'm having trouble getting
JV> to my news server from work - hopefully I'm not posting a duplicate.


JV> I think I'm seeing the problem I'm seeing because I'm getting a copy of a
JV> var instead of a reference to it, but I'm not sure the best we to get around
JV> this problem.

JV> In my little sample script, I've got an array of objects.  When I use
JV> foreach to loop through the array and make a change to an item, it doesn't
JV> change the object in the array, just the var that I have while I'm in the
JV> foreach loop.

JV> What's the right way to loop through this array if I really want to change
JV> homer's name to marge in this example?  The way it is now, I see my echo
JV> saying that I'm changing the name, but when I do the second var_dump, it's
JV> the same as the first var_dump.

JV> Thanks in advance,
JV>    Jesse

JV> <?php

JV>     class Name {
JV>         var $firstName;
JV>         var $lastName;

JV>         function Name($first, $last) {
JV>             $this->firstName = $first;
JV>             $this->lastName = $last;
JV>         }
JV>     }

JV>     $names[] = new Name("joe", "shmo");
JV>     $names[] = new Name("billy", "bob");
JV>     $names[] = new Name("homer", "simpson");

?>>

JV> <html>
JV>     <body>
JV>         <?php echo var_dump($names) ?>
JV>         <br>
JV>         <?php
JV>             foreach ($names as $name) {
JV>                 if (strcmp($name->firstName, "homer") == 0) {
JV>                     echo "changing homer to marge<br>";
JV>                     $name->firstName = "marge";
JV>                     break;
JV>                 }
JV>             }
JV>         ?>
JV>         <?php echo var_dump($names) ?>

JV>         <br>
JV>     </body>
JV> </html>

This should work:

foreach ($names as $key=>$val) {
        if (strcmp($val->firstName, "homer") == 0) {
                echo "changing homer to marge<br>";
                $names[$key]->firstName = "marge";
                break;
        }
}

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
I have a database of mysql with 3 million records. No query is performed in
less than 10 seconds!(With Index and all that)

Any way to speed this up ?

How on earth does US Social Security dept. maintain so many records ?
Google has 1 billion pages and qurys in a few milliseconds...

I am not saying that they are using MySQL!

Should this be asked in a mysql list ? Please suggest a NNTP server!

Lord Loh.


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

> Should this be asked in a mysql list ? Please suggest a NNTP server!

You could always take this to the mysql mailing list
[EMAIL PROTECTED]

tyler

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

On 08/03/2002 01:36 AM, Lord Loh. wrote:
> I have a database of mysql with 3 million records. No query is performed in
> less than 10 seconds!(With Index and all that)

The index will not do magic by itself, especially if it is not unique.



> Any way to speed this up ?

Sometimes your queries need to be rewritten


> How on earth does US Social Security dept. maintain so many records ?

Most likely they use Oracle or something as sophisticated that among 
other things can do table partitioning.


> Google has 1 billion pages and qurys in a few milliseconds...

Real search engines do not use SQL databases.



> I am not saying that they are using MySQL!
> 
> Should this be asked in a mysql list ? Please suggest a NNTP server!

Yes, MySQL is good but it is not magic. You can stretch it a bit with 
some optimization of your setup, but what often works better is 
rethinking your application. Does it really need to store 3 million records?


-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
On Sat, Aug 03, 2002 at 01:49:10AM -0300, Manuel Lemos wrote:
> >Google has 1 billion pages and qurys in a few milliseconds...
> 
> Real search engines do not use SQL databases.

What do search engines use?  Is there something out there that explains
how they work?

-- 
Jason Stechschulte
[EMAIL PROTECTED]
http://www.ypisco.com
--
"We demand rigidly defined areas of doubt and uncertainty!"
                -- Vroomfondel
--- End Message ---
--- Begin Message ---
Hi,

Friday, August 2, 2002, 10:52:14 PM, you wrote:
JB> Good morning!

JB> I need to subtract months by their abbreviated month name, so shouldn't this
JB> work?

JB> print(date("M", mktime(date("M")-$i));

JB> and if I loop;

JB> Aug
JB> Jul
JB> Jun
JB> May
JB> ........
Does this help...


$now = time();
$i = 36;
while($i > 0){
        echo date('M-Y',$now).'<br>';
        $now = strtotime('-1 month',$now);
        $i--;
}






-- 
regards,
Tom

--- End Message ---

Reply via email to