php-general Digest 26 Jul 2003 08:52:02 -0000 Issue 2198

Topics (messages 156938 through 156985):

Re: Debugging a Session Problem
        156938 by: Johnson, Kirk
        156948 by: Lee Stewart
        156952 by: Johnson, Kirk
        156959 by: Curt Zirzow
        156964 by: Lee Stewart
        156968 by: Curt Zirzow

Re: Permission Denied (in FTP)
        156939 by: Stephen

Re: Display Records (brief summary and full details)
        156940 by: Pushpinder Singh Garcha
        156965 by: Curt Zirzow
        156977 by: Tom Rogers

Reading a file from another server
        156941 by: Thomas
        156945 by: Chris Shiflett
        156946 by: Comex
        156949 by: Thomas
        156966 by: Chris Shiflett

Re: Link acting as a submit button
        156942 by: Comex
        156950 by: Ray Hunter

Re: PHP should know my data!
        156943 by: Comex

Re: html and php in the same document
        156944 by: Comex

php5 + php4 on same server
        156947 by: Thomas Hochstetter
        156951 by: Comex
        156953 by: Comex
        156956 by: Volker

how to make a global scope array
        156954 by: Jack Lee
        156955 by: Comex
        156958 by: David Nicholson
        156961 by: Jack Lee
        156962 by: Curt Zirzow
        156974 by: David Nicholson

Re: Freeze Pane
        156957 by: Jason Martyn

Re: Rewrite <img> and <a> tags.
        156960 by: Curt Zirzow

Best way to transfer session IDs
        156963 by: Matthew A. Blasinski
        156971 by: Chris Shiflett
        156976 by: Matthew A. Blasinski
        156978 by: John W. Holmes
        156979 by: Curt Zirzow
        156981 by: Chris Shiflett

Re: incrementing string value
        156967 by: Curt Zirzow

Re: file_put_contents()?
        156969 by: Curt Zirzow
        156970 by: Curt Zirzow

funny output
        156972 by: Ryan A
        156973 by: Chris Shiflett
        156975 by: Ryan A
        156980 by: Chris Shiflett

Parsing PHP
        156982 by: Nikhil G. Daddikar
        156983 by: Peter James
        156985 by: Greg Beaver

unique id
        156984 by: jan

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 ---
Your original code works for me, so it is a config issue somewhere.

Add this code to each file, to verify that the session ID is being correctly
passed:

echo "session id is " . session_id() . "<br>";

Also, is your php.ini in /usr/local/lib? If PHP can't find it, it will use
its built-in defaults, which is register_globals off.

Kirk

> -----Original Message-----
> From: Lee Stewart [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 2:00 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Debugging a Session Problem
> 
> 
> At 11:55 AM 7/25/2003, you wrote:
> >If you are relying on cookies to transmit the session ID, 
> make sure you have
> >session cookies enabled in your browser. Also check that you 
> don't have an
> >.htacess file in your directory that is overriding the 
> register_globals
> >setting. Turn your error_reporting up to E_ALL and see if 
> PHP has anything
> >to say to you.
> 
> Yes, cookies are enabled in the browser (and the same browser 
> works with 
> the application on the old system).  And no .htaccess files.
> 
> When I set error_reporting to E_ALL I do get:
>          Notice: Undefined variable: test in 
> /srv/www/htdocs/etrak/page2.php on line 3
> which is the reference to $test in
>          echo "test is $test<br>";
> because $test was to have been a session variable, but wasn't 
> passed.   Other than that, no errors.
> 
> CPT John W. Holmes wrote:
> >Seem to remember something about starting a session and then 
> redirecting
> >with header causing trouble. Try using session_write_close() 
> before you
> >redirect.
> 
> I also tried adding the session_write_close() with no change...
> 
> Each time I get a new session file in /tmp, but all are zero length...
> ls -l /tmp
> drwxrwxrwt    6 root     root          592 Jul 25 12:48 .
> drwxr-xr-x   18 root     root          408 Jul 25 12:47 ..
> -rw-------    1 wwwrun   nogroup         0 Jul 25 12:49 
> sess_39e04150efb3de58764ce04dae572401
> -rw-------    1 wwwrun   nogroup         0 Jul 25 11:57 
> sess_4d9573209bf3688c380d33c94f64be47
> -rw-------    1 wwwrun   nogroup         0 Jul 17 16:55 
> sess_5160b002714849a598a8a1e62a78a2eb
> -rw-------    1 wwwrun   nogroup         0 Jul 20 08:36 
> sess_7a053a0dd515170e6d0ace739860b71f
> -rw-------    1 wwwrun   nogroup         0 Jul 25 11:55 
> sess_903ef4579ee2f596981aad08efd3bc9d
> 
> Thanks for any debugging suggestions...
> Lee
> 
> ----------
> Lee Stewart, Senior SE
> Sytek Services, a Division of DSG
> (719) 566-0188 , Fax (719) 566-0655
> [EMAIL PROTECTED]
> www.sytek-services.com
> www.dsgroup.com 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message --- I agree that it's probably a config problem -- somewhere...

Yes, the session ID is passed correctly, but since page1.php doesn't end up with any variables or values in the session file, so regardless that it has the right session ID, there's nothing in the session file to restore...

The php.ini file is in /etc/php.ini (but that's where it's supposed to be in this distribution), and phpinfo shows it there, and when I turn register_globals on and off there, I see it change both in phpinfo and from a php script.

And if you want to look, a copy of my php.ini is available at http://4.43.81.92/phpini.txt

Lee

At 02:51 PM 7/25/2003, Johnson, Kirk wrote:
Your original code works for me, so it is a config issue somewhere.

Add this code to each file, to verify that the session ID is being correctly
passed:

echo "session id is " . session_id() . "<br>";

Also, is your php.ini in /usr/local/lib? If PHP can't find it, it will use
its built-in defaults, which is register_globals off.

Kirk


----------
Lee Stewart, Senior SE
Sytek Services, a Division of DSG
(719) 566-0188 , Fax (719) 566-0655
[EMAIL PROTECTED]
www.sytek-services.com
www.dsgroup.com



--- End Message ---
--- Begin Message ---
Sorry, I am stumped. I don't see any problems in the .ini file. Have you
tried some simple code in "register_globals off" style? 

<?
session_start();
$_SESSION['test'] = 'foobar';
header('Location: page2.php');
?>

<?
session_start();
echo "test is {$_SESSION['test']}<br>";
?>

Kirk

> -----Original Message-----
> From: Lee Stewart [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 25, 2003 4:27 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Debugging a Session Problem
> 
> 
> I agree that it's probably a config problem -- somewhere...
> 
> Yes, the session ID is passed correctly, but since page1.php 
> doesn't end up 
> with any variables or values in the session file, so 
> regardless that it has 
> the right session ID, there's nothing in the session file to 
> restore...
> 
> The php.ini file is in /etc/php.ini  (but that's where it's 
> supposed to be 
> in this distribution), and phpinfo shows it there, and when I turn 
> register_globals on and off there, I see it change both in 
> phpinfo and from 
> a php script.
> 
> And if you want to look, a copy of my php.ini is available at 
> http://4.43.81.92/phpini.txt

--- End Message ---
--- Begin Message ---
* Thus wrote Lee Stewart ([EMAIL PROTECTED]):
> The symptom is that when I attempt to save a session variable, it 
> creates the session file in /tmp, but with a zero length - no variable 
> names or values stored.  (/tmp is globally read/write)  This happens not 
> only with the application I'm moving, but also with the "world's 
> simplest global test pages" below.

hmm.. you do have space left on /tmp ?

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

--- End Message ---
--- Begin Message --- Using the $_SESSION[] style produces the same results... Zero length session file in /tmp, and no data passed... (available at http://4.43.81.92/page1a.php)

So where do I go from here... Is there any way to debug it? Like I said, I suspect it's not a PHP code bug, but I'm at a loss as to where to go from here (other than re-writing the entire application in some other language -- which I really don't want to do)...

Help?
Lee

At 04:36 PM 7/25/2003, Johnson, Kirk wrote:
Sorry, I am stumped. I don't see any problems in the .ini file. Have you
tried some simple code in "register_globals off" style?

<?
session_start();
$_SESSION['test'] = 'foobar';
header('Location: page2.php');
?>

<?
session_start();
echo "test is {$_SESSION['test']}<br>";
?>

Kirk


----------
Lee Stewart, Senior SE
Sytek Services, a Division of DSG
(719) 566-0188 , Fax (719) 566-0655
[EMAIL PROTECTED]
www.sytek-services.com
www.dsgroup.com



--- End Message ---
--- Begin Message ---
* Thus wrote Lee Stewart ([EMAIL PROTECTED]):
> Using the $_SESSION[] style produces the same results...   Zero length 
> session file in /tmp, and no data passed...   (available at 
> http://4.43.81.92/page1a.php)

You did see my post about space left on /tmp?

> 
> So where do I go from here...    Is there any way to debug it?   Like I 
> said, I suspect it's not a PHP code bug, but I'm at a loss as to where to 
> go from here (other than re-writing the entire application in some other 
> language -- which I really don't want to do)...

another language?  how dare you say such thing here on this list :)

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

--- End Message ---
--- Begin Message ---
I've tried a regular user and the root user but both seem to say permission
denied...

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)


----- Original Message ----- 
From: "Baroiller Pierre-Emmanuel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 3:32 PM
Subject: [PHP] Re: Permission Denied (in FTP)


Hi,

Doest your ftp account have sufficient access rights for deleting theses
files ?
Is your apache user is "nobody" , the chmod will not work ( take a look at
your error log file), so,
only nobody or root will able to remove these entries..

Regards,
P.E. Baroiller

"Stephen" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
Hello,

I'm having some slight issues. I have a script which creates a directory and
then copies a blank file into it 4 times each with different names. Here's
the code which does it:

      <?php
       $folder = str_replace(' ', '_', $HTTP_POST_VARS['title']);
     $folder = str_replace('.', '', $folder);
       mkdir('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder, 0777);
     copy('./tutorials/blank.txt',
'./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/desc.txt');
     copy('./tutorials/blank.txt',
'./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/rating.txt');
     copy('./tutorials/blank.txt',
'./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/overview.txt');
     copy('./tutorials/blank.txt',
'./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/views.txt');

     chmod('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/desc.txt',
0777);

chmod('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/rating.txt',
0777);

chmod('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/overview.txt',
0777);

chmod('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/views.txt',
0777);

     $fp =
fopen('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/desc.txt',
'w+');
     fwrite($fp, $HTTP_POST_VARS['desc']);
     $fp =
fopen('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/overview.txt',
'w+');
     fwrite($fp, $HTTP_POST_VARS['overview']);
     $fp =
fopen('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/views.txt',
'w+');
     fwrite($fp, '0');
     $fp =
fopen('./tutorials/'.$HTTP_POST_VARS['folder'].'/'.$folder.'/rating.txt',
'w+');
     fwrite($fp, '0');
      ?>

After all that is done, it's fine. The problem I'm having is deleting the
folder in an FTP client. Whenever I go to delete it, it says it cannot
delete desc.txt because permission is denied. Is there any way to make it so
it can be deleted? Please help and reply soon. Thanks!

Thank you,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.
Lead Programmer/Webmaster
WiredPHP (http://php.melchior.us)




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






--- End Message ---
--- Begin Message --- Thanks Tom,

I appreciate your help ! however I have a 2 quick questions...

1.) should we not save the names of the companies as $companies[$row] = $row['company'];
2.) the approach of accessing the variable as $details = $_SESSION['link']['$_GET['name']] is not
working , when I try to echo the $details is get something else. I am not sure how we use the
$_SESSION[ ] [ ] with 2 variables as shown.



any help will be appreciated.


regards
--Pushpinder


On Thursday, July 24, 2003, at 08:10 PM, Tom Rogers wrote:


Hi,

Friday, July 25, 2003, 7:13:27 AM, you wrote:
PSG> Hello All,

PSG> I am trying to create a small MySQL application using PHP. I have a
PSG> table of contacts with each record having over 30 fields. I have a
PSG> search page where a logged-in admin can search for a particular record
PSG> on the basis of certain parameters.


PSG> This is a sample code:


PSG> $sql1 = "SELECT * from `contacts` WHERE $where";


PSG> while ($row = mysql_fetch_array($result1)) {

PSG>          // Alternate the bgcolor of each row for visibility
PSG>              ($even % 2) == 0 ? $bgcolor = "#EFEFEF" : $bgcolor =
PSG> "#eeffff";
PSG>                  $even = $even + 1;

PSG> // print the actual row
PSG> echo "<TR BGCOLOR=$bgcolor>
PSG> <TD align=\"left\"><font color=\"#666666\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">$row[company]</font></TD>
PSG> <TD align=\"left\"><font color=\"#666666\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">$row[name_1]</font></TD>
PSG> <TD align=\"left\"><font color=\"#666666\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">$row[phone_1]</font></TD>
PSG> <TD align=\"left\"><font color=\"#666666\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">$row[city]</font></TD>
PSG> <TD align=\"left\"><font color=\"#666666\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">$row[url]</font></TD>
PSG> <TD align=\"left\"><font color=\"#666666\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\">$row[email_1]</font></TD>
PSG> <TD align=\"center\"><font color=\"#333333\" size=\"1\"
PSG> face=\"Verdana, Arial, Helvetica, sans-serif\"><a
PSG> href=\"profile.php\">Link</a></font></TD>
PSG> </TR>";


PSG>          // try to register the variable
PSG>            $_SESSION['link'] = $row[company];
PSG>          } // end while
PSG>         // print the end of the table
PSG>            echo "</TABLE></body></html>";


PSG> The above tables displays the results of the query in a table form
PSG> with only the main fields of the record. The last column of the table
PSG> contains a link to view the full-contents of the record. when the user
PSG> clicks this link, he will go to another script called
PSG> "profile.php" which will display all the contents of the record. In
PSG> order to do this I will need to store all the primary keys (in this
PSG> case the name of the company) of each record from the result set and
PSG> then use it to retrieve all the contents. I have been successful in
PSG> trying to do this for a single row (record) of the result by
PSG> registering it as an session variable called ['link']



PSG> I am at a loss to figure out how to store the names of the first column
PSG> of the result set i.e. the company name. Is it possible to create an
PSG> array of the session variable ['link'] ?? Another approach would be
PSG> to get the names of the companies as a separate query and register them
PSG> as an array of session variables.



PSG> any suggestions will be welcome. Thanks in advance.


PSG> --Pushpinder

in the href put

...<a href=\"profile.php?name=".$row['name']."\">...

Make a seperate array as you loop

$companies[$row['name']] = $row;

in your session store it as

$_SESSION['link'] = $companies;

You can then access it in profile php as


$details = $_SESSION['link']['$_GET['name']]



-- regards, Tom


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



--- End Message ---
--- Begin Message ---
* Thus wrote Pushpinder Singh Garcha ([EMAIL PROTECTED]):
> Thanks Tom,
> 
> I appreciate your help ! however I have a 2 quick questions...
> 
> 1.)  should we not save the names of the companies as $companies[$row] 
> = w['company'];
I'm not sure in what context or what purpose you wish to do so.
There is, in general, nothing wrong with storing your information
like that.

> 2.)  the approach of accessing the variable as $details = 
> $_SESSION['link']['$_GET['name']] is not
>        working , when I try to echo the $details is get something else. 
> I am not sure how we use the
>        $_SESSION[ ] [ ] with 2 variables as shown.
> 

I assume you mean:
$_SESSION['link'][$_GET['name']];

If you could provide an example on how you set the array that would
be easier to let you know why your output is not comming back
right.

Please Compose a new message and type a subject when starting a new
topic.

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

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

Saturday, July 26, 2003, 7:28:16 AM, you wrote:
PSG> Thanks Tom,

PSG> I appreciate your help ! however I have a 2 quick questions...

PSG> 1.)  should we not save the names of the companies as $companies[$row] 
PSG> = $row['company'];        
PSG> 2.)  the approach of accessing the variable as $details = 
PSG> $_SESSION['link']['$_GET['name']] is not
PSG>         working , when I try to echo the $details is get something else. 
PSG> I am not sure how we use the
PSG>         $_SESSION[ ] [ ] with 2 variables as shown.


PSG> any help will be appreciated.

PSG> regards
PSG> --Pushpinder

No that won't work
What we are trying to achieve is

array['companyname'] = row[]
send the code you have so far and i'll have a look.
After the loop use

echo '<pre>';
print_r($companies);
echo '</pre>';

That will show the array structure you have created.

Do the same for $_SESSION on the next page and it will all become
clear :)
-- 
regards,
Tom


--- End Message ---
--- Begin Message ---
Hi Everyone.

I'm having problems creating code to read a file from another server.

1.  Is this even possible?  with a secure server aswell?
2.  I have tried using     fopen()    but this always gives me an error:

Warning: stat failed for http://www.domain.com/test.txt (errno=2 - No such
file or directory) in /home/domain/public_html/php/testphp/test.php on line
4

this is my code:
<?php
    $filename = "http://www.domain.com/test.txt";;
    $handle = fopen ($filename, "r");
    $content = fread($handle, filesize ($filename));
    fclose($handle);

    echo $content;

?>

can anyone help me.   I need to put this on my server, and read this other
file form a game server....but I can't seem to do it.

Cheers for any help




--- End Message ---
--- Begin Message ---
--- Thomas <[EMAIL PROTECTED]> wrote:
> I'm having problems creating code to read a file from another
> server.
> 
> 1.  Is this even possible?  with a secure server aswell?

Yes.

> this is my code:
> <?php
>     $filename = "http://www.domain.com/test.txt";;
>     $handle = fopen ($filename, "r");
>     $content = fread($handle, filesize ($filename));
>     fclose($handle);
>     echo $content;
> ?>

This code can be replaced with:

readfile('http://www.domain.com/test.txt');

As far as debugging problems related to this, check your php.ini and make sure
the URL wrapper is enabled. Otherwise, you will be restricted to your local
filesystem only.

Hope that helps.

Chris

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

--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Thomas:
> Hi Everyone.
>
> I'm having problems creating code to read a file from another server.
>
> 1.  Is this even possible?  with a secure server aswell?
> 2.  I have tried using     fopen()    but this always gives me an
> error:
>
> Warning: stat failed for http://www.domain.com/test.txt (errno=2 - No
> such file or directory) in
> /home/domain/public_html/php/testphp/test.php on line 4
>
> this is my code:
> <?php
>     $filename = "http://www.domain.com/test.txt";;
>     $handle = fopen ($filename, "r");
>     $content = fread($handle, filesize ($filename));
>     fclose($handle);
>
>     echo $content;
>
>>
>
> can anyone help me.   I need to put this on my server, and read this
> other file form a game server....but I can't seem to do it.
>
> Cheers for any help

Quote:
If PHP has decided that filename specifies a registered protocol, and that
protocol is registered as a network URL, PHP will check to make sure that
allow_url_fopen is enabled. If it is switched off, PHP will emit a warning
and the fopen call will fail.

But then again, that's not the error it gave...



--- End Message ---
--- Begin Message ---
if  I use:

readfile("ftp://username:[EMAIL PROTECTED]/test.txt");

It doesn't have any errors and comes up blank.

If I put:

$result =
readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
print ($result);

it ends up showing a '0'  by iteself.  that's it.  and I knwo the txt file
is full of info.
I'm stumped again.

Cheers. for your help.

Thomas


"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- Thomas <[EMAIL PROTECTED]> wrote:
> > I'm having problems creating code to read a file from another
> > server.
> >
> > 1.  Is this even possible?  with a secure server aswell?
>
> Yes.
>
> > this is my code:
> > <?php
> >     $filename = "http://www.domain.com/test.txt";;
> >     $handle = fopen ($filename, "r");
> >     $content = fread($handle, filesize ($filename));
> >     fclose($handle);
> >     echo $content;
> > ?>
>
> This code can be replaced with:
>
> readfile('http://www.domain.com/test.txt');
>
> As far as debugging problems related to this, check your php.ini and make
sure
> the URL wrapper is enabled. Otherwise, you will be restricted to your
local
> filesystem only.
>
> Hope that helps.
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/



--- End Message ---
--- Begin Message ---
--- Thomas <[EMAIL PROTECTED]> wrote: 
> readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> 
> It doesn't have any errors and comes up blank.
> 
> If I put:
> 
> $result =
> readfile("ftp://username:[EMAIL PROTECTED]/test.txt");
> print ($result);
> 
> it ends up showing a '0'  by iteself.

The readfile() functions outputs the contents of the file and returns the size
of the file in bytes. So, when you assigned $result to the return value, you
demonstrated that readfile() output 0 bytes (which explains why you didn't see
anything).

I'm pretty sure your php.ini is set to allow this, otherwise you would receive
an error. I'm doubting whether that URL actually contains any content. How have
you tested to be sure it does?

Chris

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

--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Ray Hunter:
> On Fri, 2003-07-25 at 05:30, Matt Palermo wrote:
>> I just remembered (I'm not sure if it makes a difference) that I am
>> using frames on this page.  Does this matter at all?  Thanks.
>
> Yes it matters tons with the javascript call.
>
> Here is some info on it...however, these questions are now javascript
> and not php...

That's only if you're going between frames, if the whole form (as usual) is
on one frame it works fine.



--- End Message ---
--- Begin Message ---
Good point...thanks for catching that

I usually link into forms from other frames if I dont have a submit
button in that form.

--
BigDog

On Fri, 2003-07-25 at 15:49, Comex wrote:
> <[EMAIL PROTECTED]>
> Ray Hunter:
> > On Fri, 2003-07-25 at 05:30, Matt Palermo wrote:
> >> I just remembered (I'm not sure if it makes a difference) that I am
> >> using frames on this page.  Does this matter at all?  Thanks.
> >
> > Yes it matters tons with the javascript call.
> >
> > Here is some info on it...however, these questions are now javascript
> > and not php...
> 
> That's only if you're going between frames, if the whole form (as usual) is
> on one frame it works fine.
> 
> 


--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Manoj Nahar:
> and much needed function
>
> debug_and_test_all_my_code();
>
Which is the most likely of all the functions here.



--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Bill Pilgrim:
> If php and html are to be included in the same document, does the
> document extension always have to be .php  ?
No, but /why/ do you want to change it?



--- End Message ---
--- Begin Message ---
Hi guys.

Sorry, i know that was discussed earlier this month ... i just looked for
the posting again in the archives ... i could only find the question post ...
but there was an answer.

So, how do you setup the server again to have php4 run on the :80 port and
php5 on :8080 (apache server). Does it collide?

Thanks
Thomas

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Thomas Hochstetter:
> Hi guys.
>
> Sorry, i know that was discussed earlier this month ... i just looked
> for the posting again in the archives ... i could only find the
> question post ... but there was an answer.
>
> So, how do you setup the server again to have php4 run on the :80
> port and php5 on :8080 (apache server). Does it collide?
>
> Thanks
> Thomas

I've done it... but you have to run one as CGI, one can be module or CGI.
To run one as CGI and one as module:

LoadModule php5_module "/path/to/php4apache.dll"
ScriptAlias /php/ "/path/to/php4/folder/"
AddType application/x-httpd-php .php5
AddType application/x-httpd-php4 .php4
Action application/x-httpd-php4 /php/php.exe (I'm using windows)

Or to run both as CGI:
ScriptAlias /php4/ "/path/to/php4/folder"
ScriptAlias /php5/ "/path/to/php5/folder"
AddType application/x-httpd-php .php5
AddType application/x-httpd-php4 .php4
Action application/x-httpd-php4 /php4/php.exe
Action application/x-httpd-php /php5/php.exe



--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Comex:
> <[EMAIL PROTECTED]>
> Thomas Hochstetter:
>> Hi guys.
>>
>> Sorry, i know that was discussed earlier this month ... i just looked
>> for the posting again in the archives ... i could only find the
>> question post ... but there was an answer.
>>
>> So, how do you setup the server again to have php4 run on the :80
>> port and php5 on :8080 (apache server). Does it collide?
>>
>> Thanks
>> Thomas
>
> I've done it... but you have to run one as CGI, one can be module or
> CGI. To run one as CGI and one as module:
>
> LoadModule php5_module "/path/to/php4apache.dll"
> ScriptAlias /php/ "/path/to/php4/folder/"
> AddType application/x-httpd-php .php5
> AddType application/x-httpd-php4 .php4
> Action application/x-httpd-php4 /php/php.exe (I'm using windows)
>
> Or to run both as CGI:
> ScriptAlias /php4/ "/path/to/php4/folder"
> ScriptAlias /php5/ "/path/to/php5/folder"
> AddType application/x-httpd-php .php5
> AddType application/x-httpd-php4 .php4
> Action application/x-httpd-php4 /php4/php.exe
> Action application/x-httpd-php /php5/php.exe

Oh, I'm stupid!  That is how you have .php5 as php5 and .php4 as php4...  if
you're using virtual hosts, you just replace:
AddType application/x-httpd-php4 .php4
with:
AddType application/x-httpd-php4 .php

and put the AddType in the <VirtualHost>.



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

you also could run two static compiled versions of apache (if apache) with
php4 and 5 compiled in, but you need another ip-address to bind to - also
have to manage 2 apaches....(not a problem or what? ,-).

sorry for my english.
volker
----- Original Message -----
From: "Comex" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 12:42 AM
Subject: Re: [PHP] Re: php5 + php4 on same server


> <[EMAIL PROTECTED]>
> Comex:
> > <[EMAIL PROTECTED]>
> > Thomas Hochstetter:
> >> Hi guys.
> >>
> >> Sorry, i know that was discussed earlier this month ... i just looked
> >> for the posting again in the archives ... i could only find the
> >> question post ... but there was an answer.
> >>
> >> So, how do you setup the server again to have php4 run on the :80
> >> port and php5 on :8080 (apache server). Does it collide?
> >>
> >> Thanks
> >> Thomas
> >
> > I've done it... but you have to run one as CGI, one can be module or
> > CGI. To run one as CGI and one as module:
> >
> > LoadModule php5_module "/path/to/php4apache.dll"
> > ScriptAlias /php/ "/path/to/php4/folder/"
> > AddType application/x-httpd-php .php5
> > AddType application/x-httpd-php4 .php4
> > Action application/x-httpd-php4 /php/php.exe (I'm using windows)
> >
> > Or to run both as CGI:
> > ScriptAlias /php4/ "/path/to/php4/folder"
> > ScriptAlias /php5/ "/path/to/php5/folder"
> > AddType application/x-httpd-php .php5
> > AddType application/x-httpd-php4 .php4
> > Action application/x-httpd-php4 /php4/php.exe
> > Action application/x-httpd-php /php5/php.exe
>
> Oh, I'm stupid!  That is how you have .php5 as php5 and .php4 as php4...
if
> you're using virtual hosts, you just replace:
> AddType application/x-httpd-php4 .php4
> with:
> AddType application/x-httpd-php4 .php
>
> and put the AddType in the <VirtualHost>.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
//I have an array a[] like this:

<?php
    $a[]=0;

//How to define and use it in a function like this?

function myfunc(something)
{
    echo $a[0];  //got error here!!!! Notice: Undefined variable:

}

?>
//Thanks for any help.!!!



--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]>
Jack Lee:
> //I have an array a[] like this:
>
> <?php
>     $a[]=0;
>
> //How to define and use it in a function like this?
>
> function myfunc(something)
> {
>     echo $a[0];  //got error here!!!! Notice: Undefined variable:
>
> }
>
>>
> //Thanks for any help.!!!

global $a;



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

This is a reply to an e-mail that you wrote on Fri, 25 Jul 2003 at
23:51, lines prefixed by '>' were originally written by you.

> <[EMAIL PROTECTED]>
> Jack Lee:
> > //I have an array a[] like this:
> > <?php
> >     $a[]=0;
> > //How to define and use it in a function like this?
> > function myfunc(something)
> > {
> >     echo $a[0];  //got error here!!!! Notice: Undefined
variable:
> > }
> > //Thanks for any help.!!!
> global $a;

.. or echo $GLOBALS['a'][0];

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
It works! Thanks guys!

"David Nicholson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,

This is a reply to an e-mail that you wrote on Fri, 25 Jul 2003 at
23:51, lines prefixed by '>' were originally written by you.

> <[EMAIL PROTECTED]>
> Jack Lee:
> > //I have an array a[] like this:
> > <?php
> >     $a[]=0;
> > //How to define and use it in a function like this?
> > function myfunc(something)
> > {
> >     echo $a[0];  //got error here!!!! Notice: Undefined
variable:
> > }
> > //Thanks for any help.!!!
> global $a;

.. or echo $GLOBALS['a'][0];

David.

-- 
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)



--- End Message ---
--- Begin Message ---
* Thus wrote Comex ([EMAIL PROTECTED]):
> <[EMAIL PROTECTED]>
> Jack Lee:
> > //I have an array a[] like this:
> >
> > <?php
> >     $a[]=0;
> >
> > //How to define and use it in a function like this?
> >
> > function myfunc(something)
> > {
> >     echo $a[0];  //got error here!!!! Notice: Undefined variable:
> >
> > }
> >
> >>
> > //Thanks for any help.!!!
> 
> global $a;

Ouch!

Sometimes I wish global didn't exist 

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

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

This is a reply to an e-mail that you wrote on Sat, 26 Jul 2003 at
00:50, lines prefixed by '>' were originally written by you.
> Ouch!
> Sometimes I wish global didn't exist

Yes, it can be better to pass in a variable (by reference if you need
to write to it from within a function and not have it as the value
that you return), e.g.

function doSomething(&$a){
    $a = 20;
    return true; // to signify success
}

$a = 10;
doSomething($a);
echo $a; // prints 20


--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
I will put up the link to the example later. I'd just like to mention one
thing if anyone else uses this solution:

You may want to put both tables in the <div> tags and give them both
absolute locations. This eliminates the possiblity of having a mismatched
table as different browsers are used.

----- Original Message -----
From: "Jason Martyn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 8:49 AM
Subject: [PHP] Freeze Pane


This is probably under the category of javascript, however I would like ot
know if it is possible to be done with php.

Let's say I have a table that is 30 columns wide and so the entire table
doesn't fit on the screen. Is it possible (with php) to "freeze columns"
while scrolling across so you don't lose the original 2 columns?

And since it probably isn't, can someone suggest a language that would cover
this subject?

Thanks,
Jay

--- End Message ---
--- Begin Message ---
* Thus wrote Simon Fredriksson ([EMAIL PROTECTED]):
> 
> How can I easiest rewrite A and IMG tags? I'm fetching a page with 
> fsockopen() and I need to rewrite these tags before sending it on to a user.
> 
> My own theory is that it's made with Regular Expressions. I just don't 
> know these myself.
 
The documentation for preg_match_all has an excelent pattern for
matching html tags:

preg_match_all ("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches);

HTH,

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

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

I'm trying to track session data and merge several related services through a common server-side session (using Apache). One condition is that it won't use cookies to store the user data OR the session ID. Another is that the services we're merging use different languages, including PHP and Perl (Apache::Session module) so whatever I use needs to be supported by both of these.

My question - what is the best way to "know" the session id between pages? Posting it in the URL and using $_GET["PHPSESSID"] is one solution, but this seems like a hassle and is also open to attack if someone could "guess" a valid session ID. Or, would it better to avoid transferring session ids altogether and generate unique "names" on each page? What works well for generating the name? I'm thinking something like a hash of their IP plus a private key, but maybe someone knows problems with this or has a better/easier solution.

Also, outside of changing session.use_cookies to false and session.save_path to a PHP- and Perl- happy location, are there any other php.ini or Apache settings I should be changing?

Any comments or thoughts are greatly appreciated!

--
Matt Blasinski (mbv)
Internet Infrastructure Applications Technology
Division of Information Technology
3121 Computer Science and Statistics
1210 West Dayton Street
Madison WI 53706
Work (608) 262-2286
Cell (608) 206-4098


--- End Message ---
--- Begin Message ---
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:
> My question - what is the best way to "know" the session id between 
> pages? Posting it in the URL and using $_GET["PHPSESSID"] is one 
> solution, but this seems like a hassle and is also open to attack if 
> someone could "guess" a valid session ID.

As a side note, you should probably use a word like "put" to describe placing
data in the URL like that, because "post" refers to a different method
altogether. :-)

As for session IDs, there are basically three ways you can have the client send
that to you:

1. In a Cookie header
2. In the URL
3. In the content section (POST)

These are all quite open to attack, especially over non-SSL connections (which
is the more popular case). In your case, cookies are probably not an option if
you are dealing with multiple domains. At the very least, they can only help to
track a session on one domain, and you'll have to develop a way to transfer the
session across domains anyway. POST is sort of a hassle, because you have to
make sure every request from your users is a POST. So, sending data in the URL
is probably your best choice.

Try to focus on two tasks as you try to secure this data transfer:

1. Try to make the session ID hard to get and hard to guess.
2. Try to make a stolen session ID useless to anyone but the rightful owner.

Too often, developers try to focus on (and depend on) task 1. While trying to
keep session IDs secret is good, task 2 is at least equally as important.

How do you achieve this? Consider an HTTP request from your legitimate user:

GET /blah.php?session_id=1234 HTTP/1.1
Host: example.org
User-Agent: Mozilla (Gecko) Linux 2.4.1.2.3.4

There are usually many more headers, but this example will suffice. Now,
depending on specific HTTP headers is never a good plan (you might notice
people warning against depending on the Referer header), but this is only if
you do this for every user. The headers that the *same* user sends are going to
be much more consistent. In the above example, you can be pretty certain that,
regardless of HTTP proxies or anything else, the user is going to send the same
User-Agent header in each request. So, why not store this in the session (on
the server), and check to make sure it matches every time? This approach
shouldn't adversely affect your users, but it should complicate impersonation.

And that is how you play the game of security - try to make things easy for the
good guys and hard for the bad guys. By adding this simple User-Agent check, a
bad guy can't just use a stolen session ID to impersonate someone. The bad guy
has to also send the same User-Agent header. Can this be done? Sure, and it's
not too hard, but it is something, and everything helps.

Hopefully this can get your creative juices flowing.

Chris

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

--- End Message ---
--- Begin Message --- Thanks for the response Chris, that's just the type of thing I was looking for!

So, I'm thinking a plausible session id could be made by hashing their identification (to make it useful to the rightful owner only) with a private key (to make it hard to get and guess). I think the identification could be their IP, user agent, and maybe one or two more constant headers. The private key, of course, could be anything unguessable and kept secure.

This leads me to one more question - would it be better to pass this by PUTing it in the URL or generating it at the start of each page. Passing is pretty simple, but I think generating it has the added benefit of the end user being unable to forge it because it never leaves the server or comes from the client. Does this seem reasonable and worthwhile? (I have a habit of overcomplicating things like this :-))

Thanks again,

Matt

Chris Shiflett wrote:
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:

My question - what is the best way to "know" the session id between pages? Posting it in the URL and using $_GET["PHPSESSID"] is one solution, but this seems like a hassle and is also open to attack if someone could "guess" a valid session ID.


As a side note, you should probably use a word like "put" to describe placing
data in the URL like that, because "post" refers to a different method
altogether. :-)

As for session IDs, there are basically three ways you can have the client send
that to you:

1. In a Cookie header
2. In the URL
3. In the content section (POST)

These are all quite open to attack, especially over non-SSL connections (which
is the more popular case). In your case, cookies are probably not an option if
you are dealing with multiple domains. At the very least, they can only help to
track a session on one domain, and you'll have to develop a way to transfer the
session across domains anyway. POST is sort of a hassle, because you have to
make sure every request from your users is a POST. So, sending data in the URL
is probably your best choice.

Try to focus on two tasks as you try to secure this data transfer:

1. Try to make the session ID hard to get and hard to guess.
2. Try to make a stolen session ID useless to anyone but the rightful owner.

Too often, developers try to focus on (and depend on) task 1. While trying to
keep session IDs secret is good, task 2 is at least equally as important.

How do you achieve this? Consider an HTTP request from your legitimate user:

GET /blah.php?session_id=1234 HTTP/1.1
Host: example.org
User-Agent: Mozilla (Gecko) Linux 2.4.1.2.3.4

There are usually many more headers, but this example will suffice. Now,
depending on specific HTTP headers is never a good plan (you might notice
people warning against depending on the Referer header), but this is only if
you do this for every user. The headers that the *same* user sends are going to
be much more consistent. In the above example, you can be pretty certain that,
regardless of HTTP proxies or anything else, the user is going to send the same
User-Agent header in each request. So, why not store this in the session (on
the server), and check to make sure it matches every time? This approach
shouldn't adversely affect your users, but it should complicate impersonation.

And that is how you play the game of security - try to make things easy for the
good guys and hard for the bad guys. By adding this simple User-Agent check, a
bad guy can't just use a stolen session ID to impersonate someone. The bad guy
has to also send the same User-Agent header. Can this be done? Sure, and it's
not too hard, but it is something, and everything helps.

Hopefully this can get your creative juices flowing.

Chris

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



--
Matt Blasinski (mbv)
Internet Infrastructure Applications Technology
Division of Information Technology
3121 Computer Science and Statistics
1210 West Dayton Street
Madison WI 53706
Work (608) 262-2286
Cell (608) 206-4098


--- End Message ---
--- Begin Message --- Matthew A. Blasinski wrote:
I'm trying to track session data and merge several related services through a common server-side session (using Apache). One condition is that it won't use cookies to store the user data OR the session ID. Another is that the services we're merging use different languages, including PHP and Perl (Apache::Session module) so whatever I use needs to be supported by both of these.

My question - what is the best way to "know" the session id between pages? Posting it in the URL and using $_GET["PHPSESSID"] is one solution, but this seems like a hassle and is also open to attack if someone could "guess" a valid session ID. Or, would it better to avoid transferring session ids altogether and generate unique "names" on each page? What works well for generating the name? I'm thinking something like a hash of their IP plus a private key, but maybe someone knows problems with this or has a better/easier solution.

If you don't want to use cookies, then you need to pass a session ID through the URL. That's your only answer. Or use POST forms everywhere to "hide" the session id. I don't understand what you mean by "unique names on each page" but I don't think that's any way to maintain state.


--
---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
* Thus wrote Matthew A. Blasinski ([EMAIL PROTECTED]):
> Thanks for the response Chris, that's just the type of thing I was 
> looking for!
> 
> So, I'm thinking a plausible session id could be made by hashing their 
> identification (to make it useful to the rightful owner only) with a 
> private key (to make it hard to get and guess).  I think the 
> identification could be their IP, user agent, and maybe one or two more 
> constant headers.  The private key, of course, could be anything 
> unguessable and kept secure.

Using the IP of the user may force things to break on the client
easily.  There are a number of users who are behind proxies that
change per request (ie aol users.) thus their session would become
obsolete on their next request.

Another issue would be inactivity for the session. You could also
keep keep track of an internal last_requested variable that would
expire after a certain amount of time. 

> 
> This leads me to one more question - would it be better to pass this by 
> PUTing it in the URL or generating it at the start of each page. 
> Passing is pretty simple, but I think generating it has the added 
> benefit of the end user being unable to forge it because it never leaves 
> the server or comes from the client.  Does this seem reasonable and 
> worthwhile?  (I have a habit of overcomplicating things like this :-))

I suppose it would depend on how secure you want your session to be
from SID hijaking.  A generation of key hash  per request would be
perhaps a little over kill if you are just keeping track of a last
page the person was on.  Handling sensitive information, however is
a different story (ie cc numbers).


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

--- End Message ---
--- Begin Message ---
--- "Matthew A. Blasinski" <[EMAIL PROTECTED]> wrote:
> So, I'm thinking a plausible session id could be made by hashing
> their identification (to make it useful to the rightful owner
> only) with a private key (to make it hard to get and guess). I
> think the identification could be their IP, user agent, and maybe
> one or two more constant headers. The private key, of course,
> could be anything unguessable and kept secure.

A few comments...

This session ID doesn't have to be generated from any user data. It can be a
completely random and unique string that you generate for any user who arrives
at your site without an active session. Even though it is probably very
difficult to reverse or guess a valid ID from your method above, the extra risk
isn't necessary.

Also, the IP address isn't a very good piece of data to use, because it is not
necessarily consistent. So, while it might make things harder for the bad guys
(to spoof the good guy's IP), it could also can make things hard for the good
guys (they are AOL users, lose their modem connection, etc.).

So doesn't this contradict everything I mentioned previously? No, the data I
mentioned keeping (User-Agent is my favorite example) is data that you can keep
on the server within the session, such as:

$_SESSION['user_agent'] = $_SERVER['USER_AGENT'];

That would be the first tme, of course. Since session variables aren't sent
to/from the client (unless you output one, of course), they are safer than
things transmitted across the public Internet. So, the session ID doesn't have
to have any data within it that makes it useless to anyone but the rightful
owner - the session that it is associated with on the server can instead. This
might make things simpler for you. 

> This leads me to one more question - would it be better to pass
> this by PUTing it in the URL or generating it at the start of
> each page. Passing is pretty simple, but I think generating it
> has the added benefit of the end user being unable to forge it
> because it never leaves the server or comes from the client.

You lost me with that bit. While it is good that you want to eliminate any
unnecessary transmission of data across the Internet, the session ID is the one
thing the client *must* send you in order for you to maintain session. It is
how you identify who it is.

Maybe you can rephrase what you're asking?

Hope that helps.

Chris

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

--- End Message ---
--- Begin Message ---
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]):
> * Thus wrote Jeremy ([EMAIL PROTECTED]):
> > let me make sure I understand...
> > 
> > $var = 'a';
> > $var++
> > print($var);
> > 
> > would print "b" to the screen?
> 
> um.. ignore my post ealier.. yes it does print 'b'

I forgot to mention, be sure to check how far you are in your loop
cause last time i checked:

...
var z[];
var {[];

will produce a javascript error.


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

--- End Message ---
--- Begin Message ---
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]):
> > Another stupid newbie question...(btw, is there a list more geared towards
> > the newbies?)
> 
> Yes, it's called the manual. 
> 
> > Is the file_put_contents() function not available in PHP 4.3.2?
> 
> Seriously: www.php.net/file_put_contents

note: only in version 5 cvs only.


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

--- End Message ---
--- Begin Message ---
* Thus wrote Jonas Thorell ([EMAIL PROTECTED]):
> Another stupid newbie question...(btw, is there a list more geared towards
> the newbies?)
1) the manual
2) the archives
3) see #1 

> 
> Is the file_put_contents() function not available in PHP 4.3.2?
If you notice in the manual under the function name:

file_put_contents
(PHP 5 CVS only)

PHP documentors have been excellent at keeping most documentation
up to par specifying when things become available.

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

--- End Message ---
--- Begin Message ---
Hi everyone,
I am having some funny output and funny things happening to my scripts since
I changed hosts...
my login scripts were working fine before but now they dont seem to
work...also there is a hidden text box appearing in the
code that i didnt write...this is it:
<input type="hidden" name="PHPSESSID"
value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />

Also notice that it ends with a slash that I didnt have anything to do with.
Any ideas on why this is happening? you can have a look at the php info for
this site at:
http://bestwebhosters.com/phpinfo.php

Kindly reply,
-Ryan





--- End Message ---
--- Begin Message ---
--- Ryan A <[EMAIL PROTECTED]> wrote:
> I am having some funny output and funny things happening to my
> scripts since I changed hosts...
...
> there is a hidden text box appearing in the code that i didnt
> write...this is it:
> <input type="hidden" name="PHPSESSID"
> value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />
> 
> Also notice that it ends with a slash that I didnt have anything
> to do with.

Your new host has session.use_trans_sid enabled, and perhaps your old one did
not.

The slash at the end is XHTML compliant, which is how PHP tries to add code (in
case you care about XHTML compliance).

Hope that helps.

Chris

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

--- End Message ---
--- Begin Message ---
Hey,
Thanks for replying.

So how do i get my scripts working again? the authentication part was
working perfectly but now it just kicks me back to the login page...

plus it looks like I am unable to set sessions properly, and i suspect thats
why i am getting kicked back to the login page.

Kindly reply,
-Ryan


----- Original Message -----
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Ryan A" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 2:44 AM
Subject: Re: [PHP] funny output


> --- Ryan A <[EMAIL PROTECTED]> wrote:
> > I am having some funny output and funny things happening to my
> > scripts since I changed hosts...
> ...
> > there is a hidden text box appearing in the code that i didnt
> > write...this is it:
> > <input type="hidden" name="PHPSESSID"
> > value="ad2e5a31727b2b4eb28b2d0c2d6ee67e" />
> >
> > Also notice that it ends with a slash that I didnt have anything
> > to do with.
>
> Your new host has session.use_trans_sid enabled, and perhaps your old one
did
> not.
>
> The slash at the end is XHTML compliant, which is how PHP tries to add
code (in
> case you care about XHTML compliance).
>
> Hope that helps.
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/
>


--- End Message ---
--- Begin Message ---
--- Ryan A <[EMAIL PROTECTED]> wrote:
> So how do i get my scripts working again? the authentication part
> was working perfectly but now it just kicks me back to the login
> page...
> 
> plus it looks like I am unable to set sessions properly, and i
> suspect thats why i am getting kicked back to the login page.

You're probably right.

This is a wild guess, but I bet register_globals is disabled on your new host.
Check the archives for lots of good information about what this means, what you
need to do, etc. This question comes up weekly, so there should be plenty of
information.

Hope that helps.

Chris

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

--- End Message ---
--- Begin Message --- I am using PHP to develop and web app.

The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply "eval" it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system.

I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc.

Any ideas on how I should proceed?

Thanks.





--- End Message ---
--- Begin Message ---
There is the tokenizer extension... http://www.php.net/tokenizer

This might give you a good start.

--
Peter James
[EMAIL PROTECTED]

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


----- Original Message ----- 
From: "Nikhil G. Daddikar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 26, 2003 1:06 AM
Subject: [PHP] Parsing PHP


> I am using PHP to develop and web app.
> 
> The app also has a scripting language for the *end user*. I was thinking 
> if I could expose a very simple subset of PHP to them (foreach, 
> if-then-else, variable assignments and comments) and then simply "eval" 
> it. But I don't want them to use calls like system or do infinite loops 
> etc. that will screw up the system.
> 
> I was thinking if I had a PHPparser that returns tokens, then I can 
> eliminate the call to unwanted funtions, etc.
> 
> Any ideas on how I should proceed?
> 
> Thanks.
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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

There are a number of choices already out there. In phpDocumentor (http://www.phpdoc.org) is a parser that is based on the tokenizer. Also available in PEAR CVS is the PHP_Parser, which is a generated parser based on PHP's own zend_language_parser.y (http://cvs.php.net/cvs.php/pear/PHP_Parser?login=2)

Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org

Nikhil G. Daddikar wrote:
I am using PHP to develop and web app.

The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply "eval" it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system.

I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc.

Any ideas on how I should proceed?

Thanks.







--- End Message ---
--- Begin Message ---
Hi there!

What's the best way to create uids (unique ids) even when runnig at
exactly same time (microseconds)?

is this enough ???

$r = mt_rand();
$uid = uniqid(getmypid() . $r);

thanks

Jan



--- End Message ---

Reply via email to