|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Thu Feb 27 2003 - 09:24:05 CST
php-general Digest 27 Feb 2003 15:24:05 -0000 Issue 1908
Topics (messages 137335 through 137399):
mysqldump
137335 by: John Taylor-Johnston
137336 by: Joseph Szobody
137337 by: Joseph Szobody
137355 by: John Taylor-Johnston
137370 by: Sunfire
137371 by: Niels Andersen
Re: session_start
137338 by: John W. Holmes
Re: resizing .jpg file in php
137339 by: Jason Sheets
Re: problem in writing into an html text file
137340 by: John W. Holmes
137341 by: Jason Sheets
137351 by: Michael P. Carel
137383 by: Alejandro Trujillo J.
Re: non transmitted cookie
137342 by: Jason Sheets
137362 by: Dennis Gearon
Re: mcrypt as shared module
137343 by: Jason Sheets
multiple line text area
137344 by: Gregory Chagnon
137345 by: Gregory Chagnon
137346 by: John W. Holmes
137347 by: Gregory Chagnon
137348 by: John W. Holmes
137349 by: Gregory Chagnon
Re: Mail (), BBC: recipients not receiving my Newsletter
137350 by: Manuel Lemos
137389 by: Ricardo Fitzgerald
Is PHP Reinstall required?
137352 by: Patrick LOK
137353 by: Rasmus Lerdorf
137356 by: Patrick LOK
Re: using php to rotate ad banners
137354 by: Manuel Lemos
One more string question
137357 by: Gregory Chagnon
137358 by: John Taylor-Johnston
137360 by: Matt Honeycutt
php_flag session.auto_start 0 not working
137359 by: Gary
Re: Emacs?
137361 by: Matt Giddings
137393 by: Larry Brown
exec & mysqldump
137363 by: John Taylor-Johnston
137364 by: John Taylor-Johnston
Using mod_rewrite and PHP
137365 by: Dan Phiffer
137366 by: Dan Phiffer
137367 by: Peter Janett
global value (php.ini) settings override with local (virtualhost) value
137368 by: Davide Giunchi
Re: date, "first of next month"?
137369 by: Jon Haworth
How to phpize?
137372 by: Niels Andersen
Re: imagecreate()
137373 by: Marek Kilimajer
including db content as part of script
137374 by: Dennis Heuer
137376 by: Niklas Lampén
PHPed 3.0.0 debug problem. Plz help
137375 by: Kristijan Marin
Escape Characters
137377 by: Sysadmin.saginawcontrol.com
137379 by: John W. Holmes
Re: PHP list problems?
137378 by: David T-G
137381 by: Sebastian
137382 by: Sebastian
classes and functions in include files
137380 by: Sunfire
137385 by: John W. Holmes
137390 by: rush
137396 by: David Eisenhart
File upload problem - permission denied
137384 by: Frans Bakker
137386 by: Niklas Lampén
137387 by: Frans Bakker
137388 by: Niklas Lampén
137392 by: John W. Holmes
Reading files
137391 by: Chris Blake
137394 by: Ferhat Can
137395 by: John W. Holmes
post xml
137397 by: Diana Castillo
How do I display the script file name?
137398 by: Stephen Ford
137399 by: Mark Harwood
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Anyone do MySQLDump using PHP ?
http://www.mysql.com/doc/en/mysqldump.html
My code is:
mysqldump -u ****** -p ****** -A > /home/mybackups/dump_all.sql
I would like to pull it off using PHP, remotely.
$date = date ("Ymd");
$to_path = "/home/MyBackups/$date/dump_all.sql";
mysqldump -u ****** -p ****** -A > $to_path;
mysqldump is not PHP?!
John
attached mail follows:
You need to use exec, system, etc. Here is a script that I recently put together. It backs up the database, and pushes it as a download to the user.
<?php
$filename = "db_backup_" . date("n-j-y");
header("Content-Disposition: filename=$filename.sql");
header("Content-Type: application/force-download");
exec("mysqldump -c -q user -u webserver -ppassword", $sql);
for($i = 0; $i < count($sql); $i++) {
echo $sql[$i] . "\r\n";
}
?>
Hope this helps,
Joseph
"John Taylor-Johnston" <taylorjo
collegesherbrooke.qc.ca> wrote in message news:3E5D8961.1151D64C
collegesherbrooke.qc.ca...
> Anyone do MySQLDump using PHP ?
>
> http://www.mysql.com/doc/en/mysqldump.html
>
> My code is:
> mysqldump -u ****** -p ****** -A > /home/mybackups/dump_all.sql
>
> I would like to pull it off using PHP, remotely.
>
> $date = date ("Ymd");
> $to_path = "/home/MyBackups/$date/dump_all.sql";
>
> mysqldump -u ****** -p ****** -A > $to_path;
>
> mysqldump is not PHP?!
>
> John
>
attached mail follows:
uhhhh..... that should read:
exec("mysqldump -c -q database -u user -ppassword", $sql);
attached mail follows:
Thanks!
> exec("mysqldump -c -q database -u user -ppassword", $sql);
Why is there no space between the -p and password?
>-ppassword
Am I wrong?
Thanks,
John
attached mail follows:
just make a php file with system calls in it to do mysqldump
how secure that is is a different question
----- Original Message -----
From: "John Taylor-Johnston" <taylorjo
collegesherbrooke.qc.ca>
To: <php-general
lists.php.net>
Sent: Wednesday, February 26, 2003 10:43 PM
Subject: [PHP] mysqldump
> Anyone do MySQLDump using PHP ?
>
> http://www.mysql.com/doc/en/mysqldump.html
>
> My code is:
> mysqldump -u ****** -p ****** -A > /home/mybackups/dump_all.sql
>
> I would like to pull it off using PHP, remotely.
>
> $date = date ("Ymd");
> $to_path = "/home/MyBackups/$date/dump_all.sql";
>
> mysqldump -u ****** -p ****** -A > $to_path;
>
> mysqldump is not PHP?!
>
> John
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
attached mail follows:
There mey, but need not be a space. As far as I know, the option scanner in mysqldump ignores spaces between short options and their values.
"John Taylor-Johnston" <taylorjo
collegesherbrooke.qc.ca> wrote in message
news:3E5D9A54.BE73BD4A
collegesherbrooke.qc.ca...
> Thanks!
>
> > exec("mysqldump -c -q database -u user -ppassword", $sql);
>
> Why is there no space between the -p and password?
>
> >-ppassword
>
> Am I wrong?
>
> Thanks,
> John
>
attached mail follows:
> At 01:36 27.02.2003, Mr Percival said: > --------------------[snip]-------------------- > >What I was hoping to do was to be able to give a error message if the > server > >was having this problem, but in order to do that I was needing a way of > >knowing if it was because the session_start failed or users who didnt > have > >cookies turned on. > > > >I probably just need to get a new host since these disk full errors > happen > >regularly. :( > --------------------[snip]-------------------- > > session_start() cannot fail - the failure happens after the end of your > influence. > > Ask these guys at your webhost to move /tmp to another partition, or > _at_least_ to have session.save_path point to a partition that doesn't get > exhausted too quickly.
Or use session_save_path() in your script to use a directory of your own. Make sure you implement your own cleanup, though.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
attached mail follows:
You can use the GD image functions or ImageMagick to resize images. More about GD can be found in the PHP manual at http://www.php.net/manual.
Jason On Wed, 2003-02-26 at 07:36, Anthony Ritter wrote: > I'd like to use (with permission) .jpg files from a webcam from another URL. > > Once that URL is opened and read via PHP as a file into my site is it > possible to resize that image? It measures 640 x 480 pixels and I would > like to reduce the image size by 25%. > > Thank you. > Tony Ritter > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> Im having a problem writing an HTML code in a text file which comes from > the > html text area as an editor. There's an added characters inserted to it. > How > could i write to it perfectly?
You have a problem on line 9 of your script.... after the 'e'.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
attached mail follows:
Hello Mike,
You will need to better describe your problem and preferably show some source code.
What characters are being added to it? You could use str_replace or the regular expression replacement functions but you should not get added characters in general.
Jason On Wed, 2003-02-26 at 19:07, Michael P. Carel wrote: > hi to all, > > Im having a problem writing an HTML code in a text file which comes from the > html text area as an editor. There's an added characters inserted to it. How > could i write to it perfectly? > > mike > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
sorry here's the sample code:
<? if(!$submit){ ?> <form> <? $filename="my.html"; $fd=fopen($filename,"r+") or die("Can't open file $filename"); $message = fread($fd, filesize($filename)); fclose($fd); ?> <textarea name="message" cols="95" rows="20"><? echo $message;?>/textarea> <input type="submit" name="submit" value="modify"> </form> <? }else{
$filename="my.html"; $fd=fopen($filename,"w") or die("Can't open file $filename"); $fstring=$message; $fout = fwrite($fd, $fstring); fclose($fd);
} ?>
the html file upon modify multiplies all the backslashes.
any idea why? thanks in advance.
----- Original Message -----
From: "Jason Sheets" <jsheets
php.net>
To: "Michael P. Carel" <mikecarel
teamglac.com>
Cc: <php-general
lists.php.net>
Sent: Thursday, February 27, 2003 12:04 PM
Subject: Re: [PHP] problem in writing into an html text file
> Hello Mike, > > You will need to better describe your problem and preferably show some > source code. > > What characters are being added to it? You could use str_replace or the > regular expression replacement functions but you should not get added > characters in general. > > Jason > On Wed, 2003-02-26 at 19:07, Michael P. Carel wrote: > > hi to all, > > > > Im having a problem writing an HTML code in a text file which comes from the > > html text area as an editor. There's an added characters inserted to it. How > > could i write to it perfectly? > > > > mike > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
what software are you using ???
-- Alejandro Trujillo J. Cube Systems LTDA. web : csltda.comUsing M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
attached mail follows:
Not that I am aware of, it seems you would be better off using SSL, if you are concerned about someone hijacking the sessions you could generate your own session id (I generate random 80 character session ids instead of 32) and also limit the life of the session, you could write logic to change the session ID every n minutes which would make brute forcing the session id even harder.
Jason On Wed, 2003-02-26 at 11:34, Dennis Gearon wrote: > Is there anyway for a page to save information on a user's computer which is accessible via java or > javascript, but doesn't get sent with each HTML request the way a cookie is? > > I had this idea, patterned after kerberos: > > 1/ A user logs into a site via a secure link. > 2/ A hash salt is stored on their computer and an > initial hash is generated for the user as a Password > to their session key. > 3/ The user is redirected to the non secure part of the site > and they have both the hash-pw plus session key in their document. > 4/ Each time they access a page on our site, a javascript fires > which generates the next sequence in the hash-pw. > 5/ the server also generates the same new sequence and compares > it. If the session key and the new password agree, then > it is the user attached to the session. > > So, this salt needs to NOT be transmitted via the cookie so > that it does not appear 'in the clear', which would invalidate > it's use. > > Please CC me when you reply to the list, I am on digest. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Unless of course, you are listening into the network connection :-)
Jason Sheets wrote: > > Not that I am aware of, it seems you would be better off using SSL, if > you are concerned about someone hijacking the sessions you could > generate your own session id (I generate random 80 character session ids > instead of 32) and also limit the life of the session, you could write > logic to change the session ID every n minutes which would make brute > forcing the session id even harder. > > Jason > On Wed, 2003-02-26 at 11:34, Dennis Gearon wrote: > > Is there anyway for a page to save information on a user's computer which is accessible via java or > > javascript, but doesn't get sent with each HTML request the way a cookie is? > > > > I had this idea, patterned after kerberos: > > > > 1/ A user logs into a site via a secure link. > > 2/ A hash salt is stored on their computer and an > > initial hash is generated for the user as a Password > > to their session key. > > 3/ The user is redirected to the non secure part of the site > > and they have both the hash-pw plus session key in their document. > > 4/ Each time they access a page on our site, a javascript fires > > which generates the next sequence in the hash-pw. > > 5/ the server also generates the same new sequence and compares > > it. If the session key and the new password agree, then > > it is the user attached to the session. > > > > So, this salt needs to NOT be transmitted via the cookie so > > that it does not appear 'in the clear', which would invalidate > > it's use. > > > > Please CC me when you reply to the list, I am on digest. > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php
--Carpe Dancem ;-) ----------------------------------------------------------------- Remember your friends while they are alive ----------------------------------------------------------------- Sincerely, Dennis Gearon
attached mail follows:
Hello Vladimir, you can run phpize in the mcrypt extension directory in your PHP source code, then copy the .so file to your PHP extension dir and either add an extension line to your php.ini file or use dl to load the extension at run time. Generally I just compile it in at PHP configure time as you need write access to the PHP extension directory anyway.
Jason On Wed, 2003-02-26 at 14:02, Vladimir Fedorkov wrote: > How can I attach mcrypt to PHP (FreeBSD) without recompile whole PHP ? > How can I compile mcrypt as PHP shared module ? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I need to be able to preserve line breaks when a user types in multiple lines in a multitple line test area. Right now if I echo $_POST['textarea'] I get everything on one line. Is there any way to do this? Thanks! -Greg
attached mail follows:
Make that a multitple line TEXT area, not a test area :) -Greg
"Gregory Chagnon" <gregchagnon
hotmail.com> wrote in message
news:20030227040417.22640.qmail
pb1.pair.com...
> I need to be able to preserve line breaks when a user types in multiple
> lines in a multitple line test area. Right now if I echo
$_POST['textarea']
> I get everything on one line. Is there any way to do this? Thanks!
> -Greg
>
>
attached mail follows:
> I need to be able to preserve line breaks when a user types in multiple > lines in a multitple line test area. Right now if I echo > $_POST['textarea'] > I get everything on one line. Is there any way to do this? Thanks! > -Greg
www.php.net/nl2br
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
attached mail follows:
That would work, only I need to copy this text to a file without the </br> in it. -Greg
"John W. Holmes" <holmes072000
charter.net> wrote in message
news:003301c2de16$73883bb0$7c02a8c0
coconut...
> > I need to be able to preserve line breaks when a user types in
> multiple
> > lines in a multitple line test area. Right now if I echo
> > $_POST['textarea']
> > I get everything on one line. Is there any way to do this? Thanks!
> > -Greg
>
> www.php.net/nl2br
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
attached mail follows:
The newlines are preserved. Do a view source of your page where you're displaying it and you'll see what I'm talking about. HTML just doesn't render newlines, only <br>. If you're seeing something different, then show your code and explain this more.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
> -----Original Message-----
> From: Gregory Chagnon [mailto:gregchagnon
hotmail.com]
> Sent: Wednesday, February 26, 2003 11:19 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] multiple line text area
>
> That would work, only I need to copy this text to a file without the
</br>
> in it.
> -Greg
>
>
> "John W. Holmes" <holmes072000
charter.net> wrote in message
> news:003301c2de16$73883bb0$7c02a8c0
coconut...
> > > I need to be able to preserve line breaks when a user types in
> > multiple
> > > lines in a multitple line test area. Right now if I echo
> > > $_POST['textarea']
> > > I get everything on one line. Is there any way to do this?
Thanks!
> > > -Greg
> >
> > www.php.net/nl2br
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> > today. http://www.phparch.com/
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks John, you're right -Greg
"John W. Holmes" <holmes072000
charter.net> wrote in message
news:003a01c2de18$4651e9f0$7c02a8c0
coconut...
> The newlines are preserved. Do a view source of your page where you're
> displaying it and you'll see what I'm talking about. HTML just doesn't
> render newlines, only <br>. If you're seeing something different, then
> show your code and explain this more.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
> > -----Original Message-----
> > From: Gregory Chagnon [mailto:gregchagnon
hotmail.com]
> > Sent: Wednesday, February 26, 2003 11:19 PM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] multiple line text area
> >
> > That would work, only I need to copy this text to a file without the
> </br>
> > in it.
> > -Greg
> >
> >
> > "John W. Holmes" <holmes072000
charter.net> wrote in message
> > news:003301c2de16$73883bb0$7c02a8c0
coconut...
> > > > I need to be able to preserve line breaks when a user types in
> > > multiple
> > > > lines in a multitple line test area. Right now if I echo
> > > > $_POST['textarea']
> > > > I get everything on one line. Is there any way to do this?
> Thanks!
> > > > -Greg
> > >
> > > www.php.net/nl2br
> > >
> > > ---John W. Holmes...
> > >
> > > PHP Architect - A monthly magazine for PHP Professionals. Get your
> copy
> > > today. http://www.phparch.com/
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Hello,
On 02/26/2003 07:40 PM, Ricardo Fitzgerald wrote: > I wrote a small form which dumps data to a php script that uses mail () > to send an html newsletter, so far is working except > that it's not sending to BCC: headers, in my form I have a field to > enter a comma delimited email list, after submiting the form this list > is stored under one variable $emaillist, and in my php script I used > $headers .= "Bcc: ".$emaillist."\r\n"; > > then I call > > mail($to, $subject, $message, $headers); > > I don't receive an error message but my email list is not being sent, > what I'm doing wrong ?
It sounds like one of those bugs of the mail function but it is hard to tell what can it be with so little information.
Anyway, you may want to try this class for composing and sending e-mail messages that comes with workaround for many problems of the mail() function:
http://www.phpclasses.org/mimemessage
--Regards, Manuel Lemos
attached mail follows:
I'll Try that instead :) Thnx!
Rick
Off Price Closeouts 1700 W 8 Ave Miami, FL 33010 (305) 888 2555 FAX (305) 884 1761
-----Mensaje original-----
De: Jason k Larson [mailto:jlarson
candlefire.org]
Enviado el: Wednesday, February 26, 2003 5:59 PM
Para: Ricardo Fitzgerald
CC: php-general
lists.php.net
Asunto: Re: [PHP] Mail (), BBC: recipients not receiving my Newsletter
What about using a ';' semicolon seperated list.
Ricardo Fitzgerald wrote: > Hi to all, > > I wrote a small form which dumps data to a php script that uses mail () > to send an html newsletter, so far is working except > that it's not sending to BCC: headers, in my form I have a field to > enter a comma delimited email list, after submiting the form this list > is stored under one variable $emaillist, and in my php script I used > $headers .= "Bcc: ".$emaillist."\r\n"; > > then I call > > mail($to, $subject, $message, $headers); > > I don't receive an error message but my email list is not being sent, > what I'm doing wrong ? > > Rick Fitzgerald > > Off Price Closeouts > 1700 W 8 Ave > Miami, FL 33010 > (305) 888 2555 > FAX (305) 884 1761 > > > >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I have to uninstall my Apache 2.0.x that came along with RedHat 8.0 because the httpd (rpm) in RH8.0 does not have Apache apxs (why dont they include it).
I need apxs to install lxp... (it seems lxp can only be installed on a customized Linux platform... USER NOT FRIENDLY :( )
I already have PHP 4.3.1 installed. I will replace the RH Apache with the latest Apache 2.0.44
Can anyone tell me do I have to remove PHP 4.3.1 before removing Apache? Or Can I just remove Apache & install 2.0.44? Do I have to re-install PHP 4.3.1 by overwriting previous PHP after Apache 2.0.44 installed?
Thank you very much. ./pl :<
attached mail follows:
Just install the apache-devel package which is where the apxs tool lives.
-Rasmus
On Thu, 27 Feb 2003, Patrick LOK wrote:
> I have to uninstall my Apache 2.0.x that came along with RedHat 8.0 because > the httpd (rpm) in RH8.0 does not have Apache apxs (why dont they include > it). > > I need apxs to install lxp... (it seems lxp can only be installed on a > customized Linux platform... USER NOT FRIENDLY :( ) > > I already have PHP 4.3.1 installed. > I will replace the RH Apache with the latest Apache 2.0.44 > > Can anyone tell me do I have to remove PHP 4.3.1 before removing Apache? Or > Can I just remove Apache & install 2.0.44? Do I have to re-install PHP > 4.3.1 by overwriting previous PHP after Apache 2.0.44 installed? > > Thank you very much. > ./pl :< > > > >
attached mail follows:
But where is the package?
rgds ./pl
"Rasmus Lerdorf" <rasmus
lerdorf.com> wrote in message
news:Pine.LNX.4.44.0302262051020.964-100000
thinkpad.lerdorf.com...
> Just install the apache-devel package which is where the apxs tool lives.
>
> -Rasmus
>
> On Thu, 27 Feb 2003, Patrick LOK wrote:
>
> > I have to uninstall my Apache 2.0.x that came along with RedHat 8.0
because
> > the httpd (rpm) in RH8.0 does not have Apache apxs (why dont they
include
> > it).
> >
> > I need apxs to install lxp... (it seems lxp can only be installed on a
> > customized Linux platform... USER NOT FRIENDLY :( )
> >
> > I already have PHP 4.3.1 installed.
> > I will replace the RH Apache with the latest Apache 2.0.44
> >
> > Can anyone tell me do I have to remove PHP 4.3.1 before removing Apache?
Or
> > Can I just remove Apache & install 2.0.44? Do I have to re-install PHP
> > 4.3.1 by overwriting previous PHP after Apache 2.0.44 installed?
> >
> > Thank you very much.
> > ./pl :<
> >
> >
> >
> >
>
attached mail follows:
Hello,
On 02/26/2003 07:58 PM, Joseph Bannon wrote: > I recently created some scripts to rotate ad banners > on my site. One script is called show.php, which > serves the banner. The other is called click.php, > which redirects the people to the proper site for the > banner they clicked on. > > Some people have noticed that when they click on the > banner, they go to another site. Others have noticed > that they just get returned back to the page that they > just were at. I test it without any problems. > > I have been doing the redirecting using cookies. The > script show.php puts the cookie on their computer. The > script click.php gets the cookie and redirects them to > the proper place when clicked. Should I be using > cookies or sessions to do this? I think the problem is > that some people have their browser set to not accept > cookies which is why they get directed to other > places.
Why don't you just use phpAdsNew?
--Regards, Manuel Lemos
attached mail follows:
When I submit a form with a text area containing the test "//server/share" and try to echo the variable it echos "////server//share". Is there any way to prevent the extra /'s? Thanks! -Greg
attached mail follows:
Stripslashes I think.
Gregory Chagnon wrote:
> When I submit a form with a text area containing the test "//server/share" > and try to echo the variable it echos "////server//share". Is there any way > to prevent the extra /'s? Thanks! > -Greg
-- John Taylor-Johnston ----------------------------------------------------------------------------- Université de Sherbrooke
attached mail follows:
Trying using stripslashes() on the string variable prior to displaying it. That *might* not work for you, but I'd try that first.
---Matt
-----Original Message-----
From: Gregory Chagnon [mailto:gregchagnon
hotmail.com]
Sent: Wednesday, February 26, 2003 11:12 PM
To: php-general
lists.php.net
Subject: [PHP] One more string question
When I submit a form with a text area containing the test "//server/share" and try to echo the variable it echos "////server//share". Is there any way to prevent the extra /'s? Thanks! -Greg
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I am using php_flag session.auto_start 0 in an .htaccess file to stop sessions from auto starting. It works on all but the one below, it still auto starts. The session replaces linked style sheets on the page through some links. Can anyone see the problems?
session_start(); if ( isset($_GET['style']) ) { $_SESSION['style'] = $_GET['style']; } elseif ( !isset($_SESSION['style']) ) { $_SESSION['style'] = 'styles'; }
TIA Gary
attached mail follows:
Don't you mean 42?
> -----Original Message-----
> From: Larry Brown [mailto:larry.brown
dimensionnetworks.com]
> Sent: Wednesday, February 26, 2003 7:55 PM
> To: PHP List
> Subject: RE: [PHP] Emacs?
>
> 25
>
> -----Original Message-----
> From: Sascha Braun [mailto:saschabraun
gmx.de]
> Sent: Tuesday, February 25, 2003 12:00 PM
> To: PHP General list
> Subject: [PHP] Emacs?
>
> How many Persons in this List are using Emacs as there default Editor?
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003
attached mail follows:
Oops...I stand corrected.
Larry S. Brown Dimension Networks, Inc. (727) 723-8388
-----Original Message-----
From: Matt Giddings [mailto:cen10761
centurytel.net]
Sent: Thursday, February 27, 2003 12:26 AM
To: 'Larry Brown'; 'PHP List'
Subject: RE: [PHP] Emacs?
Don't you mean 42?
> -----Original Message-----
> From: Larry Brown [mailto:larry.brown
dimensionnetworks.com]
> Sent: Wednesday, February 26, 2003 7:55 PM
> To: PHP List
> Subject: RE: [PHP] Emacs?
>
> 25
>
> -----Original Message-----
> From: Sascha Braun [mailto:saschabraun
gmx.de]
> Sent: Tuesday, February 25, 2003 12:00 PM
> To: PHP General list
> Subject: [PHP] Emacs?
>
> How many Persons in this List are using Emacs as there default Editor?
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
This works: exec("mysqldump -u **** -p**** -A > test.sql");
This doesn't. exec("mysqldump -u **** -p**** -A > $filename");
:)????
<?php
$filename = "/home/johj2201/public_html/mysqldump/db_backup_" . date("n-j-y").".sql";
exec("mysqldump -u **** -p**** -A > $filename");
echo "dump completed on $filename "; ?>
attached mail follows:
Scratch that. Had a CHMOD problem.
Sorry.
attached mail follows:
So I'm trying to implement a URL system like so:
http://domain.org/issues/2003/feb/article-name/
such that http://domain.org/issues/index.php will display the requested page. I've read a little about this (http://www.alistapart.com/stories/succeed/) and have gotten it to work for the most part, but there's one problem I'd like to resolve.
Here's how I've got it set up:
- I put a .htaccess file in http://domain.org/issues like so:
RewriteEngine on RewriteRule !\.(gif|jpg|png|css|js)$ index.php
- /issues/index.php contains code to respond to REQUEST_URI and serve content appropriately.
- Requests to /issues/ should serve an index sort of page, which works fine.
However, if a request is made to /issues (no trailing slash), the browser is sent an Error 400 Bad Request.
I tried the following after looking at the URL Rewriting Guide (http://httpd.apache.org/docs/misc/rewriteguide.html):
RewriteEngine on RewriteBase /issues/ RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1/ [R]
Unfortunately, with this in place the browser displays a 302 Found message with a link to the same problematic URL (/issues). I'm still pretty new to mod_rewrite, so please bear with me if I'm doing something obviously wrong here.
Thanks, -Dan
attached mail follows:
At the advice of a friendly php-general reader, I tried the following:
RewriteEngine on Options +FollowSymlinks RewriteBase /issues/ RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+)([/]?)$ $1/ [R]
RewriteRule ^([0-9]/[a-z]/[a-z0-9])([/]?) /index.php?year=$1\&month=$2\&article=$3
And here's my /issues/index.php:
<?php
print_r($_GET);
?>
Requesting http://localhost/issues/2003/feb/issue/ gives a 404 file not found (the logfile shows that it's looking for an un-rewritten URI). Requesting http://localhost/issues/ displays "Array ( )" as expected. Strangely, going to http://localhost/issues redirects me to the hostname (which I have set to 'asdf', causing my browser to end up at http://www.asdf.com).
I guess I should have said this earlier, but I'm testing on Win32/PHP 4.3.1/Apache 1.3.27, and have verified the problem on a FreeBSD platform as well.
Anyway, thanks for any more pointers, -Dan
"Dan Phiffer" <dan
phiffer.com> wrote in message
news:20030227073324.44389.qmail
pb1.pair.com...
> So I'm trying to implement a URL system like so:
>
> http://domain.org/issues/2003/feb/article-name/
>
> such that http://domain.org/issues/index.php will display the requested
> page. I've read a little about this
> (http://www.alistapart.com/stories/succeed/) and have gotten it to work
for
> the most part, but there's one problem I'd like to resolve.
>
> Here's how I've got it set up:
>
> - I put a .htaccess file in http://domain.org/issues like so:
>
> RewriteEngine on
> RewriteRule !\.(gif|jpg|png|css|js)$ index.php
>
> - /issues/index.php contains code to respond to REQUEST_URI and serve
> content
> appropriately.
>
> - Requests to /issues/ should serve an index sort of page, which works
fine.
>
> However, if a request is made to /issues (no trailing slash), the browser
is
> sent an Error 400 Bad Request.
>
> I tried the following after looking at the URL Rewriting Guide
> (http://httpd.apache.org/docs/misc/rewriteguide.html):
>
> RewriteEngine on
> RewriteBase /issues/
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^(.+[^/])$ $1/ [R]
>
> Unfortunately, with this in place the browser displays a 302 Found message
> with a link to the same problematic URL (/issues). I'm still pretty new to
> mod_rewrite, so please bear with me if I'm doing something obviously wrong
> here.
>
> Thanks,
> -Dan
>
>
attached mail follows:
You can do this in your PHP code by itself, no need to use Apache.
Search for "search engine safe" or "search engine friendly".
Fusebox.org has some default code that does this (follow the links for PHP fusebox).
HTH,
Peter Janett
New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon!
http://www.newmediaone.net
webmaster
newmediaone.net
(303)828-9882
----- Original Message -----
From: "Dan Phiffer" <dan
phiffer.com>
To: <php-general
lists.php.net>
Sent: Thursday, February 27, 2003 1:29 AM
Subject: [PHP] Re: Using mod_rewrite and PHP
> At the advice of a friendly php-general reader, I tried the following:
>
> RewriteEngine on
> Options +FollowSymlinks
> RewriteBase /issues/
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^(.+)([/]?)$ $1/ [R]
>
> RewriteRule ^([0-9]/[a-z]/[a-z0-9])([/]?)
> /index.php?year=$1\&month=$2\&article=$3
>
> And here's my /issues/index.php:
>
> <?php
>
> print_r($_GET);
>
> ?>
>
> Requesting http://localhost/issues/2003/feb/issue/ gives a 404 file not
> found (the logfile shows that it's looking for an un-rewritten URI).
> Requesting http://localhost/issues/ displays "Array ( )" as expected.
> Strangely, going to http://localhost/issues redirects me to the hostname
> (which I have set to 'asdf', causing my browser to end up at
> http://www.asdf.com).
>
> I guess I should have said this earlier, but I'm testing on Win32/PHP
> 4.3.1/Apache 1.3.27, and have verified the problem on a FreeBSD platform
as
> well.
>
> Anyway, thanks for any more pointers,
> -Dan
>
>
> "Dan Phiffer" <dan
phiffer.com> wrote in message
> news:20030227073324.44389.qmail
pb1.pair.com...
> > So I'm trying to implement a URL system like so:
> >
> > http://domain.org/issues/2003/feb/article-name/
> >
> > such that http://domain.org/issues/index.php will display the requested
> > page. I've read a little about this
> > (http://www.alistapart.com/stories/succeed/) and have gotten it to work
> for
> > the most part, but there's one problem I'd like to resolve.
> >
> > Here's how I've got it set up:
> >
> > - I put a .htaccess file in http://domain.org/issues like so:
> >
> > RewriteEngine on
> > RewriteRule !\.(gif|jpg|png|css|js)$ index.php
> >
> > - /issues/index.php contains code to respond to REQUEST_URI and serve
> > content
> > appropriately.
> >
> > - Requests to /issues/ should serve an index sort of page, which works
> fine.
> >
> > However, if a request is made to /issues (no trailing slash), the
browser
> is
> > sent an Error 400 Bad Request.
> >
> > I tried the following after looking at the URL Rewriting Guide
> > (http://httpd.apache.org/docs/misc/rewriteguide.html):
> >
> > RewriteEngine on
> > RewriteBase /issues/
> > RewriteCond %{REQUEST_FILENAME} -d
> > RewriteRule ^(.+[^/])$ $1/ [R]
> >
> > Unfortunately, with this in place the browser displays a 302 Found
message
> > with a link to the same problematic URL (/issues). I'm still pretty new
to
> > mod_rewrite, so please bear with me if I'm doing something obviously
wrong
> > here.
> >
> > Thanks,
> > -Dan
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
In php.ini i've set
open_basedir = /usr/local/lib/php/:/tmp/
in vhost.conf (VirtualHost include file) i set
php_admin_value open_basedir /web/htdocs/linuxtest4.aruba.it/home/
So if i execute phpinfo i view: LOCAL MASTER open_basedir /web/htdocs/linuxtest4.aruba.it/home/ /usr/local/lib/php/:/tmp/
but if i execute a script that try to open a file in /tmp i get limitations by open_basedir. If i put all these value in the php.ini and toggle php_admin_value open_basedir in vhost.conf i get all working ok.
How can i avoid the open_basedir value to be overwritten by vhost.conf ? (i want to be "added")
Regards.
-- Davide Giunchi
attached mail follows:
Hi Bryan,
> > $t = mktime(0,0,0,date('m')+1,1,date('Y')); > > > > Gives you timestamp of first day, next month. > > Format accordingly with date(). > > is there such a say to now get the date of the first > weekday after that date?
You can brute force it:
// grab the timestamp $t = mktime(0,0,0,date('m')+1,1,date('Y'));
// if it's a saturday or sunday, add 86400 seconds (1 day) while (date('w',$t) == 0 || date('w',$t) == 6) $t += 86400;
This doesn't take into account any bank holidays, of course - you'll need to do a lookup against a database or an array if you want to test for these as well (not sure if you want the first weekday or the first working day).
There might be a more elegant way to do this, but with a maximum of three iterations round the while loop, I don't know if it's worth looking for :-)
HTH Jon
attached mail follows:
I want to compile an extension, let's say the zip extension. So I do the following:
cd /usr/src/php-4.2.3/ext/zip phpize
Now, I understand that this should result in a shared library being produced, but I can't find it.
Also, during the phpize process, I get following warnings: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_us" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). configure.in:17: error: possibly undefined macro: AC_MSG_ERROR configure:2571: error: possibly undefined macro: AC_DEFINE configure:2571: error: possibly undefined macro: AC_CHECK_LIB perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_us" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_us" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). autoheader: `config.h.in' is unchanged You should update your `aclocal.m4' by running aclocal.
Please, tell me what to do, and I will be forever greatfull.
attached mail follows:
Tell us what is in the logs, they are in logs\ in the apache installation directory
Anthony Ritter wrote:
>Chris, >The function I'm trying to get...it's: > >imagecreate() > >I am using MS Win 98 / PHP 4 and Apache. > >I tried running the following script but got an undefined call to >imagecreate() > > >The following copy is located in my php.ini file...one of which is: > >.............. >;extension=php_gd.dll >.................. > >I tried uncommenting this line to no avail. > >What is the best way to install php_gd.dll so that I can make use of the >image library. > >Many...many thanks. > >Tony Ritter > >--- >[This E-mail scanned for viruses by gonefishingguideservice.com] > > > >
attached mail follows:
Hello -
One single question. Is including() a script on runtime only possible with files or can I include() code from a database?
greetings Dennis
attached mail follows:
Well, you could use temporary files for this. I've never done this by myself, but I think it's worth giving a try. :)
Fetch the data from the database, write your code to temporary file and then include this temporary file. After that you can destroy the temporary file.
Niklas
-----Original Message-----
From: Dennis Heuer [mailto:dh
onclick.org]
Sent: 27. helmikuuta 2003 14:29
To: php-general
lists.php.net
Subject: [PHP] including db content as part of script
Hello -
One single question. Is including() a script on runtime only possible with files or can I include() code from a database?
greetings Dennis
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
attached mail follows:
Hi! My problem is that if I try to debug my php file , not all the lines seams to be debugged cause not all the lines have that blue dot on the left side. Why?? If I try step by step I can see that some lines are skipped and some lines that actually don't have the code are "executed"????
Plz, help.
Thx, Krispi
attached mail follows:
Hi All, I'm running a script that reads the contents of images and stores them in a MySQL database. The problem I'm running into is that my server is seeing "\" as escape characters and stripping them out. I assume this has something to do with "Magic Quotes" or something of that nature but I'm not exactly sure which variable I'm playing with. For the time being I'm replacing any "\" with "\\" so it only escapes one of them, but I'm sure this is not the correct solution. If anyone has any idea what I'm doing wrong any info would be greatly appreciated. I apologize if this has already been discussed but I could not find it in the archive. Maybe I was searching for the wrong thing? Please help.
Thanks in advance, Brian Drexler
attached mail follows:
> I'm running a script that reads the contents of images and stores them > in a MySQL database. The problem I'm running into is that my server is > seeing "\" as escape characters and stripping them out. I assume this > has something to do with "Magic Quotes" or something of that nature but > I'm not exactly sure which variable I'm playing with. For the time > being I'm replacing any "\" with "\\" so it only escapes one of them, > but I'm sure this is not the correct solution. If anyone has any idea > what I'm doing wrong any info would be greatly appreciated. I > apologize if this has already been discussed but I could not find it in > the archive. Maybe I was searching for the wrong thing? Please help.
That's the correct solution. You can use addslashes() to do it for you. magic_quotes_gpc will do this automatically to data submitted through a form.
---John Holmes...
attached mail follows:
Sebastian --
...and then Sebastian said... % % every so often i get a blank email that contains an attachment, a ATTxyz.dat % and ATTxyz.txt why?
Don't know that for sure, but ...
% % I just got a reply from David T-G, Thread "Deleting a page after viewing it" % and its blank with an attachment..
... in my case it's because your MUA does not know what to do with a PGP-MIME signature (what it incorrectly calls that .dat file). You can open the .txt file and read the message. I hope you've figured that out by now or I guess you won't read this to see that, actually :-)
% % warm regards, % Sebastian - [BBR] Gaming Clan % http://www.broadbandreports.com
HTH & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+XhF0Gb7uCXufRwARAm6HAJ0c5O1/Q7w+f38zRJmGyCvffx/poQCeNBwH eJbeVXEUeLOZLVrS605KBgU= =NUOB -----END PGP SIGNATURE-----
attached mail follows:
Hmm... i cannot see your message,.. see it's blank below .. Seems to be only happening to your emails.
warm regards, Sebastian - [BBR] Gaming Clan http://www.broadbandreports.com
----- Original Message -----
From: "David T-G" <davidtg-php
justpickone.org>
To: "PHP General list" <php-general
lists.php.net>
Cc: "Sebastian" <sebastian
dslr.net>
Sent: Thursday, February 27, 2003 8:24 AM
Subject: Re: [PHP] PHP list problems?
attached mail follows:
haha, okay, I see now. your message was attached to a text file. thanks.
warm regards, Sebastian - [BBR] Gaming Clan http://www.broadbandreports.com
----- Original Message -----
From: "David T-G" <davidtg-php
justpickone.org>
To: "PHP General list" <php-general
lists.php.net>
Cc: "Sebastian" <sebastian
dslr.net>
Sent: Thursday, February 27, 2003 8:24 AM
Subject: Re: [PHP] PHP list problems?
attached mail follows:
just a fast question here.. and the lotic probably isnt to bright on my part and i think i know the answer to this question too but just to make sure... if you can include variables in an include file and use them outside that file (in the file that includes that file that is) then can you do the same with classes and functions
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
attached mail follows:
> just a fast question here.. and the lotic probably isnt to bright on my part > and i think i know the answer to this question too but just to make sure... > if you can include variables in an include file and use them outside that > file (in the file that includes that file that is) then can you do the same > with classes and functions
Yes. Most people put their common functions and classes into a single file that's included() on every other page.
---John Holmes...
attached mail follows:
"Sunfire" <rusty_81
msn.com> wrote in message
news:003201c2de64$f7d62e60$2304a40c
andy...
> just a fast question here.. and the lotic probably isnt to bright on my
part
> and i think i know the answer to this question too but just to make
sure...
> if you can include variables in an include file and use them outside that
> file (in the file that includes that file that is) then can you do the
same
> with classes and functions
yap.
rush
-- http://www.templatetamer.com/
attached mail follows:
yes (as has been said); the code in the included file adopts 'the scope in the place at the point of the include statement'. Hence if you were to put the the include statement in a function the vars in the included file would have the scope of that function; included outside a function they'll have global scope
David Eisenhart
"Sunfire" <rusty_81
msn.com> wrote in message
news:003201c2de64$f7d62e60$2304a40c
andy...
> just a fast question here.. and the lotic probably isnt to bright on my
part
> and i think i know the answer to this question too but just to make
sure...
> if you can include variables in an include file and use them outside that
> file (in the file that includes that file that is) then can you do the
same
> with classes and functions
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
>
attached mail follows:
Hello everybody,
I am relatively new to PHP and for quite some days I am trying to get a file upload system going through a standard html form. To test it I use an html page called Test2.php with a form in it with enctype=\"multipart/form-data\". Here is the source code:
<?php
$AppImageDir = Web/Images";
if (isset($_FILES["ImageFile"])) { move_uploaded_file($_FILES['ImageFile']['tmp_name'], $AppImageDir."/".$_FILES['ImageFile']['name']);
}
?>
<html> <head> <title>Web site - pages form</title> </head> <body> <?php
echo " <form action=\"Test2.php\" enctype=\"multipart/form-data\" method=\"post\"> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\"> <input type=\"file\" name=\"ImageFile\"> <input type=\"submit\" name=\"btnSubmit\" value=\"Upload\"> </form> "; ?>
</body> </html>
It is a standard straight forward image upload situation. You see that the form directs to itself (action=\"Test2.php\") and on top of the page a simple instruction to see if the file uploads correctly. As far as I can see, this is correct code. Note that the any \\ are to escape "" and further \\ (necesary in echo "" statements).
However, when I execute the page, I get the following error messages:
Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied in /Web/Test2.php on line 6
Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg' in /Web/Test2.php on line 6
It seems to say that I don't have permission to execute a file upload on that page. As you can see by the directory specifications this script runs on a Linux. However, I also tried the same script on a Windows machine, with the corresponding directory specifications of course, and with the same result: permission denied.
What is wrong here, where do I set what type of permissions in order to get the file upload to work? By the way, in the php.ini FileUpload is set at yes.
Kind regards, FRANS BAKKER
attached mail follows:
Seems that php does not have write access to that directory. Set it right and it should work.
Niklas
P.S. Tip: It's much quicker to create plain html without echo. Just do it like <form name="blah">, not like <? echo "<form name=\"blah\">"; ?> :)
-----Original Message-----
From: Frans Bakker [mailto:jfbakker
hermes-b2b.com]
Sent: 27. helmikuuta 2003 15:43
To: php-general
lists.php.net
Subject: [PHP] File upload problem - permission denied
Hello everybody,
I am relatively new to PHP and for quite some days I am trying to get a file upload system going through a standard html form. To test it I use an html page called Test2.php with a form in it with enctype=\"multipart/form-data\". Here is the source code:
<?php
$AppImageDir = Web/Images";
if (isset($_FILES["ImageFile"])) { move_uploaded_file($_FILES['ImageFile']['tmp_name'], $AppImageDir."/".$_FILES['ImageFile']['name']);
}
?>
<html> <head> <title>Web site - pages form</title> </head> <body> <?php
echo " <form action=\"Test2.php\" enctype=\"multipart/form-data\" method=\"post\"> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\"> <input type=\"file\" name=\"ImageFile\"> <input type=\"submit\" name=\"btnSubmit\" value=\"Upload\"> </form> "; ?>
</body> </html>
It is a standard straight forward image upload situation. You see that the form directs to itself (action=\"Test2.php\") and on top of the page a simple instruction to see if the file uploads correctly. As far as I can see, this is correct code. Note that the any \\ are to escape "" and further \\ (necesary in echo "" statements).
However, when I execute the page, I get the following error messages:
Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied in /Web/Test2.php on line 6
Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg' in /Web/Test2.php on line 6
It seems to say that I don't have permission to execute a file upload on that page. As you can see by the directory specifications this script runs on a Linux. However, I also tried the same script on a Windows machine, with the corresponding directory specifications of course, and with the same result: permission denied.
What is wrong here, where do I set what type of permissions in order to get the file upload to work? By the way, in the php.ini FileUpload is set at yes.
Kind regards, FRANS BAKKER
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
attached mail follows:
All right then. ¿Where do I set that permission for PHP? On my local Windows machine it is usually in IIS. However the whole ..\inetpub\wwwroot\.. directory already has read and write permissions. Apart from PHP I use Cold Fusion. With Cold Fusion I don't have any permission problems...
"Niklas lampén" <niklas.lists
publico.fi> escribió en el mensaje
news:021a01c2de66$e657cf20$ba93c5c3
Niklas...
Seems that php does not have write access to that directory. Set it right
and it should work.
Niklas
P.S. Tip: It's much quicker to create plain html without echo. Just do it like <form name="blah">, not like <? echo "<form name=\"blah\">"; ?> :)
-----Original Message-----
From: Frans Bakker [mailto:jfbakker
hermes-b2b.com]
Sent: 27. helmikuuta 2003 15:43
To: php-general
lists.php.net
Subject: [PHP] File upload problem - permission denied
Hello everybody,
I am relatively new to PHP and for quite some days I am trying to get a file upload system going through a standard html form. To test it I use an html page called Test2.php with a form in it with enctype=\"multipart/form-data\". Here is the source code:
<?php
$AppImageDir = Web/Images";
if (isset($_FILES["ImageFile"])) { move_uploaded_file($_FILES['ImageFile']['tmp_name'], $AppImageDir."/".$_FILES['ImageFile']['name']);
}
?>
<html> <head> <title>Web site - pages form</title> </head> <body> <?php
echo " <form action=\"Test2.php\" enctype=\"multipart/form-data\" method=\"post\"> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\"> <input type=\"file\" name=\"ImageFile\"> <input type=\"submit\" name=\"btnSubmit\" value=\"Upload\"> </form> "; ?>
</body> </html>
It is a standard straight forward image upload situation. You see that the form directs to itself (action=\"Test2.php\") and on top of the page a simple instruction to see if the file uploads correctly. As far as I can see, this is correct code. Note that the any \\ are to escape "" and further \\ (necesary in echo "" statements).
However, when I execute the page, I get the following error messages:
Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied in /Web/Test2.php on line 6
Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg' in /Web/Test2.php on line 6
It seems to say that I don't have permission to execute a file upload on that page. As you can see by the directory specifications this script runs on a Linux. However, I also tried the same script on a Windows machine, with the corresponding directory specifications of course, and with the same result: permission denied.
What is wrong here, where do I set what type of permissions in order to get the file upload to work? By the way, in the php.ini FileUpload is set at yes.
Kind regards, FRANS BAKKER
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
attached mail follows:
On linux you can do it in shell with chmod command. Do 'chmod 766 direcory'. You can find out more about chmod-command at http://www.die.net/doc/linux/man/man1/chmod.1.html.
Niklas
-----Original Message-----
From: Frans Bakker [mailto:jfbakker
hermes-b2b.com]
Sent: 27. helmikuuta 2003 16:03
To: php-general
lists.php.net
Subject: Re: [PHP] File upload problem - permission denied
All right then. ¿Where do I set that permission for PHP? On my local Windows machine it is usually in IIS. However the whole ..\inetpub\wwwroot\.. directory already has read and write permissions. Apart from PHP I use Cold Fusion. With Cold Fusion I don't have any permission problems...
"Niklas lampén" <niklas.lists
publico.fi> escribió en el mensaje
news:021a01c2de66$e657cf20$ba93c5c3
Niklas...
Seems that php does not have write access to that directory. Set it right
and it should work.
Niklas
P.S. Tip: It's much quicker to create plain html without echo. Just do it like <form name="blah">, not like <? echo "<form name=\"blah\">"; ?> :)
-----Original Message-----
From: Frans Bakker [mailto:jfbakker
hermes-b2b.com]
Sent: 27. helmikuuta 2003 15:43
To: php-general
lists.php.net
Subject: [PHP] File upload problem - permission denied
Hello everybody,
I am relatively new to PHP and for quite some days I am trying to get a file upload system going through a standard html form. To test it I use an html page called Test2.php with a form in it with enctype=\"multipart/form-data\". Here is the source code:
<?php
$AppImageDir = Web/Images";
if (isset($_FILES["ImageFile"])) { move_uploaded_file($_FILES['ImageFile']['tmp_name'], $AppImageDir."/".$_FILES['ImageFile']['name']);
}
?>
<html> <head> <title>Web site - pages form</title> </head> <body> <?php
echo " <form action=\"Test2.php\" enctype=\"multipart/form-data\" method=\"post\"> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\"> <input type=\"file\" name=\"ImageFile\"> <input type=\"submit\" name=\"btnSubmit\" value=\"Upload\"> </form> "; ?>
</body> </html>
It is a standard straight forward image upload situation. You see that the form directs to itself (action=\"Test2.php\") and on top of the page a simple instruction to see if the file uploads correctly. As far as I can see, this is correct code. Note that the any \\ are to escape "" and further \\ (necesary in echo "" statements).
However, when I execute the page, I get the following error messages:
Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied in /Web/Test2.php on line 6
Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg' in /Web/Test2.php on line 6
It seems to say that I don't have permission to execute a file upload on that page. As you can see by the directory specifications this script runs on a Linux. However, I also tried the same script on a Windows machine, with the corresponding directory specifications of course, and with the same result: permission denied.
What is wrong here, where do I set what type of permissions in order to get the file upload to work? By the way, in the php.ini FileUpload is set at yes.
Kind regards, FRANS BAKKER
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
attached mail follows:
Make sure whatever user the _web server_ is running as has access to write to that directory.
With IIS, this is the IUSR_<computer_name> account.
> $AppImageDir = Web/Images";
You've got a error in that line, also, hopefully it's just a typo, though.
---John Holmes...
----- Original Message -----
From: "Niklas Lampén" <niklas.lists
publico.fi>
To: "Php-General" <php-general
lists.php.net>
Sent: Thursday, February 27, 2003 9:07 AM
Subject: RE: [PHP] File upload problem - permission denied
On linux you can do it in shell with chmod command. Do 'chmod 766 direcory'. You can find out more about chmod-command at http://www.die.net/doc/linux/man/man1/chmod.1.html.
Niklas
-----Original Message-----
From: Frans Bakker [mailto:jfbakker
hermes-b2b.com]
Sent: 27. helmikuuta 2003 16:03
To: php-general
lists.php.net
Subject: Re: [PHP] File upload problem - permission denied
All right then. ¿Where do I set that permission for PHP? On my local Windows machine it is usually in IIS. However the whole ..\inetpub\wwwroot\.. directory already has read and write permissions. Apart from PHP I use Cold Fusion. With Cold Fusion I don't have any permission problems...
"Niklas lampén" <niklas.lists
publico.fi> escribió en el mensaje
news:021a01c2de66$e657cf20$ba93c5c3
Niklas...
Seems that php does not have write access to that directory. Set it right
and it should work.
Niklas
P.S. Tip: It's much quicker to create plain html without echo. Just do it like <form name="blah">, not like <? echo "<form name=\"blah\">"; ?> :)
-----Original Message-----
From: Frans Bakker [mailto:jfbakker
hermes-b2b.com]
Sent: 27. helmikuuta 2003 15:43
To: php-general
lists.php.net
Subject: [PHP] File upload problem - permission denied
Hello everybody,
I am relatively new to PHP and for quite some days I am trying to get a file upload system going through a standard html form. To test it I use an html page called Test2.php with a form in it with enctype=\"multipart/form-data\". Here is the source code:
<?php
$AppImageDir = Web/Images";
if (isset($_FILES["ImageFile"])) { move_uploaded_file($_FILES['ImageFile']['tmp_name'], $AppImageDir."/".$_FILES['ImageFile']['name']);
}
?>
<html> <head> <title>Web site - pages form</title> </head> <body> <?php
echo " <form action=\"Test2.php\" enctype=\"multipart/form-data\" method=\"post\"> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\"> <input type=\"file\" name=\"ImageFile\"> <input type=\"submit\" name=\"btnSubmit\" value=\"Upload\"> </form> "; ?>
</body> </html>
It is a standard straight forward image upload situation. You see that the form directs to itself (action=\"Test2.php\") and on top of the page a simple instruction to see if the file uploads correctly. As far as I can see, this is correct code. Note that the any \\ are to escape "" and further \\ (necesary in echo "" statements).
However, when I execute the page, I get the following error messages:
Warning: Unable to create '/Web/Images/cartel_feria1.jpg': Permission denied in /Web/Test2.php on line 6
Warning: Unable to move '/tmp/php0jHeNE' to '/Web/Images/cartel_feria1.jpg' in /Web/Test2.php on line 6
It seems to say that I don't have permission to execute a file upload on that page. As you can see by the directory specifications this script runs on a Linux. However, I also tried the same script on a Windows machine, with the corresponding directory specifications of course, and with the same result: permission denied.
What is wrong here, where do I set what type of permissions in order to get the file upload to work? By the way, in the php.ini FileUpload is set at yes.
Kind regards, FRANS BAKKER
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
########################################### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Greetings...
When the following runs.......... =========================================================== <?php
$handle = fopen ("fopen.txt", "r"); $date = date("l dS of F Y h:i:s: A");
while (!feof ($handle)) ; { $buffer = fgets($handle, 4096); echo '<textarea>'. $buffer. '</textarea>'; } fclose($handle); ?> ============================================================
.....it gives out........
============================================================
Fatal error: Maximum execution time of 30 seconds exceeded in /home/data/ClientWebs/chrisplay/Things/fopen.php on line 16 ============================================================
I used the example from php.net/fget() and have tried a few changes based on other stuff I read, but to no avail.....
Line 16 is = " while (!feof ($handle)) ; "
Suggestions ?
-- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 It is reported that somewhere in the world, every 15 seconds, a woman gives birth to a child. She must be found and stopped.
attached mail follows:
Hi Chris, You should delete the ; after the while statement because it causes an infinite loop.
----- Original Message -----
From: "Chris Blake" <cblake
pbpc.co.za>
To: <php-general
lists.php.net>
Sent: Thursday, February 27, 2003 16:29
Subject: [PHP] Reading files
> Greetings... > > When the following runs.......... > =========================================================== > <?php > > $handle = fopen ("fopen.txt", "r"); > $date = date("l dS of F Y h:i:s: A"); > > while (!feof ($handle)) ; > { > $buffer = fgets($handle, 4096); > echo '<textarea>'. $buffer. '</textarea>'; > > } > fclose($handle); > ?> > ============================================================ > > .....it gives out........ > > ============================================================ > > Fatal error: Maximum execution time of 30 seconds exceeded in > /home/data/ClientWebs/chrisplay/Things/fopen.php on line 16 > ============================================================ > > I used the example from php.net/fget() and have tried a few changes > based on other stuff I read, but to no avail..... > > Line 16 is = " while (!feof ($handle)) ; " > > Suggestions ? > > > -- > Chris Blake > Office : (011) 782-0840 > Cell : 083 985 0379 > It is reported that somewhere in the world, every 15 seconds, a woman > gives birth to a child. She must be found and stopped. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> while (!feof ($handle)) ;
Take that semi-colon away. You're running this loop continously.
---John Holmes...
attached mail follows:
I am sending an xml request as part of the url using urlencode to encode my xml. It doesnt work like that so the server that is receiving it doesnt seem to like the data in the query string. However, if I send it from a form using the method post then it works fine. Is there a way to send it by method post but without having to use a form? Thank you
attached mail follows:
How can I display the script file name? Presumably something like-:
<?php echo $ScriptFileName; ?>
While I'm learning php and developing various Web page versions, I want to be sure the that the display is from the appropriate script.
Regards Stephen Ford, Surrey, UK
attached mail follows:
echo $_SERVER['PHP_SELF'];
"Stephen Ford" <stephen_ford
ntlworld.com> wrote in message
news:20030227151305.14870.qmail
pb1.pair.com...
> How can I display the script file name? Presumably something like-:
>
> <?php
> echo $ScriptFileName;
> ?>
>
> While I'm learning php and developing various Web page versions, I want to
> be sure the that the display is from the appropriate script.
>
> Regards
> Stephen Ford, Surrey, UK
>
>
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]