php-general Digest 26 Mar 2001 06:43:51 -0000 Issue 589
Topics (messages 45501 through 45582):
Re: URL parsing
45501 by: Jaxon
45505 by: CC Zona
45507 by: Jaxon
45511 by: Philip Olson
45553 by: Jaxon
45556 by: Aaron Tuller
45557 by: Jaxon
[PHP4] $fp = fopen( "news.txt", 'a' ); // 'a' = append! Wah!
45502 by: Dddogbruce \(.home.com\)
45503 by: Jack Dempsey
45504 by: Dddogbruce \(.home.com\)
45506 by: Dddogbruce \(.home.com\)
45509 by: Richard
45510 by: Joe Brown
45515 by: Dddogbruce \(.home.com\)
45517 by: Joe Brown
45518 by: Dddogbruce \(.home.com\)
45519 by: Dddogbruce \(.home.com\)
45522 by: Joe Brown
45523 by: Dddogbruce \(.home.com\)
45524 by: Dddogbruce \(.home.com\)
45530 by: Dddogbruce \(.home.com\)
rewind
45508 by: Jack Dempsey
45512 by: Dddogbruce \(.home.com\)
finding primary key with oci8
45513 by: almir
script filename?
45514 by: Kurth Bemis
45516 by: Philip Olson
45525 by: Kurth Bemis
Re: Sendmail
45520 by: Chris Anderson
45545 by: Atet Sugiharto
getting numeric index of array
45521 by: Christian Dechery
45534 by: CC Zona
How to jump 7 rows in array
45526 by: Christian Dechery
drop down used to redirect?
45527 by: duirfire
45565 by: Data Driven Design
A few questions...
45528 by: Chris Cocuzzo
45532 by: Jaxon
45536 by: Chris Cocuzzo
45537 by: Jaxon
45540 by: Chris Cocuzzo
45543 by: Jaxon
'How to jump..' part 2
45529 by: Christian Dechery
45548 by: David Robley
Requesting username/pwd with apache and aqcuiring input
45531 by: NoSpeed
45533 by: Jaxon
45535 by: NoSpeed
PHP and MySQL insert problem
45538 by: Pinwang Chao
Decrypt Function?
45539 by: Chris Anderson
45541 by: Opec Kemp \( Ozemail \)
45544 by: Stephan Ahonen
45546 by: Valter Santos
45554 by: Chris Anderson
Making a function/method private
45542 by: Reuben D Budiardja
Re: ImageTTFText()
45547 by: David Robley
Re: I need an expert to tell me what I am doing wrong
45549 by: David Robley
45551 by: trogers
Re: I want to execute a cgi
45550 by: David Robley
about:home
45552 by: JCampbell
45578 by: Felix Kronlage
Re: oracle last inserted
45555 by: Chien-pin Wang
Re: reading microsoft word document text in php?
45558 by: David Robley
array in cookie . . .
45559 by: PHPretard
The ubitquitous forum project
45560 by: Kath
45561 by: Stephan Ahonen
45563 by: Gfunk
45564 by: Kath
45566 by: Matt Stone
45575 by: Felix Kronlage
45576 by: Matt Stone
45577 by: Matt Stone
Re: reading microsoft word, excel, pdf document text
45562 by: Erick Papadakis
45567 by: Reinke Bonte
45568 by: Erick Papadakis
45570 by: David Robley
45571 by: Reinke Bonte
Cookie problem
45569 by: Martin Skjöldebrand
45573 by: Nuno Silva
Re: Delaying Printed Output
45572 by: Andrew Braund
imap_open() dosen't work :(
45574 by: Nilesh Parmar
Random letter/number passwords
45579 by: Matt Stone
45580 by: Matt Stone
multiple record out put
45581 by: Peter Houchin
45582 by: David Robley
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]
----------------------------------------------------------------------
Any way to combine both forms of url parsing?
I want to use standard slash notation for navigation ,but also account for
the occasional variable used within a single page.
e.g. URL can be either:
domain.com/index.php/main/index.html?ii=1
or:
domain.com/index.php/main/index.html?ii=1
if (isset($ii) // how do I grab value and truncate $REQUEST_URI
$path_array = explode('/', $REQUEST_URI);
$page_name = array_pop($path_array); //get page name from end of array
$page_type = array_pop($path_array); //get page type from next item
best regards,
jaxon
On 3/23/01 9:09 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote:
> super easy.
>
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
>
> then loop through the elements and do what you need, you might need
> to use strtok() if you're expecting slashes in your arguments.
>
> -aaron
>
> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>> how about parsing a url from passing variables like :
>> test.php/op/3/op2/6/pagename.html
>>
>> cannot this be parsed, to let search engines spider past the "?" properly?
>>
>> regards,
>> jaxon
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Jaxon) wrote:
> Any way to combine both forms of url parsing?
> I want to use standard slash notation for navigation ,but also account for
> the occasional variable used within a single page.
>
> e.g. URL can be either:
> domain.com/index.php/main/index.html?ii=1
>
> or:
> domain.com/index.php/main/index.html?ii=1
Umm, how are these different?
(If you're trying to extract info from a url, perhaps
parse_url(),basename(), and/or dirname() are what you're seeking...?)
--
CC
oops :)
http://www.domain.com/index.php/main/index.html?ii=1
versus
http://www.domain.com/index.php/main/index.html
I want to get "index.html" and "main" into variables, as the two items will
always be present - if $ii is set, I want to strip it from the URI before
parsing the items out.
I suppose with parse_url() I could do something..but I really only want to
deal with the URI.
currently, this seems to work:
$path_array = explode('/', $REQUEST_URI);
if (isset($ii)) array_pop($path_array); // remove $ii
$page_name = array_pop($path_array); //get page name from end of array
$tpl = array_pop($path_array); //get page type from next item
but is inelegant :)
regards,
jaxon
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Jaxon) wrote:
>
>> Any way to combine both forms of url parsing?
>> I want to use standard slash notation for navigation ,but also account for
>> the occasional variable used within a single page.
>>
>> e.g. URL can be either:
>> domain.com/index.php/main/index.html?ii=1
>>
>> or:
>> domain.com/index.php/main/index.html?ii=1
>
> Umm, how are these different?
>
> (If you're trying to extract info from a url, perhaps
> parse_url(),basename(), and/or dirname() are what you're seeking...?)
Hi!
Check out these two related articles (and user comments) :
Building Dynamic Pages With Search Engines in Mind :
--------------------------------------------------------
* http://phpbuilder.com/columns/tim19990117.php3
* http://phpbuilder.com/columns/tim20000526.php3
Also check phpinfo() for available predefined variables and plan
accordingly.
Predefined Variables :
--------------------------------------------------------
* http://www.php.net/manual/en/language.variables.predefined.php
And for the brave, check out mod_rewrite :
Mod-Rewrite :
--------------------------------------------------------
* http://httpd.apache.org/docs/mod/mod_rewrite.html
* http://www.engelschall.com/pw/apache/rewriteguide/
* http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
Regards,
Philip Olson
http://www.cornado.com/
On Sun, 25 Mar 2001, Jaxon wrote:
> oops :)
>
> http://www.domain.com/index.php/main/index.html?ii=1
> versus
> http://www.domain.com/index.php/main/index.html
>
> I want to get "index.html" and "main" into variables, as the two items will
> always be present - if $ii is set, I want to strip it from the URI before
> parsing the items out.
>
> I suppose with parse_url() I could do something..but I really only want to
> deal with the URI.
>
> currently, this seems to work:
>
> $path_array = explode('/', $REQUEST_URI);
>
> if (isset($ii)) array_pop($path_array); // remove $ii
> $page_name = array_pop($path_array); //get page name from end of array
> $tpl = array_pop($path_array); //get page type from next item
>
> but is inelegant :)
>
> regards,
> jaxon
>
> > In article <[EMAIL PROTECTED]>,
> > [EMAIL PROTECTED] (Jaxon) wrote:
> >
> >> Any way to combine both forms of url parsing?
> >> I want to use standard slash notation for navigation ,but also account for
> >> the occasional variable used within a single page.
> >>
> >> e.g. URL can be either:
> >> domain.com/index.php/main/index.html?ii=1
> >>
> >> or:
> >> domain.com/index.php/main/index.html?ii=1
> >
> > Umm, how are these different?
> >
> > (If you're trying to extract info from a url, perhaps
> > parse_url(),basename(), and/or dirname() are what you're seeking...?)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
K, read em all, and understood more than I thought I :)
I still don't see how you can 'sanitize' a URI, eg discard anything
including and after "//" or "??". I think this is needed if you want to
discard a query string or irregular syntax from your URI.
ereg's don't work reliably, due to the possibility of special chars in the
URI.
regards,
jaxon
On 3/25/01 3:18 PM, "Philip Olson" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Check out these two related articles (and user comments) :
>
> Building Dynamic Pages With Search Engines in Mind :
> --------------------------------------------------------
> * http://phpbuilder.com/columns/tim19990117.php3
> * http://phpbuilder.com/columns/tim20000526.php3
>
> Also check phpinfo() for available predefined variables and plan
> accordingly.
>
> Predefined Variables :
> --------------------------------------------------------
> * http://www.php.net/manual/en/language.variables.predefined.php
>
> And for the brave, check out mod_rewrite :
>
> Mod-Rewrite :
> --------------------------------------------------------
> * http://httpd.apache.org/docs/mod/mod_rewrite.html
> * http://www.engelschall.com/pw/apache/rewriteguide/
> * http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
>
>
> Regards,
>
> Philip Olson
> http://www.cornado.com/
>
>
why can't you str_replace the $QUERY_STRING frm the $REQUEST_URI?
give an example of what you are trying to do? (I'm sorry if you did
and I missed it)
-aaron
At 9:06 PM -0500 3/25/01, Jaxon wrote:
>K, read em all, and understood more than I thought I :)
>
>
>I still don't see how you can 'sanitize' a URI, eg discard anything
>including and after "//" or "??". I think this is needed if you want to
>discard a query string or irregular syntax from your URI.
>
>ereg's don't work reliably, due to the possibility of special chars in the
>URI.
>
>regards,
>jaxon
>
>On 3/25/01 3:18 PM, "Philip Olson" <[EMAIL PROTECTED]> wrote:
>
>> Hi!
>>
>> Check out these two related articles (and user comments) :
>>
>> Building Dynamic Pages With Search Engines in Mind :
>> --------------------------------------------------------
>> * http://phpbuilder.com/columns/tim19990117.php3
>> * http://phpbuilder.com/columns/tim20000526.php3
>>
>> Also check phpinfo() for available predefined variables and plan
>> accordingly.
>>
>> Predefined Variables :
>> --------------------------------------------------------
>> * http://www.php.net/manual/en/language.variables.predefined.php
>>
>> And for the brave, check out mod_rewrite :
>>
>> Mod-Rewrite :
>> --------------------------------------------------------
>> * http://httpd.apache.org/docs/mod/mod_rewrite.html
>> * http://www.engelschall.com/pw/apache/rewriteguide/
>> * http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
>>
>>
>> Regards,
>>
>> Philip Olson
>> http://www.cornado.com/
>>
>>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
whups, sorry - here is the example:
I want to turn URI's like:
/script.php/main/index.html?junk=junk
/script.php/main/index.html//
/script.php/main/index.html??
all into:
/script.php/main/index.html
best regards,
jaxon
On 3/25/01 9:25 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote:
> why can't you str_replace the $QUERY_STRING frm the $REQUEST_URI?
>
> give an example of what you are trying to do? (I'm sorry if you did
> and I missed it)
>
> -aaron
>
> At 9:06 PM -0500 3/25/01, Jaxon wrote:
>> K, read em all, and understood more than I thought I :)
>>
>>
>> I still don't see how you can 'sanitize' a URI, eg discard anything
>> including and after "//" or "??". I think this is needed if you want to
>> discard a query string or irregular syntax from your URI.
>>
>> ereg's don't work reliably, due to the possibility of special chars in the
>> URI.
>>
>> regards,
>> jaxon
>>
>> On 3/25/01 3:18 PM, "Philip Olson" <[EMAIL PROTECTED]> wrote:
>>
>>> Hi!
>>>
>>> Check out these two related articles (and user comments) :
>>>
>>> Building Dynamic Pages With Search Engines in Mind :
>>> --------------------------------------------------------
>>> * http://phpbuilder.com/columns/tim19990117.php3
>>> * http://phpbuilder.com/columns/tim20000526.php3
>>>
>>> Also check phpinfo() for available predefined variables and plan
>>> accordingly.
>>>
>>> Predefined Variables :
>>> --------------------------------------------------------
>>> * http://www.php.net/manual/en/language.variables.predefined.php
>>>
>>> And for the brave, check out mod_rewrite :
>>>
>>> Mod-Rewrite :
>>> --------------------------------------------------------
>>> * http://httpd.apache.org/docs/mod/mod_rewrite.html
>>> * http://www.engelschall.com/pw/apache/rewriteguide/
>>> * http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite
>>>
>>>
>>> Regards,
>>>
>>> Philip Olson
>>> http://www.cornado.com/
>>>
>>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
I'm writing a news script, and I just got it working earlier this
morning. Now it writes the variables from the form to the .txt file;
but when I go to write again (another news article) it does it beside,
not above. Me, thinking so brilliantly at 6AM, thought append would
mean above, but it means beside. This is the script in working
condition, although it only writes one varibale since I was testing.
I'm not using mysql, only a .txt file and two PHP documents.
<?
if( $formSubmit )
{
echo "Your news has been processed.";
$newsSubmit = file( "news.txt" );
$fp = fopen( "news.txt", 'a' );
fwrite( $fp, $frmName );
fclose( $fp );
}
else
{
include ( "newsForm.php" );
}
?>
What I want it to do is post $frmName in the .txt file, and when another
entry is processed it will add that above. I hope this is possible,
because I don't have access to a MySQL database *yet.*
Post all suggestions, please.
-Owen
i believe there was a post about 10 messages ago regarding this same
problem--try fseek:
http://www.php.net/manual/en/function.fseek.php
-jack
-----Original Message-----
From: Dddogbruce (@home.com) [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 25, 2001 1:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] [PHP4] $fp = fopen( "news.txt", 'a' ); // 'a' = append!
Wah!
I'm writing a news script, and I just got it working earlier this
morning. Now it writes the variables from the form to the .txt file;
but when I go to write again (another news article) it does it beside,
not above. Me, thinking so brilliantly at 6AM, thought append would
mean above, but it means beside. This is the script in working
condition, although it only writes one varibale since I was testing.
I'm not using mysql, only a .txt file and two PHP documents.
<?
if( $formSubmit )
{
echo "Your news has been processed.";
$newsSubmit = file( "news.txt" );
$fp = fopen( "news.txt", 'a' );
fwrite( $fp, $frmName );
fclose( $fp );
}
else
{
include ( "newsForm.php" );
}
?>
What I want it to do is post $frmName in the .txt file, and when another
entry is processed it will add that above. I hope this is possible,
because I don't have access to a MySQL database *yet.*
Post all suggestions, please.
-Owen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks for the quick reply, looking in to it!
Ok, with this fseek..
Could you give me an example of how to implement it?
You should find it on
http://www.php.net/manual/en/functions.fseek.php
Or something. There are examples that are quite clear.
- Richard
""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok, with this fseek..
>
> Could you give me an example of how to implement it?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Re-create the file. You're most of the way there.
if( $formSubmit )
{
echo "Your news has been processed.";
$filename = "news.txt";
//This is simpler than messing with an array of the original content.
$fp = fopen ($filename, "r");
$newsSubmit = fread ($fd, filesize ($filename));
fclose ($fp);
$fp = fopen( $filename, "w" ); // change append to write (a to w)
fwrite( $fp, $frmName ); //write the new
fwrite( $fp, $newsSubmit); //write the old
fclose( $fp );
}
else
{
include ( "newsForm.php" );
}
if you want to use fseek, then try this:
if( $formSubmit )
{
echo "Your news has been processed.";
$filename = "news.txt";
//This is simpler than messing with an array of the original content.
$fp = fopen ($filename, "r+");
$newsSubmit = fread ($fd, filesize ($filename));
fseek($fp,0);
fwrite( $fp, $frmName ); //write the new
fwrite( $fp, $newsSubmit); //write the old
fclose( $fp );
}
else
{
include ( "newsForm.php" );
}
""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok, with this fseek..
>
> Could you give me an example of how to implement it?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
When you say $newsSubmit = fread ($fd, filesize ($filename));
Do you mean specify the filename? $news.txt then?
Take a closer look at the previous message I sent $filename was defined as:
$filename="news.txt";
""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> When you say $newsSubmit = fread ($fd, filesize ($filename));
>
> Do you mean specify the filename? $news.txt then?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Oh. Duh! Thanks. ;P
Joe Brown wrote:
> Take a closer look at the previous message I sent $filename was defined as:
> $filename="news.txt";
>
> ""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > When you say $newsSubmit = fread ($fd, filesize ($filename));
> >
> > Do you mean specify the filename? $news.txt then?
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
$fp = fopen ($filename, "r");
$newsSubmit = fread ($fd, filesize ($filename));
These are giving me a parse error:
Warning: Supplied argument is not a valid File-Handle resource in
C:/XITAMI/owen/website/php/newsSubmit.php on line 10
maybe spinning the 'd' in $fd 180 degrees to make it a p will help...
Sorry, haven't tried this myself, typo's happen.
heh, I'm still trying to compile php 4 windows :-( been hoping for a
helping hand.
""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $fp = fopen ($filename, "r");
> $newsSubmit = fread ($fd, filesize ($filename));
>
> These are giving me a parse error:
> Warning: Supplied argument is not a valid File-Handle resource in
> C:/XITAMI/owen/website/php/newsSubmit.php on line 10
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
I'm such a pest. <g>
Ok, it wrote, but didn't write above.. *grins*
Ok, I'll get this eventually. <groan>
someone was asking about fseek...try this:
http://www.php.net/manual/en/function.rewind.php
i haven't tried it, but it seems to return the pointer to the beginning,
which is where you wanted...
-jack
Thanks! :)
Jack Dempsey wrote:
> someone was asking about fseek...try this:
> http://www.php.net/manual/en/function.rewind.php
>
> i haven't tried it, but it seems to return the pointer to the beginning,
> which is where you wanted...
>
> -jack
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
is there any why to find out from php with oci8 functionen , which colomn/s
is/are primary key in a table in oracle
almir
i was pretty sure that there was a function to return JUST the script
filename.. Unlike $php_self and $script_name i need something that till
ruturn JUST the scriptname. ie /test/test/blah.php returns blah.php.
any ideas? or am i going to have to reverse the string find the first "/"
drop the rest of the string and return the file name. :-)
~kurth
Hi Kurth,
Check out basename() and use it against a predefined variable such as
SCRIPT_NAME. Example :
// /apples/foo.php?fruit=apple
print basename($SCRIPT_NAME); // foo.php
Be sure to check out :
http://www.php.net/manual/en/language.variables.predefined.php
http://www.php.net/manual/en/function.basename.php
Also check phpinfo() to view how your server deals with such things.
Regards,
Philip Olson
http://www.cornado.com/
On Sun, 25 Mar 2001, Kurth Bemis wrote:
> i was pretty sure that there was a function to return JUST the script
> filename.. Unlike $php_self and $script_name i need something that till
> ruturn JUST the scriptname. ie /test/test/blah.php returns blah.php.
>
> any ideas? or am i going to have to reverse the string find the first "/"
> drop the rest of the string and return the file name. :-)
>
> ~kurth
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
At 03:53 PM 3/25/2001, Philip Olson wrote:
thank you - that was the function that i was looking for!
~kurth
>Hi Kurth,
>
>Check out basename() and use it against a predefined variable such as
>SCRIPT_NAME. Example :
>
>// /apples/foo.php?fruit=apple
>
> print basename($SCRIPT_NAME); // foo.php
>
>Be sure to check out :
>
> http://www.php.net/manual/en/language.variables.predefined.php
> http://www.php.net/manual/en/function.basename.php
>
>Also check phpinfo() to view how your server deals with such things.
>
>
>Regards,
>
>Philip Olson
>http://www.cornado.com/
>
>On Sun, 25 Mar 2001, Kurth Bemis wrote:
>
> > i was pretty sure that there was a function to return JUST the script
> > filename.. Unlike $php_self and $script_name i need something that till
> > ruturn JUST the scriptname. ie /test/test/blah.php returns blah.php.
> >
> > any ideas? or am i going to have to reverse the string find the first "/"
> > drop the rest of the string and return the file name. :-)
> >
> > ~kurth
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
it would help if you showed a snippet of your mail code
----- Original Message -----
From: "Atet Sugiharto" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 24, 2001 1:49 AM
Subject: [PHP] Sendmail
> Hi ,
>
> I'm at a loss....I've searched throught the knowledgebase, archives, docs,
> etc but I can't figure out what's going on. The problem is when using the
> mail() function nothing gets send and I don't get any error messages
either.
> It's like the message gets eaten by a black hole.
>
> I already put "-t -i" in the path, but still doesn't work ..
> Anybody can help me ?
>
> Regards,
>
> Atet Sugiharto
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
Dear All,
I put the code like this :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Email</title>
</head>
<body bgcolor="FEEBCC" link="#800000" vlink="#800000"" leftmargin="0"
topmargin="0" marginheight="0" marginwidth="0">
<?php
$to = '[EMAIL PROTECTED]';
$from = '[EMAIL PROTECTED]';
$body = " Hello World\r\n";
$headers = "From: $from\r\n";
$headers .= "Reply-To: $from\r\n";
$success = mail($to, "Posted " . date("m/d/Y"), $body, $headers);
if
uccess){
echo "<B><CENTER>Thank you for your input</CENTER></B>\n";
}
else{
echo "Error \n";
}
?>
</body>
</html>
I've try to put this code to another server and it's work.
I really lost to figure out what's wrong with my configuration (I'm new in PHP too..)
Thanks for all answer ...
regards,
Atet
>it would help if you showed a snippet of your mail code
>----- Original Message -----
>From: "Atet Sugiharto" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, March 24, 2001 1:49 AM
>Subject: [PHP] Sendmail
>
>
>> Hi ,
>>
>> I'm at a loss....I've searched throught the knowledgebase, archives, docs,
>> etc but I can't figure out what's going on. The problem is when using the
>> mail() function nothing gets send and I don't get any error messages
>either.
>> It's like the message gets eaten by a black hole.
>>
>> I already put "-t -i" in the path, but still doesn't work ..
>> Anybody can help me ?
>>
>> Regards,
>>
>> Atet Sugiharto
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>
I wanna get the numeric index for a multi-dimensional associative array...
I have like
$myArray = array(
"one" => "something",
"two" => "otherthing",
"three" => "whatever"
);
I want to, given the key (or value), it returns me the numeric index for
that ocurrence... examples:
given "one" -> returns 0
given "whatever" -> returns 2
given "two" -> returns 1
given "four" -> returns NULL or false...
anyone?
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Christian Dechery) wrote:
> $myArray = array(
> "one" => "something",
> "two" => "otherthing",
> "three" => "whatever"
> );
>
> I want to, given the key (or value), it returns me the numeric index for
> that ocurrence... examples:
>
> given "one" -> returns 0
> given "whatever" -> returns 2
> given "two" -> returns 1
> given "four" -> returns NULL or false...
http://php.net/manual/en/function.array-search.php
(It's only avaliable in PHP4 CVS so far, but see the annotations for
examples of user functions to do the same thing.)
--
CC
I'm loading a set of txt files into a DB. The first 7 lines of each file
are useless to me...
I want some way I can always jump those 7 lines... I tought of doing a
little function like jumpfirstsevenrows(array), but then I'd have to pass
the whole array as parameter and that can get real memory consuming for
such a small task. I'll have arrays with more than 100.000 lines...
since there are pointers in PHP, I'm lost... I don't wanna have to get the
same 'for bla bla bla code' in each and every function that processes this
file (there is one function per file, more then 20 overall)...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer
Hi, can anyone point me towards an example of how to use a drop down select
as a navigation jump, maybe by sending a redirect header?
thanks!
duirfire
You can do it with javascript like this.
<script language="javascript">
function go(selectBox) {
var where = selectBox.options[selectBox.selectedIndex].value;
if (where != "") window.location = where;
}
</script>
<form>
<select onchange="go(this)">
<option value="page.html">Page</option>
...
Or you can use PHP like this.
<form action="nav.php" method="post">
<select name="loc">
<option value="page.html">page</option>
...
--- nav.php ---
<?php
header("Location:$loc");
?>
----- Original Message -----
From: duirfire <[EMAIL PROTECTED]>
To: PHP User Group <[EMAIL PROTECTED]>
Sent: Sunday, March 25, 2001 2:39 PM
Subject: [PHP] drop down used to redirect?
>
> Hi, can anyone point me towards an example of how to use a drop down
select
> as a navigation jump, maybe by sending a redirect header?
>
> thanks!
> duirfire
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
hey-
Alright I noticed that question about URL parsing. I could've sworn I saw
some article on PHPBuilder.com that said that instead of doing all that
modifying with apache, you could simply write something to change the URL
with '?' and '&' and '=' so that they symbols could be represented using a
simple /, does anyone remember seeing it?...
In any case, I'll ask, what would be the best way to do this with
scripting, something like str_replace() or perhaps a regular expression to
both modify the URL and then allow pages using that modified URL to
recognized the variable/value pairs? Or is that even possible?
My other question is this: Sometimes I notice URL's where it looks like
this, http://www.whatever.com/?blah=blah&d=d, or
http://www.whatever.com/local?name=name&d=d. How is that done, where there
is no file extension after the file name, or no file name at all, just a
question mark directly after the slash?
thanks
Chris
Chris,
a few answers :)
On 3/25/01 5:43 PM, "Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:
> hey-
>
> Alright I noticed that question about URL parsing. I could've sworn I saw
> some article on PHPBuilder.com that said that instead of doing all that
> modifying with apache, you could simply write something to change the URL
> with '?' and '&' and '=' so that they symbols could be represented using a
> simple /, does anyone remember seeing it?...
dunno - think it's in the php.ini?
>
> In any case, I'll ask, what would be the best way to do this with
> scripting, something like str_replace() or perhaps a regular expression to
> both modify the URL and then allow pages using that modified URL to
> recognized the variable/value pairs? Or is that even possible?
You could... I'm hacking through using:
$path_array = explode('/', $REQUEST_URI);
$last_item = array_pop($path_array);
$next_to_last_item = array_pop($path_array); / item
only drawback is the positional stuff is fixed.
now I am trying to figure out how to generate my hrefs in the page to have a
matching structure....
>
> My other question is this: Sometimes I notice URL's where it looks like
> this, http://www.whatever.com/?blah=blah&d=d, or
> http://www.whatever.com/local?name=name&d=d. How is that done, where there
> is no file extension after the file name, or no file name at all, just a
> question mark directly after the slash?
probably the a .htaccess or apache.conf directive:
<Location /local>
ForceType application/x-httpd-php3
</Location>
This would send everything to a script called "local".
This is from: http://phpbuilder.com/columns/tim19990117.php3
hth,
regards,
jaxon
>
> thanks
> Chris
>
I think I just slightly unsure of how that explode() function works in this
situation...could you clarify further?
chris
-----Original Message-----
From: Jaxon [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 25, 2001 6:06 PM
To: [EMAIL PROTECTED]; PHP General List (E-mail)
Subject: Re: [PHP] A few questions...
Chris,
a few answers :)
On 3/25/01 5:43 PM, "Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:
> hey-
>
> Alright I noticed that question about URL parsing. I could've sworn I saw
> some article on PHPBuilder.com that said that instead of doing all that
> modifying with apache, you could simply write something to change the URL
> with '?' and '&' and '=' so that they symbols could be represented using a
> simple /, does anyone remember seeing it?...
dunno - think it's in the php.ini?
>
> In any case, I'll ask, what would be the best way to do this with
> scripting, something like str_replace() or perhaps a regular expression to
> both modify the URL and then allow pages using that modified URL to
> recognized the variable/value pairs? Or is that even possible?
You could... I'm hacking through using:
$path_array = explode('/', $REQUEST_URI);
$last_item = array_pop($path_array);
$next_to_last_item = array_pop($path_array); / item
only drawback is the positional stuff is fixed.
now I am trying to figure out how to generate my hrefs in the page to have a
matching structure....
>
> My other question is this: Sometimes I notice URL's where it looks like
> this, http://www.whatever.com/?blah=blah&d=d, or
> http://www.whatever.com/local?name=name&d=d. How is that done, where there
> is no file extension after the file name, or no file name at all, just a
> question mark directly after the slash?
probably the a .htaccess or apache.conf directive:
<Location /local>
ForceType application/x-httpd-php3
</Location>
This would send everything to a script called "local".
This is from: http://phpbuilder.com/columns/tim19990117.php3
hth,
regards,
jaxon
>
> thanks
> Chris
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Chris,
> I think I just slightly unsure of how that explode() function works in this
> situation...could you clarify further?
>
>>
>> $path_array = explode('/', $REQUEST_URI);
>>
>> $last_item = array_pop($path_array);
>> $next_to_last_item = array_pop($path_array); / item
>>
$REQUEST_URI contains the non-domin path (the URI) - it's a predefined
variable like $PHP_SELF, etc
http://www.php.net/manual/en/language.variables.predefined.php
in this explode() example, the '/' is the devider, so if you have
http://www.somedomain.com/dir1/dir2/dir3/somepage3.php
The URI is: /dir1/dir2/dir3/somepage3.php
and 'exploding' divides that into array elements (dir1, dir2, dir3,
somepage.php)
regards,
jaxon
right. ok I understand that explode function. But what I'm asking is not so
much once I have a URL in the form of /something/something/something
...etc.., but more if I have a URL like /something?d=a&f=g, to make it like
/something/d/a/f/g ... do you know what I mean?
Chris
-----Original Message-----
From: Jaxon [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 25, 2001 6:32 PM
To: [EMAIL PROTECTED]; PHP General List (E-mail)
Subject: Re: [PHP] A few questions...
Chris,
> I think I just slightly unsure of how that explode() function works in
this
> situation...could you clarify further?
>
>>
>> $path_array = explode('/', $REQUEST_URI);
>>
>> $last_item = array_pop($path_array);
>> $next_to_last_item = array_pop($path_array); / item
>>
$REQUEST_URI contains the non-domin path (the URI) - it's a predefined
variable like $PHP_SELF, etc
http://www.php.net/manual/en/language.variables.predefined.php
in this explode() example, the '/' is the devider, so if you have
http://www.somedomain.com/dir1/dir2/dir3/somepage3.php
The URI is: /dir1/dir2/dir3/somepage3.php
and 'exploding' divides that into array elements (dir1, dir2, dir3,
somepage.php)
regards,
jaxon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
while a bit ugly, you could just use array_pop() to get each item into a
variable and then echo them back out into your variable assignment...
somewhat cleaner would be to create an assoc array of config vars:
$uri_items_num=count($path_array);
for ($i=1, $i <= $uri_items_num, $i++)
{
$key=array_pop($path_array);
$value=array_pop($path_array);
config_array[$key] = $value
}
or something.
regards,
jaxon
On 3/25/01 6:54 PM, "Chris Cocuzzo" <[EMAIL PROTECTED]> wrote:
> right. ok I understand that explode function. But what I'm asking is not so
> much once I have a URL in the form of /something/something/something
> ...etc.., but more if I have a URL like /something?d=a&f=g, to make it like
> /something/d/a/f/g ... do you know what I mean?
>
>
> Chris
>
> -----Original Message-----
> From: Jaxon [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 25, 2001 6:32 PM
> To: [EMAIL PROTECTED]; PHP General List (E-mail)
> Subject: Re: [PHP] A few questions...
>
>
> Chris,
>
>> I think I just slightly unsure of how that explode() function works in
> this
>> situation...could you clarify further?
>>
>>>
>>> $path_array = explode('/', $REQUEST_URI);
>>>
>>> $last_item = array_pop($path_array);
>>> $next_to_last_item = array_pop($path_array); / item
>>>
> $REQUEST_URI contains the non-domin path (the URI) - it's a predefined
> variable like $PHP_SELF, etc
>
> http://www.php.net/manual/en/language.variables.predefined.php
>
> in this explode() example, the '/' is the devider, so if you have
>
> http://www.somedomain.com/dir1/dir2/dir3/somepage3.php
>
> The URI is: /dir1/dir2/dir3/somepage3.php
>
> and 'exploding' divides that into array elements (dir1, dir2, dir3,
> somepage.php)
>
> regards,
> jaxon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Regarding my last email (about jumping the first 7 rows of an array)...
why does this code doesnt work?
for(reset($array),$count=0;$count<6;next($array),$count++);
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer
On Mon, 26 Mar 2001 08:25, Christian Dechery wrote:
> Regarding my last email (about jumping the first 7 rows of an array)...
>
> why does this code doesnt work?
>
> for(reset($array),$count=0;$count<6;next($array),$count++);
> ____________________________
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
I don't think PHP will understand commas as command separators.
Perhaps what you could try is a simple loop 0 to 6 and for each iteration
of the loop, unset the corresponding array element
for($i=0; $i <= 6; $i++) {
unset($array[$i];
}
Better still if you have PHP4, use array_shift to pop the first however
many elements from the front of the array.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
Hi
I wondered if it was possible in PHP to let it pop up a screen which
reqcuires username/pwd from the visitor, just like you can tell apache to do
so with the .htaccess files.
And if yes, how to retrieve the input from the user ?
--
- NoSpeed
------------------------------------------------------
- Carpe Noctem
"The stickers on the side of the box said "Supported Platforms: Windows 98,
Windows NT 4.0, Windows 2000 or better", so clearly Linux was a supported
platform."
check this out:
http://www.zend.com/zend/tut/authentication.php
regards,
jaxon
On 3/25/01 5:59 PM, "NoSpeed" <[EMAIL PROTECTED]> wrote:
> Hi
>
> I wondered if it was possible in PHP to let it pop up a screen which
> reqcuires username/pwd from the visitor, just like you can tell apache to do
> so with the .htaccess files.
>
> And if yes, how to retrieve the input from the user ?
>
> --
> - NoSpeed
> ------------------------------------------------------
> - Carpe Noctem
>
> "The stickers on the side of the box said "Supported Platforms: Windows 98,
> Windows NT 4.0, Windows 2000 or better", so clearly Linux was a supported
> platform."
>
>
Wow, great !! Just what I was looking for !
Thanks :))))
--
- NoSpeed
------------------------------------------------------
- Carpe Noctem
"The stickers on the side of the box said "Supported Platforms: Windows 98,
Windows NT 4.0, Windows 2000 or better", so clearly Linux was a supported
platform."
"Jaxon" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| check this out:
| http://www.zend.com/zend/tut/authentication.php
|
| regards,
| jaxon
|
|
| On 3/25/01 5:59 PM, "NoSpeed" <[EMAIL PROTECTED]> wrote:
|
| > Hi
| >
| > I wondered if it was possible in PHP to let it pop up a screen which
| > reqcuires username/pwd from the visitor, just like you can tell apache
to do
| > so with the .htaccess files.
| >
| > And if yes, how to retrieve the input from the user ?
| >
| > --
| > - NoSpeed
| > ------------------------------------------------------
| > - Carpe Noctem
| >
| > "The stickers on the side of the box said "Supported Platforms: Windows
98,
| > Windows NT 4.0, Windows 2000 or better", so clearly Linux was a
supported
| > platform."
| >
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
Can any one help me with the following problem?
I have a very simple query:
...
$sql="insert into tt (a, b) values ('1', '2')";
$result=mysql_query($sql);
...
I always got the following error message when I run it from my browser.
Warning: MySQL: Unable to save result set in /usr/local/apache/htdocs/tt.php
on line 9
But even with this message, the values are still inserted into tt.
When I change $sql to &sql="select * from tt";
There were no such error message.
It puzzled me? Why?
My system: PHP 4.0.4pl1, MySQL 3.23.32
Thanks in advance.
Is there any way to decrypt dat encrypted using the crypt function? If not, then what
purpose does that function have?
Unix "Crypt" function is a one way encrypytion algorithm therefore you
can not technically decrupted as such. The way that you can check to
see if the given uncrypted value is equals to its crypted value is to
1) Crypt the string with the same "salt"
2) Compare this with the crypted version
If these 2 are the same then you assume that the 2 strings are equal.
If you really want to "decrypt" the string i.e. turn the encrypted
version into its original readable text then you'll have to use
Mcrypt() functions in PHP instead (if you have PHP 4 and above ).
There are also other Encrytion functions available, check in the
manual:
http://www.php.net/manual/en/ref.mcrypt.php
> -----Original Message-----
> From: Chris Anderson [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 24, 2001 8:44 AM
> To: PHP
> Subject: [PHP] Decrypt Function?
>
>
> Is there any way to decrypt dat encrypted using the crypt
> function? If not, then what purpose does that function have?
>
<< Is there any way to decrypt dat encrypted using the crypt function? If
not, then what purpose does that function have? >>
Crypt cannot be decrypted. One use of the function is for storing passwords
on a server where people can access them. If you crypt the passwords before
you store them on the server, nobody can see the actual passwords. Now when
someone tries to login with one of those passwords, you crypt the password
he enters, compare it with the version on the server, and if they match,
it's the right password.
Sig for a Day
Stephan Ahonen, ICQ 491101
"That's very funny Scotty, now beam down my clothes!"
Come back tomorrow for a different sig!
Backspace a single "s" to reply by email
> Is there any way to decrypt dat encrypted using the crypt
> function? If not, then what purpose does that function have?
Encrypt data! ;)
crypt is a one-way finction, it produces a hash from some
plain text, and its result is suitable to store sensitive
data in database, like passwords...
If you want to store information that you want to get back to
the initial state (plain text) you should not use crypt() or
md5()...
If you only want to store encrypted passwords crypt is enought..
When you want to confirm that a inputed text is equals to the
stored and encrypted password, you just have to encrypt the inputed text
and compare it with the previously stored password...
............................................
Valter Santos
WEB/WAP Consultant
Email : [EMAIL PROTECTED]
Mobile: +351 93 9650075
WeDo Consulting - http://www.wedo.pt
............................................
> -----Original Message-----
> From: Chris Anderson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 23, 2001 10:44 PM
> To: PHP
> Subject: [PHP] Decrypt Function?
>
>
> Is there any way to decrypt dat encrypted using the crypt
> function? If not, then what purpose does that function have?
>
Ahhhh, I see. Thank youthat is actually a great idea. Why didn't I think of
that?
/me hits himself in the head
----- Original Message -----
From: "Opec Kemp ( Ozemail )" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, March 25, 2001 6:57 PM
Subject: RE: [PHP] Decrypt Function?
> Unix "Crypt" function is a one way encrypytion algorithm therefore you
> can not technically decrupted as such. The way that you can check to
> see if the given uncrypted value is equals to its crypted value is to
>
> 1) Crypt the string with the same "salt"
> 2) Compare this with the crypted version
>
> If these 2 are the same then you assume that the 2 strings are equal.
> If you really want to "decrypt" the string i.e. turn the encrypted
> version into its original readable text then you'll have to use
> Mcrypt() functions in PHP instead (if you have PHP 4 and above ).
> There are also other Encrytion functions available, check in the
> manual:
>
> http://www.php.net/manual/en/ref.mcrypt.php
>
>
> > -----Original Message-----
> > From: Chris Anderson [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, March 24, 2001 8:44 AM
> > To: PHP
> > Subject: [PHP] Decrypt Function?
> >
> >
> > Is there any way to decrypt dat encrypted using the crypt
> > function? If not, then what purpose does that function have?
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
Hi all,
I know that we can't make a class method or variable private in php (I hope
this get improved sometimes). But, I'm wondering if anyone has found a
smart way to limit that only a certain file can call the function/method
from another file.
Say, I have the file function_def.inc that has a whole bunch of function in
it. I want to make it private. I want that only the file wrapper.inc can
use the function inside function.def, by including it.
If I have another file, say application.php, and I include function_def.inc
in application.php, I want that application.php still cannot use any
function defined in function_def.inc.
Can I do that? If there is a way to do that, maybe there is a way to make
some method in a class private by the putting it in certain file, using
this same analogy. I want to do that because I'm developing an API/Wrapper
for other developers, and I want to make some methods/functions private,
for security reason.
Thanks for any help.
Reuben D. Budiardja
On Sun, 25 Mar 2001 08:52, Paulo Vinícius Vitto Ruthes wrote:
> folks,
> i installed php4 by a RPM, it wasn't compiled --enable-gd-imgstrttf ,
> so, when I use a function like
> ImageTTFText(), it returns me the text mirrowed (inverted like a
> mirror) and the angulation doesn't work right...
> but, when I try to compile the tar.gz php installation,
> it don't let me compile because can't find libgd.*
> not in /usr /usr/lib... can anybody give me a really good reason for
> this not working?
1) You don't have libgd installed?
2) You have it somewhere else like /usr/local/lib?
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
On Sat, 24 Mar 2001 11:07, YoBro wrote:
> What could I possibly be doing wrong here. The information just will
> not insert into my database.
> ARGH!
>
> Please help if you can...
>
> <?php
>
> $user = "xyz";
> $pass = "123";
>
>
> //Connect to Database xyz
> $db = mysql_connect("localhost", $user, $pass)OR DIE("Unable to connect
> to database");
>
> mysql_select_db("xyz",$db) OR DIE("Unable to connect to database");
>
> $sql = ("INSERT INTO orders VALUES
> 'product,name,email'($product,$name,$email)");
> $result = mysql_query($sql);
echo mysql_error();
> echo "Order for the $product has been sent";
>
>
> ?>
I think you got the solution to your problem, but for future debugging
you might want to add the line above which will spit out a meaningful
error message. You could of course combine that with mysql_errno() for
some error handling branching.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
Hi
what you need is:
$sql = "INSERT INTO orders (product,name,email)
: VALUES ('$product','$name','$email')";
You will also need to escape any single quotes in the variables
Tom
At 01:05 PM 24/03/01 +1200, YoBro wrote:
>I have tried that, and I have been reading all sorts of info and been
>copying it exact, but it still doesn't work. I am not receiving any errors,
>but the data just doesn't appear in the database. I have the table set up
>and it all works fine in phpMyAdmin, but I cant get my own form to work.
>
>There is a page called order.php with a form that on submit goes to the
>discussed page. All field variables are correct. Any other ideas.
>
>: You don't say where the failure is, but I'm guessing its when you do the
>: mysql_query. Your INSERT statement looks a bit odd.
>: Try:
>:
>: $sql = "INSERT INTO orders (product,name,email)
>: VALUES ($product,$name,$email)";
>:
>: John
>:
>:
>:
>: --
>: PHP General Mailing List (http://www.php.net/)
>: To unsubscribe, e-mail: [EMAIL PROTECTED]
>: For additional commands, e-mail: [EMAIL PROTECTED]
>: To contact the list administrators, e-mail: [EMAIL PROTECTED]
>:
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Sat, 24 Mar 2001 14:58, Brandon Orther wrote:
> Hello,
>
> I have a cgi that I run in telnet by doing this:
>
> perl /script/cgi-script.cgi name=cgi+script purpose=test
>
> is there a way I can run a cgi script and pass it variables?
>
> Thanks
> Brandon
Check the Program execution functions; exec, system or the backtick
operator should do what you want.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
I know it is possible to redirect a user to their home page, but is it possible to
determine what home page they are using?
On Sun, Mar 25, 2001 at 09:02:53PM -0500, JCampbell wrote:
> I know it is possible to redirect a user to their home page,
> but is it possible to determine what home page they are using?
you might be able to access this value from within javascript (not sure
on this).
Don't think it's possible with php.
-fkr
--
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0
|http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE |
|all your base are belong to us | shame on me | fkr@IRCnet |
PGP signature
If you use sequence to generate your last_inserted_id, then you can always
get that ID by calling
SELECT sequence_name.CURRVAL
FROM DUAL;
within the same session.
Chien-pin
On Sun, 25 Mar 2001, almir wrote:
> is there a way to get last inserted id from oracle as
> mysql_inerted_id() or
> SELECT @@IDENTITY AS LastId
> in mssql server
>
> i have a function that does only that, takes insert statement and returns
> last id, but this function have to work for all tables (different triggers
> in oracle) , right now the only thing i can imagine is to give this function
> the name of ID column and read name of table with regex and then do
> select max(parametar_id) from regex_table
> and then to do commit ,
> this way is somehow realy stupid but is my only solution in this moment so
> if you have any better ideas plese help
>
> almir
>
>
>
>
On Sat, 24 Mar 2001 01:08, Erick Papadakis wrote:
> actually, i am not sure how i can use this to convert an uploaded word
> or pdf file into plain text and then do somethign with that text? can
> someone please help?
>
> thanks/erick
Well, presumably you would use system or somesuch to run whatever it is;
you may want to place the output in a file or capture it from stdout to
do 'something' with it. Can you be a little more specific on what you are
using and what you want to do?
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
Im trying to get an array saved in a cookie, I have this snippet so far..
<?
if (newuser == yes) {
$user_reg[0]= $username;
$user_reg[1]= $password;
$user_reg[2]= $fullname;
$user_reg[3]= $email;
$user_reg[4]= $age;
setcookie ("user_reg" , $user_reg, time() + 360 * 86400);
$done_message = "thankyou, $user_reg[0].";
}else{
$done_message = $sign_form;
}
?>
$username and the others vars are coming from a form submitted.
did I write this ok?
is there a limit to how much I can save in the array ?
Thanx
amd
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
I guess I'm doing another rite of passage for a PHP programmer: The forum
Any advice?
I did code forums once before, but they were rather rudimentary (No OOP, poorly
written, no DB abstraction).
- Kath
> Any advice?
USENET style threads. I *really* hate Phorum-style threads, where
everything's just tacked onto the end. Though Phorum-style is easier, it
really detracts from the conversation when you have to write whose post
you're replying to in your replies.
Sig for a Day
Stephan Ahonen, ICQ 491101
"That's very funny Scotty, now beam down my clothes!"
Come back tomorrow for a different sig!
Backspace a single "s" to reply by email
What's the difference between newsgroup-style and phorum style threads?
I'm always doing messageboards, and this thread got my attention
----------------------------------------------------------------------------
Gfunk - [EMAIL PROTECTED]
http://www.gfunk007.com/
----------------------------------------------------------------------------
----- Original Message -----
From: "Stephan Ahonen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 1:46 PM
Subject: Re: [PHP] The ubitquitous forum project
> > Any advice?
>
> USENET style threads. I *really* hate Phorum-style threads, where
> everything's just tacked onto the end. Though Phorum-style is easier, it
> really detracts from the conversation when you have to write whose post
> you're replying to in your replies.
>
> Sig for a Day
> Stephan Ahonen, ICQ 491101
> "That's very funny Scotty, now beam down my clothes!"
> Come back tomorrow for a different sig!
> Backspace a single "s" to reply by email
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
I think what he means is this:
This is newsgroup style:
+ Main Post
|
| ----- Reply 1
|
| --- Reply 1 to Reply 1
| --- Reply 2 to Reply 1
|
| --- Reply 1 to Reply 2 to Reply 1
|
| ----- Reply 2
( I hope that formatted ok)
This is phorum style:
+ Main Post
- Reply 1
- Reply 2
- Reply 3
- Reply 4
I'm partial to phorum style, myself.
- Kath
----- Original Message -----
From: "Gfunk" <[EMAIL PROTECTED]>
To: "Stephan Ahonen" <[EMAIL PROTECTED]>; "PHP User Group"
<[EMAIL PROTECTED]>
Sent: Sunday, March 25, 2001 10:48 PM
Subject: Re: [PHP] The ubitquitous forum project
> What's the difference between newsgroup-style and phorum style threads?
>
> I'm always doing messageboards, and this thread got my attention
>
> --------------------------------------------------------------------------
--
> Gfunk - [EMAIL PROTECTED]
> http://www.gfunk007.com/
> --------------------------------------------------------------------------
--
>
>
> ----- Original Message -----
> From: "Stephan Ahonen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 26, 2001 1:46 PM
> Subject: Re: [PHP] The ubitquitous forum project
>
>
> > > Any advice?
> >
> > USENET style threads. I *really* hate Phorum-style threads, where
> > everything's just tacked onto the end. Though Phorum-style is easier, it
> > really detracts from the conversation when you have to write whose post
> > you're replying to in your replies.
> >
> > Sig for a Day
> > Stephan Ahonen, ICQ 491101
> > "That's very funny Scotty, now beam down my clothes!"
> > Come back tomorrow for a different sig!
> > Backspace a single "s" to reply by email
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
I dont like any of them, the UBB style is the best.
-----Original Message-----
From: Kath [mailto:[EMAIL PROTECTED]]
Sent: Monday, 26 March 2001 2:02 PM
To: Gfunk; Stephan Ahonen; PHP User Group
Subject: Re: [PHP] The ubitquitous forum project
I think what he means is this:
This is newsgroup style:
+ Main Post
|
| ----- Reply 1
|
| --- Reply 1 to Reply 1
| --- Reply 2 to Reply 1
|
| --- Reply 1 to Reply 2 to Reply 1
|
| ----- Reply 2
( I hope that formatted ok)
This is phorum style:
+ Main Post
- Reply 1
- Reply 2
- Reply 3
- Reply 4
I'm partial to phorum style, myself.
- Kath
----- Original Message -----
From: "Gfunk" <[EMAIL PROTECTED]>
To: "Stephan Ahonen" <[EMAIL PROTECTED]>; "PHP User Group"
<[EMAIL PROTECTED]>
Sent: Sunday, March 25, 2001 10:48 PM
Subject: Re: [PHP] The ubitquitous forum project
> What's the difference between newsgroup-style and phorum style threads?
>
> I'm always doing messageboards, and this thread got my attention
>
> --------------------------------------------------------------------------
--
> Gfunk - [EMAIL PROTECTED]
> http://www.gfunk007.com/
> --------------------------------------------------------------------------
--
>
>
> ----- Original Message -----
> From: "Stephan Ahonen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 26, 2001 1:46 PM
> Subject: Re: [PHP] The ubitquitous forum project
>
>
> > > Any advice?
> >
> > USENET style threads. I *really* hate Phorum-style threads, where
> > everything's just tacked onto the end. Though Phorum-style is easier, it
> > really detracts from the conversation when you have to write whose post
> > you're replying to in your replies.
> >
> > Sig for a Day
> > Stephan Ahonen, ICQ 491101
> > "That's very funny Scotty, now beam down my clothes!"
> > Come back tomorrow for a different sig!
> > Backspace a single "s" to reply by email
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Mon, Mar 26, 2001 at 02:11:46PM +1000, Matt Stone wrote:
> I dont like any of them, the UBB style is the best.
what's UBB-style like?
-fkr
--
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0
|http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE |
|all your base are belong to us | shame on me | fkr@IRCnet |
PGP signature
Like so http://www.planetveggie.com/ubb-bin/Ultimate.cgi?action=intro
Basically
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
say I click on topic 5 then
Topic 5
Post 1
Post 1
Post 1
Post 1
-----Original Message-----
From: Felix Kronlage [mailto:[EMAIL PROTECTED]]
Sent: Monday, 26 March 2001 2:52 PM
To: Matt Stone
Cc: PHP User Group
Subject: Re: [PHP] The ubitquitous forum project
On Mon, Mar 26, 2001 at 02:11:46PM +1000, Matt Stone wrote:
> I dont like any of them, the UBB style is the best.
what's UBB-style like?
-fkr
--
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0
|http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE |
|all your base are belong to us | shame on me | fkr@IRCnet |
See http://www.planetveggie.com/ubb-bin/Ultimate.cgi?action=intro
Basically it is like:
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
When I click on topic 5 I get:
Topic 5:
Post 1
Post 2
Post 3
Post 4
Post 5
See for yourself.
-----Original Message-----
From: Felix Kronlage [mailto:[EMAIL PROTECTED]]
Sent: Monday, 26 March 2001 2:52 PM
To: Matt Stone
Cc: PHP User Group
Subject: Re: [PHP] The ubitquitous forum project
On Mon, Mar 26, 2001 at 02:11:46PM +1000, Matt Stone wrote:
> I dont like any of them, the UBB style is the best.
what's UBB-style like?
-fkr
--
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0
|http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE |
|all your base are belong to us | shame on me | fkr@IRCnet |
hi david,
thanks for the note. ok, here is what i want to do. i
want my users to upload WORD, XLS, PPT and PDF files.
when they upload, i store these files in the temp
directory, grab the text from them, and then put it
into my database for later searching. i dont care
about the formatting, i only care about the text
because i need the keywords later for searching.
can i run some sort of a parser on the server side
like the wvware.com's word parser and just call it
through php? i have not been able to figure out how to
do this using php.
i would really appreciate any ideas and suggestions!
thanks/erick
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
Hey Erick,
unfortunately I know little about this myself, but I'm sure, this article
will help you as a starting point.
http://www.phpbuilder.com/columns/alain20001003.php3
Good luck
-ren
----- Original Message -----
From: "Erick Papadakis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 11:50 AM
Subject: Re: [PHP] reading microsoft word, excel, pdf document text
> hi david,
>
> thanks for the note. ok, here is what i want to do. i
> want my users to upload WORD, XLS, PPT and PDF files.
> when they upload, i store these files in the temp
> directory, grab the text from them, and then put it
> into my database for later searching. i dont care
> about the formatting, i only care about the text
> because i need the keywords later for searching.
>
> can i run some sort of a parser on the server side
> like the wvware.com's word parser and just call it
> through php? i have not been able to figure out how to
> do this using php.
>
> i would really appreciate any ideas and suggestions!
>
> thanks/erick
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
hi renike,
thanks for that link, but looks like that tutorial
will only work on windows machines (because of COM
objects)?
i am on a linux box.
cheers/erick
--- Reinke Bonte <[EMAIL PROTECTED]> wrote:
> Hey Erick,
>
> unfortunately I know little about this myself, but
> I'm sure, this article
> will help you as a starting point.
>
> http://www.phpbuilder.com/columns/alain20001003.php3
>
>
> Good luck
>
>
> -ren
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
On Mon, 26 Mar 2001 13:20, Erick Papadakis wrote:
> hi david,
>
> thanks for the note. ok, here is what i want to do. i
> want my users to upload WORD, XLS, PPT and PDF files.
> when they upload, i store these files in the temp
> directory, grab the text from them, and then put it
> into my database for later searching. i dont care
> about the formatting, i only care about the text
> because i need the keywords later for searching.
>
> can i run some sort of a parser on the server side
> like the wvware.com's word parser and just call it
> through php? i have not been able to figure out how to
> do this using php.
>
> i would really appreciate any ideas and suggestions!
>
> thanks/erick
OK - do you have the relevant parsers? There are specific (Unix) tools
available for PDF (pdftotext or acrobat reader) and Word; I mentioned
some of that in an earlier mail. For Excel you could probably use (Unix
again) just the Unix command strings to get the text - same might work
for Powerpoint but if some dipstick has created a graphics-only
presentation you won't get much that's useful.
As I mentioned previously, you'll probably want to run the parser[s] from
PHP using one of the Program execution functions; exec, system or the
backtick operator should do what you want. How you capture the output
will of course depend on how the output is delivered - see the docs for
the particular parser.
None of the above is probably relevant if your server is Windows.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
As far as I know, you can do very little in this respect on a non-windows
machine without some programming in a lower generation language. Don't you
have a windows machine somewhere in your network? Just pass it on to that
machine, and let it do this work. I personally would prefer doing this in
perl.
-ren
----- Original Message -----
From: "Erick Papadakis" <[EMAIL PROTECTED]>
To: "Reinke Bonte" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 12:26 PM
Subject: Re: [PHP] reading microsoft word, excel, pdf document text
> hi renike,
>
> thanks for that link, but looks like that tutorial
> will only work on windows machines (because of COM
> objects)?
>
> i am on a linux box.
>
>
> cheers/erick
>
>
>
> --- Reinke Bonte <[EMAIL PROTECTED]> wrote:
> > Hey Erick,
> >
> > unfortunately I know little about this myself, but
> > I'm sure, this article
> > will help you as a starting point.
> >
> > http://www.phpbuilder.com/columns/alain20001003.php3
> >
> >
> > Good luck
> >
> >
> > -ren
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
I'm experiencing all kinds of problems with, what we suppose is the cookie
setting. This is the code:
if (isset($authentication)) {
setcookie("status", $status, time()+600);
setcookie("user", $user, time()+600);
setcookie("group", $group, time()+600);
setcookie("authentication", $authentication, time()+600);
setcookie("laston", $laston, time()+600);
}
else {
setcookie("status", "Logged In", time()+600);
setcookie("user", $txtUsername, time()+600);
setcookie("group", $row[4], time()+600);
setcookie("authentication", "YES", time()+600);
setcookie("laston", $row[6], time()+600);
}
(I have not coded this).
What seems to happen is that - with alarming regularity - people are
getting logged off when choosing item from a menu. Either they are thrown
out into the log on-screen or (as has happened to me recently) the app
simply states I'm not logged on even if I am in the middle of using it (and
must have logged on).
I'm not at all familiar with cookies (yet) but suspect that the timing of
the critters could be a culprit. IS this correct?
How do I solve the problem?
M.
Hello,
short:
try removing the third parameter to setcookie and if the errors go away
you know it's a cookie problem :)
long:
you're setting auth based in the (server's) time + 600sec. If the client
(or even the server) has a clock skew... well.... bad luck :)
removing the third parameter makes php create a "session cookie" that
will stay there until the browser is closed (alll the windows).
If this is not a problem, let it be. I love session cookies!! :)
Anyway, the best method to get decent auth are sessions. Try php4's
sessions or phplib or something.
Regards,
Nuno
Martin Skjöldebrand wrote:
> I'm experiencing all kinds of problems with, what we suppose is the cookie
> setting. This is the code:
>
> if (isset($authentication)) {
> setcookie("status", $status, time()+600);
> setcookie("user", $user, time()+600);
> setcookie("group", $group, time()+600);
> setcookie("authentication", $authentication, time()+600);
> setcookie("laston", $laston, time()+600);
> }
> else {
> setcookie("status", "Logged In", time()+600);
> setcookie("user", $txtUsername, time()+600);
> setcookie("group", $row[4], time()+600);
> setcookie("authentication", "YES", time()+600);
> setcookie("laston", $row[6], time()+600);
> }
>
> (I have not coded this).
>
> What seems to happen is that - with alarming regularity - people are
> getting logged off when choosing item from a menu. Either they are thrown
> out into the log on-screen or (as has happened to me recently) the app
> simply states I'm not logged on even if I am in the middle of using it (and
> must have logged on).
>
> I'm not at all familiar with cookies (yet) but suspect that the timing of
> the critters could be a culprit. IS this correct?
> How do I solve the problem?
>
> M.
This topic comes up from time to time...
Some previous information, if you get any further please post it to the list.
A while ago I saw a web page explaining a system (written in Perl I
think) that was used to show a presentation to a number of different
sites simultaneously (and synchronised). A presenter was at the main
site and the browsers at 4 other remote sites would display the same
page the presenter was viewing on his web browser as he went to various
sites. I think it worked using multipart Content-type.
Unfortunately I have lost the URL to the explanation of how it was
done.
On Saturday, 5 August 2000 8:48 AM Mr Bruce Christensen posted the following links
explaining browser push;
http://home.netscape.com/assist/net_sites/pushpull.html
and;
As for keeping the connection from timing out, see
http://www.php.net/manual/function.set-time-limit.php.
I have experimented with this but didn't get too far. I posted the following to the
PHP list but didn't get any reply.
I have tried the following script on
WinNT5, Apache/1.3.13-dev, PHP Version 4.0.1pl2
and
OpenBSD2.7 Apache/1.3.12, PHP Version 4.0.1pl2 (mod_php4)
push.php;
----------8<-------snip-----------8<------start
<?php
header("HTTP/1.0 200 OK");
header("Content-type:
multipart/x-mixed-replace;boundary=ThisRandomString");
print("\n");
print( "--ThisRandomString\n");
print("Content-type: text/html\n");
print("\n");
print( "First update at ");
echo date("H:i:s");
print("\n\n");
print( "--ThisRandomString\n");
flush();
sleep(5);
print("Content-type: text/html\n");
print("\n");
print( "Second update at ");
echo date("H:i:s");
print("\n\n");
print("--ThisRandomString--\n");
?>
----------8<-------snip-----------8<------end
On NT with the
header("HTTP/1.0 200 OK");
statement I get an Apache error message;
[Sun Aug 06 09:02:47 2000] [error] [client 192.168.0.60] malformed
header from script. Bad header=HTTP/1.0 200 OK: f:/program files
/novato/allcnet/php.exe
I do not get this error on OpenBSD.
I then removed the
header("HTTP/1.0 200 OK");
statement and now NT and OpenBSD give the following output
to the browser(IE5.0);
(after a 5 second pause)
----------8<-------snip-----------8<------start
--ThisRandomString
Content-type: text/html
First update at 18:22:47
--ThisRandomString
Content-type: text/html
Second update at 18:22:52
--ThisRandomString
----------8<-------snip-----------8<------end
And the following output to the browser(Netscape 4.6);
(after a 5 second pause)
----------8<-------snip-----------8<------start
Second update at 18:23:19
----------8<-------snip-----------8<------end
ie With Netscape I never see the
first update at ...
part of the output as I would expect.
I have also tried it with;
header("Content-type: multipart/mixed;boundary=ThisRandomString");
but it makes no difference, the behaviour is identical.
IE5 does not seem to understand multipart.
The multipart mime boundary does not seem to be working properly in
Netscape4.6.
Regards
Andrew Braund
> -----Original Message-----
> From: Greg Scott [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, 25 March 2001 04:49
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Delaying Printed Output
>
>
> > You might try using flush() after the prints.
> >
> I tried that too, but at least in Netscape 6, it still waits until
> everything is done before displaying. I think Jack must be correct that
> this isn't possible for browser display.
>
> Thanks,
> Greg
Hi Gurus :)
I have installed php4.0.4 on my windows 98 machine with apache .I am having
a problem while calling te imap_open() function.I get the following error.I
get this error also with Linux.(Redhat 7.0).
**********************************************
Call to undefined function: imap_open() in c:\Program Files\apache
group\apache\htdocs\imap.php
***********************************************
Do I require to configure any file or change any settings ?
Can anyone figure out what is the problem.I can however telnet successfully
to my imap server.
Thanx in advance
Nilesh Parmar
Hi,
I have this code below which is supposed to be generating a password like
QCCQCN2-IUZ with 10 characters - All but three in the first section (7) and
three in the last part - but does not work in all cases. Sometimes it prints
LPSA3WD-IM or G22G2G9-FC.
Is there a catch in the code that will stuff up in certain circumstances?
Please help,
Matt stone
____________________________________________________________________________
_______
<?php
function randomGen($length, $status) {
$all = explode( " ",
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "
. "0 1 2 3 4 5 6 7 8 9");
$allend = explode( " ",
"A B C D E F G H I J K L M N O P Q R S T U V W X Y
Z");
for($i=0;$i<$length;$i++) {
srand((double)microtime()*time());
$randy = (($status)? rand(0, count($all)) : rand(0, count($allend)));
$pass .= (($status)? $all[$randy] : $allend[$randy]);
}
return $pass;
}
function randomPassword($length = 8) {
$passfirst = randomGen($length-3, 1);
$passend = randomGen(4, 0);
$pass = $passfirst.'-'.$passend;
return $pass;
}
for($i;$i<10;$i++){
$new_random = randomPassword(10);
echo "$new_random<br>";
}
?>
Oops sorry, this line is supposed to read:
$passfirst = randomGen($length-3, 1);
>>$passend = randomGen(3, 0);
$pass = $passfirst.'-'.$passend;
return $pass;
-----Original Message-----
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Monday, 26 March 2001 4:12 PM
To: PHPlist
Subject: [PHP] Random letter/number passwords
Hi,
I have this code below which is supposed to be generating a password like
QCCQCN2-IUZ with 10 characters - All but three in the first section (7) and
three in the last part - but does not work in all cases. Sometimes it prints
LPSA3WD-IM or G22G2G9-FC.
Is there a catch in the code that will stuff up in certain circumstances?
Please help,
Matt stone
____________________________________________________________________________
_______
<?php
function randomGen($length, $status) {
$all = explode( " ",
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "
. "0 1 2 3 4 5 6 7 8 9");
$allend = explode( " ",
"A B C D E F G H I J K L M N O P Q R S T U V W X Y
Z");
for($i=0;$i<$length;$i++) {
srand((double)microtime()*time());
$randy = (($status)? rand(0, count($all)) : rand(0, count($allend)));
$pass .= (($status)? $all[$randy] : $allend[$randy]);
}
return $pass;
}
function randomPassword($length = 8) {
$passfirst = randomGen($length-3, 1);
$passend = randomGen(4, 0);
$pass = $passfirst.'-'.$passend;
return $pass;
}
for($i;$i<10;$i++){
$new_random = randomPassword(10);
echo "$new_random<br>";
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hiya,
I'm creating a page where the user can select multiple options to query the DB with i
am at the moment i can't get more than 1 record to display from the db at all. If any
one could offer soem suggestions i would be very grateful
<?
//db connect info above
if ($Submit) {
$rs = "SELECT * FROM machine WHERE avail='y' AND system='$system'";
$result = mysql_query($rs);
$system = mysql_result($result, 0, 'system');
$serial = mysql_result($result, 0, 'serial');
$availe = mysql_result($result, 0, 'avail');
echo "$system $serial $avail";
}
echo mysql_error();
?>
<form name="machine" method="get" action="<? echo $PHP_SELF;?> ">
<table width="463" border="1">
<tr>
<td width="21%">MODEL</td>
<td colspan="2">Config</td>
<td width="14%"> Available </td>
<td width="12%">Weekly</td>
<td width="14%">Monthly</td>
</tr>
<tr>
<td width="21%">
<select name="system" size="3" multiple>
<option value="sparc 5">Sparc 5</option>
<option value="sparc 20">Sparc 20</option>
<option value="ultra_1">Ultra 1</option>
<option value="ultra 2">Ultra 2</option>
<option value="ultra 5">Ultra 5</option>
<option value="ultra 10">Ultra 10</option>
</select>
<input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table> <br>
<br>
</form>
Peter Houchin
[EMAIL PROTECTED]
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************
On Mon, 26 Mar 2001 15:50, Peter Houchin wrote:
> Hiya,
>
> I'm creating a page where the user can select multiple options to
> query the DB with i am at the moment i can't get more than 1 record to
> display from the db at all. If any one could offer soem suggestions i
> would be very grateful
>
>
> <?
> //db connect info above
> if ($Submit) {
> $rs = "SELECT * FROM machine WHERE avail='y' AND system='$system'";
> $result = mysql_query($rs);
> $system = mysql_result($result, 0, 'system');
> $serial = mysql_result($result, 0, 'serial');
> $availe = mysql_result($result, 0, 'avail');
> echo "$system $serial $avail";
> }
> echo mysql_error();
>
> ?>
> <form name="machine" method="get" action="<? echo $PHP_SELF;?> ">
> <table width="463" border="1">
> <tr>
> <td width="21%">MODEL</td>
> <td colspan="2">Config</td>
> <td width="14%"> Available </td>
> <td width="12%">Weekly</td>
> <td width="14%">Monthly</td>
> </tr>
> <tr>
> <td width="21%">
> <select name="system" size="3" multiple>
> <option value="sparc 5">Sparc 5</option>
> <option value="sparc 20">Sparc 20</option>
> <option value="ultra_1">Ultra 1</option>
> <option value="ultra 2">Ultra 2</option>
> <option value="ultra 5">Ultra 5</option>
> <option value="ultra 10">Ultra 10</option>
> </select>
> <input type="submit" name="Submit" value="Submit">
>
> </td>
> </tr>
> </table> <br>
> <br>
> </form>
You have several problems here; first is that the name of your 'select
multiple' box should be system[] in order to be able to pass ALL the
selected items - otherwise you only get the last one selected.
That will then give you an array named system, which you'll need to parse
and break up into a query like
WHERE ... system = '$system[0]' OR system = '$system[1] ... OR system =
'$system[n]'
Lastly, you seem to have omitted the loop to cycle through all the rows
of your result set ;-(
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA