|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Subject: php3 Digest 26 Mar 2000 17:59:42 -0000 Issue 1563
From: php3-digest-help
lists.php.netDate: Sun Mar 26 2000 - 11:59:42 CST
- Next message: php3-digest-help
lists.php.net: "php3 Digest 27 Mar 2000 05:59:39 -0000 Issue 1564"
- Previous message: php3-digest-help
lists.php.net: "php3 Digest 26 Mar 2000 05:59:45 -0000 Issue 1562"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php3 Digest 26 Mar 2000 17:59:42 -0000 Issue 1563
Topics (messages 82870 through 82902):
PHP Code Ignored
82870 by: Ola Svensson <eastnet
public.bta.net.cn>
User Authentication
82871 by: "Jason Cox" <jasonc
webpipe.net>
pop3 via imap_open
82872 by: Alex Bischoff <abischof
vt.edu>
Code Work fine in IE 5 but wont in NETSCAPE4
82873 by: Gustavo Souza <administrator
ajato.com.br>
82876 by: "Brad Schuetz" <brad
cimmeria.com>
82877 by: "NickM" <terado
hotmail.com>
82890 by: Gustavo Souza <administrator
ajato.com.br>
82891 by: Rouvas Stathis <rouvas
di.uoa.gr>
resizing images
82874 by: "Goofiness.Com" <hans
goofiness.com>
error while starting httpd
82875 by: pankaj <vasu_sh
hotmail.com>
Header() problem
82878 by: Gurkan Nisanci <nisanci
Bilkent.EDU.TR>
82882 by: Nik Gare <nik
cheddarcheese.de>
82889 by: Jim Jagielski <jim
jaguNET.com>
Variable keeping
82879 by: Gurkan Nisanci <nisanci
Bilkent.EDU.TR>
String search in a file
82880 by: "Christian Maier" <maier.christian
planet-interkom.de>
UTC to CET to SET
82881 by: ZioBudda <michel
michel.enter.it>
Random order in MySQL
82883 by: Lemming <ian
lemnet.com>
82884 by: "James Moore" <James
Prospect-enterprises.co.uk>
82885 by: Lemming <ian
lemnet.com>
Securing mod_php
82886 by: Sickboy <sd209
hszk.bme.hu>
82902 by: Perry J. Blalock <badger
pongo.org>
HTTP_POST_VARS empty?
82887 by: Glenn Davy <glenn
pip.com.au>
82888 by: "James Moore" <James
Prospect-enterprises.co.uk>
PHP as CGI. Trying to call it from another script
82892 by: "Alexey V. Meledin" <avm
webclub.ru>
82893 by: Alex Belits <abelits
phobos.illtel.denver.co.us>
82896 by: "Alexey V. Meledin" <avm
webclub.ru>
82901 by: "Alexey V. Meledin" <avm
webclub.ru>
Strange problem...
82894 by: "WL" <will
lukrative.com>
Help with PHP4!
82895 by: Victor Gamov <vit
lipetsk.ru>
A XML tree and some transformations
82897 by: Kristian Khntopp <kris
koehntopp.de>
82899 by: Kristian Khntopp <kris
koehntopp.de>
This might sound like a weird question....
82898 by: "T.R. Henigson" <ted
3bits.com>
Tracking Users
82900 by: "WL" <will
lukrative.com>
Administrivia:
To subscribe to the digest, e-mail:
php3-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php3-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php3
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I have the following line as the only line in a .htaccess file:
AddType application/x-hpptd-php php3 html
in order for .php3 extension files as well as .html extension
files to be treated equally.
However, what happens is that a box is opened in my browser
for saving the files. It seems that neither the .php3 files nor
the .html files are parsed. What did I do wrong?
Ola Svensson
attached mail follows:
Yeah, I guess you're right. I neve intended this to be a secure way of
doing things, just an easy, non-cookie way. I definitely wouldn't use it to
protect anything worth hacking into.
-jason
-----Original Message-----
From: Brian T. Allen [mailto:brian
purenetfx.com]
Sent: Saturday, March 25, 2000 7:04 PM
To: Jason Cox; php3
lists.php.net
Subject: Re: [PHP3] User Authentication
The only disadvantage with relying solely on this is that ~from what I
understand~ $HTTP_REFERER is quite easy to spoof (I would like to know more
about this, if anyone is an expert. Is it a real issue?). That would make
disabling this security farely easy, ~IF~ you knew that this was the method
being used, ~AND~ you knew one of the valid URL's.
Brian Allen
brian
purenetfx.com
>
> An obvious disadvantage with cookies is that people can disable them.
> (These are the same people who hoarded food for Y2K.) I've done it
another
> way which might be slower but doesn't require cookies or session data. I
> have a login that authenticates against a db then redirects to a specified
> page. Then I have an array containing all the "controlled" pages that
gets
> checked against $HTTP_REFERER. So all the pages are virtually linked
> together. If someone tries to access a page without being refered from
the
> login or another controlled page, the get redirected to the login. The
only
> drawback is that every page that is to be controlled, needs a require()
> statement which means it needs to be parsed. Can anyone see any other
> disadvantages of doing it this way? If you'd like to see the code, go to
> www.lilbuddy.org.
>
> Regards,
> Jason Cox
>
> -----Original Message-----
> From: Niklas Alberth [mailto:niklas-list
netdata.nu]
> Sent: Saturday, March 25, 2000 2:03 PM
> To: php3
> Subject: Re: [PHP3] User Authentication
>
>
> Hi
>
> I wrote some simple logged in user thing.
>
> 1. user logs in passwordcheck agoinst db.
> 2. cookie is set with the users id and a table is updated that the user is
> logged in.
> 3. all passwordprotected pages check if the cookie is set if not I send a
> redirect.
>
> Is this a good way of implenting a login function?
>
> --Niklas
>
> ----- Original Message -----
> From: "Chuck Hagenbuch" <chagenbu
wso.williams.edu>
> To: "Henry F. Marquardt" <hank
yerpso.net>
> Cc: "Jeff Wilhelm" <jeffwilhelm
hotmail.com>; <php3
lists.php.net>
> Sent: Saturday, March 25, 2000 9:27 PM
> Subject: Re: [PHP3] User Authentication
>
>
> > Quoting Henry F. Marquardt <hank
yerpso.net>:
> >
> > > *Simple* sessions usually rely on cookies ... if you look at phplib
and
> > > the extensibility of the php4 model (and a lot of other home grown
> sessions
> > > models) you'll see that anything serious relies on a db backend for
> > > management.
> >
> > This is a very misleading statement. There are two things you need with
a
> > session: a session identifier that tells you which client is which, and
a
> > session storage mechanism that stores the session data.
> >
> > Almost everyone uses cookies to store the first (the id) if possible,
and
> > mechanisms like phplib let you fall back to appending the session id
> (which
> > bears no relation to the username and password) to the URL.
> >
> > However, phplib, php4, and pretty much every other session solution do
> > _not_ use cookies as the storage mechanism.
> >
> > Just wanted to clear that up.
> >
> > -chuck
> >
> > --
> > Charles Hagenbuch, <chagenbu
wso.williams.edu>
> > --
> > may kittens pounce in your dreams
> >
> > --
> > PHP 3 Mailing List <http://www.php.net/>
> > To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> > To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> > To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> _______________________________________________________
> Site Design, Hosting, and E-Commerce at www.webpipe.net
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribelists.php.net To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin
lists.php.net
_______________________________________________________ Site Design, Hosting, and E-Commerce at www.webpipe.net
attached mail follows:
Preface: I've already read the documentation (http://www.php.net/manual/html/function.imap-open.html), and I've searched the archives on this subject.
Anyhow, I'm writing the online voting scripts for my university's Student Government Association. Most of what I'll be writing will be accessing an Access database via PHP and ODBC. However, I'm currently writing the front-end to validate students (all voters have to be students).
I'm attempting to login to our mail server on behalf of the user. Then, if the login is successful, he/she has an e-mail account and is thus a student. Partly using some example code from the link above, I made this script:
<?
$username = "my-user-name-here"; $password = "my-password-here"; $mailhost = "mail.vt.edu";
$mbox = imap_open ("{$mailhost/pop3:110}INBOX", "$username", "$password"); if ($mbox > 0) echo "Success!<P>"; if ($mbox == 0) echo "Failed!<P>";
imap_close($mbox);
echo "Finished script.<P>";
?>
However, as you can see from it in action here (http://www.sga.vt.edu/php/test-pop-success.php3), I get "Fatal error: Mailbox is empty in c:\InetPub\wwwroot\sga/php/test-pop.php3 on line 16".
So, what am I doing wrongly? All I'm trying to do is to capture the success/fail result code of the login via imap_open. I mean, it seems to be getting "success", as it should, but why the error message too?
That's not the worst of my problems, though ;). I slightly tweaked the above script -- only changing the password from my mail account's correct password to an incorrect password, to create this version (http://www.sga.vt.edu/php/test-pop-failure.php3). There, as you can see by visiting the page, the script totally dies :(. Why is PHP returning all these error messages to the "user" instead of just setting the output codes?
Alex Bischoff, KB3BZG
- - - - - - - - - - - - - - - - - - - - - - - -
mailto:abischof
vt.edu http://www.vt.edu:10021/A/abischof/
-------------------------------------------------------------------------
export-a-crypto-system-sig RSA-2-lines-PERL
print pack"C*",split/\D+/,`echo "16iII*o\U
{$/=$z;[(pop,pop,unpack"H*",<>
)]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`
-------------------------------------------------------------------------
Run a Free Program and You Could Win $1000 --> http://www.distributed.net/
attached mail follows:
ne1 can help with this code ? it works fine on IE 4, 5 but it isnt working on Netscape 4 i think its a nul variable problem but i dont know how to fix it ... please help..
GS
<form method=post action="<?php echo $PHP_SELF ?>"> <font size=3 face=arial color=#330066><b>Search by:   </b></font> <SELECT NAME="value"> <option value="id">ID <option value="name">Name <option value="icq">ICQ <option value="email">Email </select> <br><br> <input type=text name="keyword" size=35> <input type=submit value="Search"> </form><br><hr color=red height=8> <?php if($keyword){ $db=mysql_connect("localhost","guest"); mysql_select_db("union",$db); if($value==id){ $sql="SELECT * FROM players WHERE id='$keyword'"; } else if($value==name){ $sql="SELECT * FROM players WHERE name='$keyword'"; } else if($value==icq){ $sql="SELECT * FROM players WHERE icq='$keyword'"; } else{ $sql="SELECT * FROM players WHERE email='$keyword'"; } $result=mysql_query($sql); if($myrow=mysql_fetch_array($result)) { echo "<Center><font size=4 color=red face=arial><b>Result:</font>\n"; echo "<table border=1 bordercolorlight=white bordercolordark=black>\n"; echo "<tr><td>ID</td><td>Name</td><td>Email</td><td>ICQ</td></tr>\n"; do{ printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",$myrow["id"],$myrow["name"],$myrow["email"],$myrow["icq"]); }while($myrow=mysql_fetch_array($result));
} else{ echo "<center><font color=red face=arial size=4>\n"; printf("Sorry, No records were found in our database!\n"); } } ?>
attached mail follows:
One thing to remember, if something works in IE but not NS it's not going to be a PHP issue. Always look to the HTML.
In this case you simply forgot to close the <table> tag in your display after the loop.
-Brad -=brad
cimmeria.com=-
----- Original Message -----
From: "Gustavo Souza" <administrator
ajato.com.br>
To: <php3
lists.php.net>
Sent: Sunday, March 26, 2000 12:54 AM
Subject: [PHP3] Code Work fine in IE 5 but wont in NETSCAPE4
> ne1 can help with this code ? it works fine on IE 4, 5 but it isnt working
> on Netscape 4
> i think its a nul variable problem but i dont know how to fix it ...
> please help..
>
> GS
>
> <form method=post action="<?php echo $PHP_SELF ?>">
> <font size=3 face=arial color=#330066><b>Search by:   </b></font>
> <SELECT NAME="value">
> <option value="id">ID
> <option value="name">Name
> <option value="icq">ICQ
> <option value="email">Email
> </select>
> <br><br>
> <input type=text name="keyword" size=35>
> <input type=submit value="Search">
> </form><br><hr color=red height=8>
> <?php
> if($keyword){
> $db=mysql_connect("localhost","guest");
> mysql_select_db("union",$db);
> if($value==id){
> $sql="SELECT * FROM players WHERE id='$keyword'";
> }
> else if($value==name){
> $sql="SELECT * FROM players WHERE name='$keyword'";
> }
> else if($value==icq){
> $sql="SELECT * FROM players WHERE icq='$keyword'";
> }
> else{
> $sql="SELECT * FROM players WHERE email='$keyword'";
> }
> $result=mysql_query($sql);
> if($myrow=mysql_fetch_array($result))
> {
> echo "<Center><font size=4 color=red face=arial><b>Result:</font>\n";
> echo "<table border=1 bordercolorlight=white bordercolordark=black>\n";
> echo "<tr><td>ID</td><td>Name</td><td>Email</td><td>ICQ</td></tr>\n";
> do{
>
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",$myrow["id"
],$myrow["name"],$myrow["email"],$myrow["icq"]);
> }while($myrow=mysql_fetch_array($result));
>
> }
> else{
> echo "<center><font color=red face=arial size=4>\n";
> printf("Sorry, No records were found in our database!\n");
> }
> }
> ?>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Well sure you don't check that any of the values have been set. There is no reason why you will get any information from the form so you should make sure that each variable is set using the isset() command.
Secondly, what is: if($value==id){ and so on, it should either be: if($value=="id"){ or if($value==$id){
Nick
----- Original Message -----
From: "Gustavo Souza" <administrator
ajato.com.br>
To: <php3
lists.php.net>
Sent: Sunday, March 26, 2000 10:54 AM
Subject: [PHP3] Code Work fine in IE 5 but wont in NETSCAPE4
> ne1 can help with this code ? it works fine on IE 4, 5 but it isnt working
> on Netscape 4
> i think its a nul variable problem but i dont know how to fix it ...
> please help..
>
> GS
>
> <form method=post action="<?php echo $PHP_SELF ?>">
> <font size=3 face=arial color=#330066><b>Search by:   </b></font>
> <SELECT NAME="value">
> <option value="id">ID
> <option value="name">Name
> <option value="icq">ICQ
> <option value="email">Email
> </select>
> <br><br>
> <input type=text name="keyword" size=35>
> <input type=submit value="Search">
> </form><br><hr color=red height=8>
> <?php
> if($keyword){
> $db=mysql_connect("localhost","guest");
> mysql_select_db("union",$db);
> if($value==id){
> $sql="SELECT * FROM players WHERE id='$keyword'";
> }
> else if($value==name){
> $sql="SELECT * FROM players WHERE name='$keyword'";
> }
> else if($value==icq){
> $sql="SELECT * FROM players WHERE icq='$keyword'";
> }
> else{
> $sql="SELECT * FROM players WHERE email='$keyword'";
> }
> $result=mysql_query($sql);
> if($myrow=mysql_fetch_array($result))
> {
> echo "<Center><font size=4 color=red face=arial><b>Result:</font>\n";
> echo "<table border=1 bordercolorlight=white bordercolordark=black>\n";
> echo "<tr><td>ID</td><td>Name</td><td>Email</td><td>ICQ</td></tr>\n";
> do{
>
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",$myrow["id"
],$myrow["name"],$myrow["email"],$myrow["icq"]);
> }while($myrow=mysql_fetch_array($result));
>
> }
> else{
> echo "<center><font color=red face=arial size=4>\n";
> printf("Sorry, No records were found in our database!\n");
> }
> }
> ?>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
so the netscape problem is almost solved ... :) but i have one more problem...
when i do a query on IE 5 the browser just fill automatically spaces with %20 on netscape the browser just put the space on query ...
the problem is .. if i dont change SPACES by %20 i cant get query to work and the script tells me item not found ...
the problem is on : <a href='caracteristicas.php?caracteristicas=$row->car_descri' the row car_descri is text with spaces and i need to change spaces with %20 for the script to work.. ne1 can help ?
this is the full script ...
<? echo "<form method='post' action='$PHP_SELF'>"; ?> <? echo "<br> <br>
<table border=0 cellpadding=0 cellspacing=0> <tr bgcolor=black> <td><font size=2 color=white face=verdana><b>Procurar por:</b><br> <input type=text name=\"keyword\" size=18></td> <td><br><font size=2 color=white face=verdana><b><input type=radio name=\"value\" value=\"Carro\" CHECKED>Carro</b> </td></tr> <tr><td nowrap><input type=submit value=\"Procurar\"> <input type=reset value=\"Limpar\"></td> <td><font size=2 color=white face=verdana><b><input type=radio name=\"value\" value=\"Montadora\">Montadora</b> </td></tr> </form> </table> <br> <br>";
$today = date ("d/m/Y - h:i A");
if($keyword){
$db=mysql_connect("localhost","www");
mysql_select_db("tsc",$db);
if($value==Carro){$sql="SELECT * FROM full_car WHERE carro='$keyword' ORDER BY car_descri";}
else {$sql="SELECT * FROM full_car WHERE montadora='$keyword' ORDER BY car_descri";}
$result=mysql_query($sql);
/*Display Results*/
$num=mysql_numrows($result);
$i=0;
if($row=mysql_fetch_object($result))
{
echo "<br><br><center> <table border=0 cellpadding=0 cellspacing=0 width = '600'> <tr bgcolor=000000> <td align=left><font size=4 color=white face=verdana><b>Resultado da Pesquisa</b></td> <td align=right><font size=3 color=white face=verdana><sup>$today</sup></td> </tr></table>\n";
echo "<table border=0 cellpadding=2 cellspacing=0 width = '600'> <tr bgcolor=3366CC> <td width=350 align=left><font size=2 color=white face=verdana><b>Descrio</b></td> <td width=110 align=middle><font size=2 color=white face=verdana><b>Ano</b></td> <td width=140 align=right><font size=2 color=white face=verdana><b>Preo</b></td> </tr></table>\n";
do {
if ($i%2) { $color=000000; } else { $color=222222; } echo "<table border=0 cellpadding=2 cellspacing=0 width = '600'> <tr bgcolor=$color> <td width=350 align=left><font size=2 face=verdana> <a href='caracteristicas.php?caracteristicas=$row->car_descri'><LI type=disc>$row->car_descri</LI></td> <td width=110 align=middle><font size=2 color=white face=verdana>$row->ano</td> <td width=140 align=right><font size=2 color=white face=verdana>R$ $row->preco_R$row->preco_U,00</td> </tr></table>\n";
$i++;
}while($row=mysql_fetch_object($result));
}
else{
echo "<br><br><center> <table border=0 cellpadding=0 cellspacing=0 width = '600'> <tr bgcolor='FF0000'> <td align=middle><font size=4 color=white face=verdana><b>I'm sorry. There were no matches found.</b></font></td></tr> <tr bgcolor='0000FF'><td align=middle><font size=3 color=white face=verdana><b>$today</b></font></td> </tr></table></center>"; } }
?>
attached mail follows:
First of all, passing along string in URls is not generally a good idea. Use POST instead. If you absolutely have to, use javascript:escape(str); BUT, it works only for iso-latin-1. Now that I look into your code, you do use POST. Why put the desc in the href? Put an ID instead. Anyway that's how I would do it:-) -Stathis.
Gustavo Souza wrote:
>
> so the netscape problem is almost solved ... :) but i have one more problem...
>
> when i do a query on IE 5 the browser just fill automatically spaces with %20
> on netscape the browser just put the space on query ...
>
> the problem is .. if i dont change SPACES by %20 i cant get query to work
> and the script tells me item not found ...
>
> the problem is on :
> <a href='caracteristicas.php?caracteristicas=$row->car_descri'
> the row car_descri is text with spaces and i need to change spaces with %20
> for the script to work..
> ne1 can help ?
>
> this is the full script ...
>
> <? echo "<form method='post' action='$PHP_SELF'>"; ?>
> <?
> echo "<br>
> <br>
>
> <table border=0 cellpadding=0 cellspacing=0>
> <tr bgcolor=black>
> <td><font size=2 color=white face=verdana><b>Procurar por:</b><br>
> <input type=text name=\"keyword\" size=18></td>
> <td><br><font size=2 color=white face=verdana><b><input type=radio
> name=\"value\" value=\"Carro\" CHECKED>Carro</b>
> </td></tr>
> <tr><td nowrap><input type=submit value=\"Procurar\">
> <input type=reset value=\"Limpar\"></td>
> <td><font size=2 color=white face=verdana><b><input type=radio
> name=\"value\" value=\"Montadora\">Montadora</b>
> </td></tr>
> </form>
> </table>
> <br>
> <br>";
>
> $today = date ("d/m/Y - h:i A");
>
> if($keyword){
>
> $db=mysql_connect("localhost","www");
>
> mysql_select_db("tsc",$db);
>
> if($value==Carro){$sql="SELECT * FROM full_car WHERE carro='$keyword' ORDER
> BY car_descri";}
>
> else {$sql="SELECT * FROM full_car WHERE montadora='$keyword' ORDER BY
> car_descri";}
>
> $result=mysql_query($sql);
>
> /*Display Results*/
>
> $num=mysql_numrows($result);
>
> $i=0;
>
> if($row=mysql_fetch_object($result))
>
> {
>
> echo "<br><br><center>
> <table border=0 cellpadding=0 cellspacing=0 width = '600'>
> <tr bgcolor=000000>
> <td align=left><font size=4 color=white face=verdana><b>Resultado
> da Pesquisa</b></td>
> <td align=right><font size=3 color=white
> face=verdana><sup>$today</sup></td>
> </tr></table>\n";
>
> echo "<table border=0 cellpadding=2 cellspacing=0 width = '600'>
> <tr bgcolor=3366CC>
> <td width=350 align=left><font size=2 color=white
> face=verdana><b>Descrio</b></td>
> <td width=110 align=middle><font size=2 color=white
> face=verdana><b>Ano</b></td>
> <td width=140 align=right><font size=2 color=white
> face=verdana><b>Preo</b></td>
> </tr></table>\n";
>
> do {
>
> if ($i%2)
> {
> $color=000000;
> }
> else
> {
> $color=222222;
> }
> echo "<table border=0 cellpadding=2 cellspacing=0 width = '600'>
> <tr bgcolor=$color>
> <td width=350 align=left><font size=2 face=verdana>
> <a href='caracteristicas.php?caracteristicas=$row->car_descri'><LI
> type=disc>$row->car_descri</LI></td>
> <td width=110 align=middle><font size=2 color=white
> face=verdana>$row->ano</td>
> <td width=140 align=right><font size=2 color=white face=verdana>R$
> $row->preco_R$row->preco_U,00</td>
> </tr></table>\n";
>
> $i++;
>
> }while($row=mysql_fetch_object($result));
>
> }
>
> else{
>
> echo "<br><br><center>
> <table border=0 cellpadding=0 cellspacing=0 width = '600'>
> <tr bgcolor='FF0000'>
> <td align=middle><font size=4 color=white face=verdana><b>I'm
> sorry. There were no matches found.</b></font></td></tr>
> <tr bgcolor='0000FF'><td align=middle><font size=3 color=white
> face=verdana><b>$today</b></font></td>
> </tr></table></center>";
> }
> }
>
> ?>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- +-----------------------------+ |Rouvas Stathis | |University of Athens | |Department of Informatics | |http://www.di.uoa.gr/~rouvas | |rouvasdi.uoa.gr | +-----------------------------+
attached mail follows:
Jeff,
Download them to your site, use GetImageSize, then resize based on some math you do first (so that the dimensions remain in proportion).
Also, ImageCreate only works on gif. I have a system using a console app called convert (comes with ImageMagick I'm told) and Rasmus recommended something else about 10 days ago, but I'm at a loss to remember it. But convert works just fine.
Hans Anderson http://www.hansanderson.com/ http://www.goofiness.com/
On Sat, 25 Mar 2000, Jeff Schwartz wrote:
> I'm trying to resize and display images located on another site.
>
> When they're on my site, it looks like I can get the size using
> GetImageSize and create a proportionally smaller image using ImageCreate.
>
> But GetImageSize doesn't work on images on other sites so how do I get the
> image width and height to scale them and pass on to ImageCreate?
>
> Thanks,
> Jeff
>
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
i'm running redhat linux 6.0 on my PII. I installed php3 rpm (php-3.0.12-6.i386.rpm). Then i went on to compile php-3.0.15 for getting the support of ldap and apxs folowing the instructions in the INSTALL.REDHAT file. everything went fine with the installation of the rpm and the compilation of the source. i have even made the required changes in the apxs file and the httpd.conf following the instructions in your FAQ. but now when i start httpd on the computer it says Cannot load /usr/lib/apache/libphp3.so into server: /usr/lib/apache/libphp3.so: undefined symbol: ap_regexec
could you tell me what's wrong with my installation?
thanks and regards pankaj
attached mail follows:
I want to make a redirection to a web page. For this I wrote:
<html> <body> <?php Header("Location: http://www.php.net"); exit; ?> </body> </html>
But it doesn't go to http://www.php.net. It gives an error like:
Warning: Cannot add more header information - the header was already sent (header information may be added only before any output is generated from the script - check for text or whitespace outside PHP tags, or calls to functions that output text) in c:\program files\apache group\apache\htdocs\gece\dene2.php3 on line 4
What is the problem? I am using php3 in windows and apache web server. Also if this the wrong way of redirection, how can I do it?
attached mail follows:
In article <Pine.GSO.4.05.10003261330410.14679-100000
firat>, Gurkan
Nisanci <nisanci
Bilkent.EDU.TR> wrote:
> I want to make a redirection to a web page. For this I wrote:
> <html> <body> <?php Header("Location: http://www.php.net"); exit; ?> > </body> </html>
> But it doesn't go to http://www.php.net. It gives an error like:
> Warning: Cannot add more header information - the header was already > sent (header information may be added only before any output is > generated from the script - check for text or whitespace outside PHP > tags, or calls to functions that output text) in c:\program > files\apache group\apache\htdocs\gece\dene2.php3 on line 4
> What is the problem?
The header() function can only be used before any other output, so your script would look like:
<?php Header("Location: http://www.php.net"); ?>
Just leave out the <html><body> bit and all should be well. See function.header.html in the manual.
TTFN Nik
-- http://www.cheddarcheese.de
attached mail follows:
The problem is that HTML headers are the first "things" sent by the server to the browser. When PHP tags are after the HTML document's html and body tags, the opportunity to send additional headers is past. It's like when writing a letter... when you get to the "Dear Sir" part, the opportunity to add info to their address is gone: you are now in the body of the letter.
Headers (and cookies) need to be at the very start of your PHP files, so the below would be:
Header("Location: http://www.php.net");
Now PHP4 allows you to put headers inside the HTML files, but at some performance expense.
Gurkan Nisanci wrote:
>
>
> I want to make a redirection to a web page. For this I wrote:
>
> <html>
> <body>
> <?php
> Header("Location: http://www.php.net");
> exit;
> ?>
> </body>
> </html>
>
>
> But it doesn't go to http://www.php.net. It gives an error like:
>
> Warning: Cannot add more header information - the header was already sent
> (header information may be added only before any output is generated from
> the script - check for text or whitespace outside PHP tags, or calls to
> functions that output text) in c:\program files\apache
> group\apache\htdocs\gece\dene2.php3 on line 4
>
> What is the problem? I am using php3 in windows and apache web server.
> Also if this the wrong way of redirection, how can I do it?
>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- =========================================================================== Jim Jagielski [|] jimjaguNET.com [|] http://www.jaguNET.com/ "Are you suggesting coconuts migrate??"
attached mail follows:
Hi, I want to ask a question. When a user is logged into the web site, I want to keep his track while he is visiting the pages of web site. For example, if address of our site is: http://www.php.net After logging into site with a password I want to change the adreess as http://www.php.net?id=101 ( I am keeping login and passwords in a database and every user has a specific id num). How can I do such a thing? Also, this is not a secure way of keeping the track of a user. Because anyone can enter the id of another user in address line and can act like that user. How can I do such a thing in a secure form? For example id num. will be available in all the pages that the user is visiting in the site but it will not be shown in the address line. Not only id variable, but also I want to hold other variables about a user. I am using php3 and apache web server in windows environment.
attached mail follows:
Hi! How can I check if a line contains a special string and how can I replace it to another string?
Example:
$lines = count(file("file.html")); $x = 0;
$fp = fopen("file.html","r+"); do { $line = fgets($fp,4096); if (ereg("string",$line)) { fputs($fp,"other string"); } $x++; } while ($x < $lines); fclose($fp);
This example doesn't work. Why?
Thanks Chris
attached mail follows:
Hi, I have a date in UTC format, but I want to trasform it in CET format (i'm in italy). How can I make it? Idem for SET to CET Tnx in advance for all
"Non importante che tu sia crotalo o pavone, l'importante che se tu muori me lo dici prima". (Clv)
-- Michel <ZioBudda> Morelli michelenter.it ICQ UIN: 58351764
Sito WWW http://www.ziobudda.net Italian Linux FAQ http://faq.ziobudda.net Forum su Linux http://phorum.ziobudda.net
attached mail follows:
I am trying to select a series of rows from a MySQL database in a random, what I really want is to be able to send something like SELECT * FROM whatever ORDER BY RAND
It is important that every row is checked, and that no rows are checked twice. CPU use is also very important (it will be in a frequently accessed script, the one that displays banners in a banner exchange)
Any ideas?
Thanks, Lemming, LemNet Manager
http://www.lemnet.com/banners/ - Free targeted advertising
attached mail follows:
would it not be better in a banner exchange to have some sort of logical selection, eg check [http-referer] then make sure you dont pick their banner, next access a db of credits and show the banner with the most credits pending rather than being random
-- James Moore
attached mail follows:
James Moore wrote:
> would it not be better in a banner exchange to have some sort of > logical selection, > eg check [http-referer] then make sure you dont pick their banner, > next access a db of credits and show the banner with the most credits > pending rather than being random > > -- > James Moore
There is already some logical selection. It cannot show the site a's banner on site a, and it only checks people in the same zone. This should (and usually does) leave a number of posible sites. The majority of the time, HTTP-referer would be a waste of time because people visit more than one page on a site, so on all subsequent pages http-referer would refer to that actual site. I could do something similar using cookies though, I will have to think about it.
You idea about credits is good, but the number of remaining credits is not stored, rather the banners shown and used are. I feel this is the best way as there are many things which can affect the number of credits, and storing both mean there is a risk of them getting out of sync somehow, I can't store just the remaining credits as the users need more than this.
Anyway, that means I can't use the mysql sorting options, and any sorting I did using PHP code would probably be CPU-intensive (permorming calculations for lots of users)
Thanks, Lemming, LemNet Manager
http://www.lemnet.com/banners/ - Free targeted advertising
attached mail follows:
How am I supposed to configure PHP as a module when there are more virtual webs on the server ?
The problem is that PHP scripts run with the UID/GID apache itself has. Every VW has its own UID/GID, but the files must be readable by apache and thus readable by any PHP script!!
This problem does not affect CGIs as apache can be configured to use suexec (or any other CGI wrapper) to run CGIs as the VW user.
Is there a solution to this problem other than running PHP as a standalone CGI with a CGI wrapper and lose functionality ( Header() -> authentication, whatever ) ?
.SiCk of IT.
attached mail follows:
I asked this same question about a month ago. The short answer is no. To get what you want and you've obviously already figured that out, is to run php as a cgi.
Someone let me know when a SuExec style is available for php3. I know that one has been written for MS FrontPage called mod_frontpage ( for latest ver);
ftp://ftp.vr.net/pub/apache/mod_frontpage/
Possibly someone can modify this to work for php3 - dunno, no coder here.
--perry
> How am I supposed to configure PHP as a module when there > are more > virtual webs on the server ?
> The problem is that PHP scripts run with the UID/GID > apache itself > has. Every VW has its own UID/GID, but the files must be > readable by > apache and thus readable by any PHP script!!
> This problem does not affect CGIs as apache can be > configured to > use suexec (or any other CGI wrapper) to run CGIs as the > VW user.
> Is there a solution to this problem other than running PHP > as a > standalone CGI with a CGI wrapper and lose functionality > ( Header() -> authentication, whatever ) ?
> .SiCk of IT.
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to
> php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail:
> php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
attached mail follows:
Hello all, I seem unable to post (using post or get). My understanding is that data sent from a form comes into $HTTP_POST_VARS if the method is POST and $HTTP_GET_VARS if the method is get. Is this correct? If this is what's supposed to happen (and I'm sure I've had it do this for me on another system?) it doesn't happen for me (on this system). Is there something obvious I'm missing? The php manual seems quite scant on these details.
I've modelled what I'm attempting below JIC someone asks: Form.html: <FORM NAME="MyForm" ACTION="HandleCGI.php3" METHOD="POST"> <INPUT NAME="WriteItHere" TYPE="TEXT"> <INPUT TYPE="SUBMIT"> </FORM>
HandleCGI.php3: <? if(isset($HTTP_POST_VARS)){ echo "Wohooo!! I got $HTTP_POST_VARS<BR>"; } else { echo "No data was posted<BR>"; } ?>
Needless to say that I'm getting the "No data was posted response". Any help will be appreciated. TIA Glenn
attached mail follows:
Try this
<? if (isset($WriteItHere)) { echo "The post Worked"; } else { echo "failed"; } ?>
If this doesnt work when you post to it, try the following url for your script
youscript.php3?WriteItHere=hello
if that doesnt work, theres somthing wrong with your php.exe or apache installation.
I think that $HTTP_POST_VARS are global so they can be got by globals[$HTTP_POST_VARS]
so somthing like
if (isset(globals[$HTTP_POST_VARS]) || isempty(globals[$HTTP_POST_VARS]) { ...
Is
> -----Original Message-----
> From: glenn
pip2.pip.com.au [mailto:glenn
pip2.pip.com.au]On Behalf Of
> Glenn Davy
> Sent: 26 March 2000 23:25
> To: php3
lists.php.net
> Subject: [PHP3] HTTP_POST_VARS empty?
>
>
> Hello all,
> I seem unable to post (using post or get). My understanding is that data
> sent from a form comes into $HTTP_POST_VARS if the method is POST and
> $HTTP_GET_VARS if the method is get. Is this correct?
> If this is what's supposed to happen (and I'm sure I've had it do this
> for me on another system?) it doesn't happen for me (on this system). Is
> there something obvious I'm missing? The php manual seems quite scant on
> these details.
>
> I've modelled what I'm attempting below JIC someone asks:
> Form.html:
> <FORM NAME="MyForm" ACTION="HandleCGI.php3" METHOD="POST">
> <INPUT NAME="WriteItHere" TYPE="TEXT">
> <INPUT TYPE="SUBMIT">
> </FORM>
>
> HandleCGI.php3:
> <? if(isset($HTTP_POST_VARS)){
> echo "Wohooo!! I got $HTTP_POST_VARS<BR>";
> } else {
> echo "No data was posted<BR>";
> }
> ?>
>
> Needless to say that I'm getting the "No data was posted response".
> Any help will be appreciated.
> TIA
> Glenn
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe
lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe
lists.php.net
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi, php3-users!
In my redirect.cgi I'm calling PHP compiled as CGI. At the shell output all is Correct.
But calling it like http://server/cgi-bin/redirect.cgi I'm getting a garbage liki this:
Content-type: text/html ELFBAL_OFFSET_TABLE_ind_first_exception_table_matchË(wӋ]US4=4UjhjjɔUŋUXt9Pw 9PvŋEtP0琐UuҋEɉEƋU҉UۋUƉU؋EۋU؍e[^_UŃWVS]u UMU͉]؉ՅuE9vE؉u͉ʴh Can't start PHP process!
redirect.cgi correctly call any other program and I try to do thi in 3 ways: 1. via popen() (FreeBSD 3.3.). 2. Via pipe() -> vfork() -> dup2 -> exec 3. Via simple execv()
Always garbarage.
Additonaly I use: putenv("REDIRECT_STATUS=200"); popen("/path/php -ffile.phtml", "r");
PS: I'm not in this list. Please CC to me!
Alexey V. Meledin <avm
webclub.ru>
InterForge Developers Group, St-Petersburg, Russia
---------------------------------------------------
> > > > > > "InterForge to Forge Ahead" < < < < < <
attached mail follows:
On Sun, 26 Mar 2000, Alexey V. Meledin wrote:
> But calling it like http://server/cgi-bin/redirect.cgi I'm getting > a garbage liki this: > > Content-type: text/html
[ELF file skipped]
You don't call your CGI -- it's just sent to you as a file. Check your server's configuration.
-- Alex
attached mail follows:
Hi, Alex!
Sunday, March 26, 2000, 8:33:44 PM, you wrote:
AB> On Sun, 26 Mar 2000, Alexey V. Meledin wrote:
>> But calling it like http://server/cgi-bin/redirect.cgi I'm getting >> a garbage liki this: >> >> Content-type: text/html
AB> [ELF file skipped]
AB> You don't call your CGI -- it's just sent to you as a file. Check your AB> server's configuration.
Configuration is OK. Other scripts works in this directory. redirect.cgi works well if it doesn't call "php file.phtml" For example it correctly works with simple: path_info.cgi script, that outputs passed PATH_INFO env variable.
So problem is open :(
PS: please, CC to me. I'm not in lists and don't need it every time.
Alexey V. Meledin <avm
webclub.ru>
InterForge Developers Group, St-Petersburg, Russia
---------------------------------------------------
> > > > > > "InterForge to Forge Ahead" < < < < < <
attached mail follows:
Hi!
It was a feature :))) When PHP is called from shell, then enviroment variable PATH_TRANSLATED is not send and it looks for command line parameters.
When it called via redirect.cgi, called via HTTP, PATH_TRANSLATED is set and PHP miss command line parameters!!!! WHY?????????????????????????????????????????? :) What's a pile?
Alexey V. Meledin <avm
webclub.ru>
InterForge Developers Group, St-Petersburg, Russia
---------------------------------------------------
> > > > > > "InterForge to Forge Ahead" < < < < < <
attached mail follows:
Hi,
If you go to www.favasa.org.uk - the site I'm building - you'll notice a table on the right which pulls data from a MySql table. When you click "cont", it's meant to take the ID of the news item and display it in *full*. However, it continually displays the wrong one and I don't know why.
The code used is:
$iid_query = "SELECT * FROM news2 WHERE id = '$id'"; $iid_result = mysql_db_query("$dbdb",$iid_query,$connection); $iid_row = mysql_fetch_object($iid_result);
Yet it pulls the wrong ID. Why?!
Thanks in advance.
Will
-- Web Developer and Programmer for Lukrative Media Ltd http://www.lukrative.com We're hiring - contact me for more details Domain Names-> http://CreativeNames.co.uk Classified Ads-> http://www.LocalAds.Net
attached mail follows:
Hi!
Can anybody explain me where I was wrong in the following example:
--------------- 1.phtml --------------------------- <?PHP
if ( session_start() ) { echo "session started<BR>\n"; }
if ( session_register('test') ) { echo "variables registered<BR>\n"; }
$test=10;
?>
<A HREF="2.phtml">2.phtml</A> ---------------------------------------------------
---------------- 2.phtml -------------------------- <SCRIPT language=php>
echo "viewed[1]=$viewed[1]<BR>\n"; echo "test=$test<BR>\n"; echo "HTTP_STATE_VARS[test]=$HTTP_STATE_VARS[test]<BR>\n";
</SCRIPT> ----------------------------------------------------------
---------------- output of 2.phtml ----------------------- test= HTTP_STATE_VARS[test]= ----------------------------------------------------------
FreeBSD-3.1RELEASE with Apache-1.3.9 + PHP4.1pl1. PHP was be configured as
./configure --with-apxs=<path_to_apache_apxs> \ --enable-track-vars \ --enavle-trans-sid \ --with-mysql
-- CU, Victor Gamov
attached mail follows:
thies
digicol.de wrote:
> have you had a look at the still "undocumented"
> xml_parse_into_struct() - that will make parsing *far*
> faster. (wrote this before i knew DOM - but i use it every
> day...)
The structure generated by this function is weird, but easily understood. I tried the following code
$ok = xml_parse_into_struct($parser,"<A attr=\"val\" bla=\"fasel\">aa<B>bbb</B>aaa<C>ccc</C>aaaa<C hallo=\"ha\"/></A>",&$myvalues,&$mytags);
and it worked producing an array myvalues representing the page structure and and array mytags, indexing that structure by tagname. The error handling seems to be a bit obscure: I did not get any error messages when I offered malformed XML. Also, the function does not seem to be able to handle multivalued attributes as in <a attr="agh" attr="ugh"/>. It this illegal XML or a shortcoming of the function?
Your function does represent the XML document as a linear array, not as a DOM tree. This makes reordering operations a bit messy. Is there a particular reason for this or is it just because?
Kristian
-- Kristian Koehntopp, Knooper Weg 46, 24103 Kiel, +49 170 2231 811 "Du haeltst Dich fest/an Dingen die nichts wert sind/ an Dingen, die Du gar nicht brauchst/Ich habe vor/Dir etwas besseres zu geben/in meinen Taschen/ ist ein besseres Leben." -- Die Antwort, "Durch die Adern meiner Haut"
attached mail follows:
thies
digicol.de wrote:
> have you had a look at the still "undocumented"
> xml_parse_into_struct() - that will make parsing *far*
> faster. (wrote this before i knew DOM - but i use it every
> day...)
I tried with my standard testfile, which is just below 300 KB in size. That file is being parsed by my code in 5 seconds into a DOMlike tree. Using your function, I get 0.3 seconds with SKIP_WHITESPACE (4300 objects), and 0.6 seconds without SKIP_WHITESPACE(7600 objects).
Very impressive.
Kristian
-- Kristian Koehntopp, Knooper Weg 46, 24103 Kiel, +49 170 2231 811 "Du haeltst Dich fest/an Dingen die nichts wert sind/ an Dingen, die Du gar nicht brauchst/Ich habe vor/Dir etwas besseres zu geben/in meinen Taschen/ ist ein besseres Leben." -- Die Antwort, "Durch die Adern meiner Haut"
attached mail follows:
> The part I'm pondering over is the "=>" and "->". What do these 2 actually > do?
They have nothing to do with one another. The first (=>) is an array construct used to assign the term to the left of the symbol as the index of the term to the right of the symbol.
The second (->) is used with classes to access a method (function) or property (variable). The object (class) is to the left of the term, and the method or property appears to the right of the term. Hence, $object->query($query) would run the "query" function defined in the object called "object" on the data passed as the variable $query. Access a property defined in the class as follows: $object->property. Note the absence of the $ symbol on the variable $property. It's as though object->property is the variable name and so it alone has a $ in front of it.
Ted
attached mail follows:
Are there any resources you would recommend looking at?
Thanks,
Will
----- Original Message -----
From: Ciprian <gzero
totalnet.ro>
To: WL <will
lukrative.com>
Cc: PHP <php3
lists.php.net>
Sent: Sunday, March 19, 2000 8:29 PM
Subject: Re: [PHP3] Tracking Users
> What you're saying is you want a cookie-based access counter, with a > particular use for access limitation. It's perfectly possible, just go > ahead and do it. > > Make sure you design the cookie data in such way that visitors can't > just edit it and trick you (in other words, don't store clear counter > values in the cookie) --but I'm sure you thought of this already. > > You might not even need MySQL. I suppose you planned to use it to > store counter values and user ID's, but the counter values are stored > in the cookies on the user's computer anyway, and you just need to > make sure the new ID's you issue can't repeat (use a timestamp or > something). > > Finally, I doubt this system will seriously prevent one particular > person from viewing that certain page. The person can delete the > cookie he's stored, thus appear as new to you, can use another > machine, and so on. I suppose you're not implementing this as > security, but simply as a smarter redirect technique. If you need > security, you'll have to go with passwords stored on your server, and > adviceably secure connections. > > Ciprian > > Sunday, March 19, 2000, 8:45 PM, WL wrote: > > I have this idea, but I don't think it's going to work in Php3...basically I > > want to track how many times a user goes to a page, using cookies (and > > probably MySql for the session, if we need sessions) - if he goes more than > > x times, prevent access and redirect to another page. > > >
- Next message: php3-digest-help
lists.php.net: "php3 Digest 27 Mar 2000 05:59:39 -0000 Issue 1564"
- Previous message: php3-digest-help
lists.php.net: "php3 Digest 26 Mar 2000 05:59:45 -0000 Issue 1562"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]