|
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: Mon Nov 25 2002 - 16:21:26 CST
php-general Digest 25 Nov 2002 22:21:26 -0000 Issue 1726
Topics (messages 125910 through 126007):
Problem on OpenDir()
125910 by: Jack
125998 by: Joakim Andersson
Overloading Constructors
125911 by: Dan Field
125914 by: Jacob Larsen
125920 by: Ernest E Vogelsinger
125923 by: Dan Field
Re: Setting values of php.ini file at runtime
125912 by: DL Neil
125913 by: Justin French
125915 by: Jason Wong
125916 by: DL Neil
125956 by: Rasmus Lerdorf
Send multiple SQL staments in one query
125917 by: Miguel López Dinaweb Dpto. Programación
125919 by: 1LT John W. Holmes
125929 by: Seth Remington
125934 by: . Edwin
125935 by: . Edwin
125946 by: Miguel López Dinaweb Dpto. Programación
Re: does //commenting reduce performance?
125918 by: DL Neil
File Write Permission Errors - HELP! URGENT!!!
125921 by: Phil Powell
125925 by: Craig
125926 by: Phil Powell
125930 by: Marek Kilimajer
Re: How to cache PHP on Apache
125922 by: Luanna Silva
Sessions/Browser back button
125924 by: Craig
125927 by: Justin French
125931 by: 1LT John W. Holmes
Re: Insert file into sql server binary field.
125928 by: Marek Kilimajer
Upgrade issues
125932 by: Chris Knipe
125933 by: . Edwin
125950 by: Chris Knipe
125953 by: . Edwin
125963 by: Chris Knipe
125966 by: Marek Kilimajer
125969 by: Chris Knipe
Re: image generation with PHP
125936 by: . Edwin
Re: Sending POST vars to pop-up window - How?
125937 by: . Edwin
Re: Connection string and Monday Morning blues
125938 by: . Edwin
Re: Linux Question
125939 by: . Edwin
125947 by: Brian V Bonini
Php Search Engine
125940 by: msmecca.mindspring.com
125943 by: Marco Tabini
125944 by: Craig
125949 by: Brad Pauly
IIS and PHP with pass through authentication
125941 by: Shaun Garriock
Re: Browser going to page twice?
125942 by: . Edwin
enable-inline-optimization
125945 by: Jacob Larsen
Re: Sorting parsed XML
125948 by: . Edwin
125960 by: Chris
125972 by: Geoff Hankerson
125991 by: Chris
Newbie: ereg
125951 by: Martin Johansson
125961 by: Kyle Gibson
125986 by: Mattia
PHP.net spam protection
125952 by: Gene Bandy
125962 by: Jason Wong
Automajickally POST to a remote form
125954 by: Kris Williams
125957 by: 1LT John W. Holmes
125980 by: Chris Shiflett
Re: How to obtain unique XML Elements
125955 by: . Edwin
Re: BBCode?
125958 by: Kyle Gibson
125959 by: Leif K-Brooks
125968 by: Jason Wong
125976 by: Michael Geier
125993 by: Kyle Gibson
126005 by: Jason Wong
126006 by: Kyle Gibson
126007 by: Kyle Gibson
imagecopyresized
125964 by: adrian murphy.2020tourism.com
125971 by: Jason Wong
125974 by: Morgan Hughes
125977 by: adrian murphy.2020tourism.com
125988 by: Morgan Hughes
Re: php-4.3.0pre2, fgets and socket_get_status
125965 by: Stephen Grier
Re: Recommendations for PHP/MySQl calendar & on-line submission/votin g
125967 by: David T-G
sockets (again)
125970 by: Gareth Thomas
125973 by: Stephan Seidt
imap
125975 by: Greg
125981 by: Jason Wong
125982 by: Thomas Seifert
126000 by: Greg
Continuing Session Within Socket
125978 by: Chris Johnson
125979 by: Chris Johnson
array manipulations
125983 by: Mattia
Form trouble
125984 by: David H
125985 by: Clint Tredway
125989 by: Chris Boget
125990 by: David H
125994 by: Clint Tredway
125995 by: Chris Shiflett
php_value disable_functions sintax?
125987 by: Rodolfo Gonzalez
125992 by: Rasmus Lerdorf
125996 by: Rodolfo Gonzalez
FTP'ing with function
125997 by: poliva.cox.net
125999 by: Matt Vos
Starting an application on web server
126001 by: Nic Fordham
Missing images
126002 by: Baumann Reto
RedHat 8.0 php_flag invalid command error
126003 by: Gary Smith
Post your announcements in PHP Journal
126004 by: Martin Streicher, Editor
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:
Dear all
here is the path i want to open for reading files from it!
path = "c:/pdf_reports/bills/Oct-02"
i always got returned with these error :
" Warning: OpenDir: Invalid argument (errno 22) in c:/page.php on line 21"
"Warning: Supplied argument is not a valid Directory resource in c:/page.php
line 22"
but
when i change the path to : "c:/pdf_reports/bills/"
then
it can list all the files within this folder "bills".
I'm sure that the folder Oct-02 is exist inside bills directory! So i
haven't go any idea!
Could someone pls give me some hints!
Jack
attached mail follows:
Jack wrote:
> Dear all
> here is the path i want to open for reading files from it!
> path = "c:/pdf_reports/bills/Oct-02"
Here you have no trailing /
--- Snip ---
> when i change the path to : "c:/pdf_reports/bills/"
But here you do...
It should not make a difference as far as I know, but it may be worth a
try. Have you tried other subfolders?
Post your code and point out the lines that give errors.
Regards
Joakim
attached mail follows:
is it doable?
ie
class myClass {
var $myInt;
// default constructor
function myClass() {
}
// overloaded constructor
function myClass($newInt) {
$this->myInt = $newInt;
}
}
-- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council.******************************************************************************** Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system.
Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper.
******************************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
********************************************************************************
attached mail follows:
Yes.
"Dan Field" <danf
ceredigion.gov.uk> skrev i en meddelelse
news:1038221845.1245.144.camel
dsspc...
> is it doable?
>
> ie
>
> class myClass {
> var $myInt;
>
> // default constructor
> function myClass() {
> }
>
> // overloaded constructor
> function myClass($newInt) {
> $this->myInt = $newInt;
> }
>
> }
>
>
> --
> Dan Field
> Systems Development Officer - Social Services Dept.
> Ceredigion County Council.
>
>
>
>
****************************************************************************
****
> Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi,
> yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi
ato.
> Pe dderbynioch y neges hon mewn camgymeriad, byddwch
> mor garedig a rhoi gwybod i'r rheolwr system.
>
> Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi
> cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper.
>
>
****************************************************************************
****
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
>
****************************************************************************
****
>
attached mail follows:
At 11:57 25.11.2002, Dan Field said: --------------------[snip]-------------------- >is it doable? > >class myClass { > var $myInt; > > // default constructor > function myClass() { > } > > // overloaded constructor > function myClass($newInt) { > $this->myInt = $newInt; > } >} --------------------[snip]--------------------
At least not with PHP 4.2:
<?php class A { function A() { echo "default constructor A()\n"; } function A($string) { echo "overloaded constructor A($string)\n"; } }
$a1 = new A(); $a2 = new A('Test');
?>
Results in: overloaded constructor A() overloaded constructor A(Test) thus bypassing the default constructor and calling the overloaded constructor both times.
What you might do to distinguish which "overload" has been called:
function A($string=null) { if (!isset($string)) echo "Default constructor A()\n"; else echo "Overloaded constructor A($string)\n"; }
Hope this helps,
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
On Mon, 2002-11-25 at 10:57, Dan Field wrote: > is it doable?
well I found a way. It's a bit of a hack but FYI heres how it works:
function Form() { // a slight hack which allows us to overload // constructors by the number of args
$name = "Form".func_num_args(); $arg_list = func_get_args(); $num_args = func_num_args(); switch($num_args) { case 0: $this->$name(); break; case 6: $this->$name( $arg_list[0], $arg_list[1], $arg_list[2], $arg_list[3], $arg_list[4], $arg_list[5]); break; default: echo "Wrong number of args for constructor!"; } }
// pseudo-constructor for 0 args function Form0() { $this->formName = "myForm"; $this->formAction = $_SERVER['PHP_SELF']; $this->formMethod = "POST"; $this->formVersion = "xhtml"; $this->formLanguage = "en_gb"; $this->formStyle = "/styles/form.css"; $this->formElementCount = 0; }
// pseudo-constructor for 6 args function Form6($formName, $formAction, $formMethod, $formVersion, $formLanguage, $formStyle) { $this->formName = $formName; $this->formAction = $formAction; $this->formMethod = $formMethod; $this->formVersion = $formVersion; $this->formLanguage = $formLanguage; $this->formStyle = $formStyle; $this->formElementCount = 0; // don't allow user to set this }
-- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council.******************************************************************************** Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system.
Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper.
******************************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
********************************************************************************
attached mail follows:
Excuse me breaking in...somewhat similar problem:
Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On.
Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely?
Please advise, =dn
> You cannot do it inside a script as the register_globals magic happens > before the script starts executing, so toggling the setting at runtime is > too late. > > -Rasmus > > On Mon, 25 Nov 2002, Tariq Murtaza wrote: > > > Dear All, > > > > I am wondering if anyone shed some light. > > i am thinking of setting value for php.ini variables like > > register_globals = ON/OFF at runtime (within our php script). > > Is there any function built-in in php?, or can we do it ourselves. > > > > Looking forward, > > Thanks > > > > Tariq > > > > > > > > -- > > 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:
a .htaccess file in the directory you want RG OFF (ie /wiki/) should do the trick:
<IfModule mod_php4.c> php_flag register_globals on </IfModule>
This seems to work for me...
on 25/11/02 10:37 PM, DL Neil (PHPml
DandE.HomeChoice.co.uk) wrote:
> Excuse me breaking in...somewhat similar problem: > > Have set up a client recently, preaching security persuaded them into > updating so that could run Register_Globals=Off. Now they want to install a > 'wiki' which requires (to my horror) Register_Globals=On. > > Short of two Apache/PHP servers, what is a logical way to structure things > so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more > securely? > > Please advise, > =dn > > >> You cannot do it inside a script as the register_globals magic happens >> before the script starts executing, so toggling the setting at runtime is >> too late. >> >> -Rasmus >> >> On Mon, 25 Nov 2002, Tariq Murtaza wrote: >> >>> Dear All, >>> >>> I am wondering if anyone shed some light. >>> i am thinking of setting value for php.ini variables like >>> register_globals = ON/OFF at runtime (within our php script). >>> Is there any function built-in in php?, or can we do it ourselves. >>> >>> Looking forward, >>> Thanks >>> >>> Tariq >>> >>> >>> >>> -- >>> 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 >> >> >
Justin French -------------------- http://Indent.com.au Web Development & Graphic Design --------------------
attached mail follows:
On Monday 25 November 2002 19:37, DL Neil wrote: > Excuse me breaking in...somewhat similar problem: > > Have set up a client recently, preaching security persuaded them into > updating so that could run Register_Globals=Off. Now they want to install a > 'wiki' which requires (to my horror) Register_Globals=On. > > Short of two Apache/PHP servers, what is a logical way to structure things > so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more > securely?
Set it on a per directory basis. If using Apache something like:
<Directory "/home/www.example.com/wiki_directory"> php_value register_globals 1 </Directory>
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* There is nothing more silly than a silly laugh. -- Gaius Valerius Catullus */
attached mail follows:
Justin, Neat! Don't limit thoughts to PHP when can solve it in Apache - thank you, =dn
> a .htaccess file in the directory you want RG OFF (ie /wiki/) should do
the
> trick:
>
> <IfModule mod_php4.c>
> php_flag register_globals on
> </IfModule>
>
> This seems to work for me...
>
>
> on 25/11/02 10:37 PM, DL Neil (PHPml
DandE.HomeChoice.co.uk) wrote:
>
> > Excuse me breaking in...somewhat similar problem:
> >
> > Have set up a client recently, preaching security persuaded them into
> > updating so that could run Register_Globals=Off. Now they want to
install a
> > 'wiki' which requires (to my horror) Register_Globals=On.
> >
> > Short of two Apache/PHP servers, what is a logical way to structure
things
> > so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more
> > securely?
> >
> > Please advise,
> > =dn
> >
> >
> >> You cannot do it inside a script as the register_globals magic happens
> >> before the script starts executing, so toggling the setting at runtime
is
> >> too late.
> >>
> >> -Rasmus
> >>
> >> On Mon, 25 Nov 2002, Tariq Murtaza wrote:
> >>
> >>> Dear All,
> >>>
> >>> I am wondering if anyone shed some light.
> >>> i am thinking of setting value for php.ini variables like
> >>> register_globals = ON/OFF at runtime (within our php script).
> >>> Is there any function built-in in php?, or can we do it ourselves.
> >>>
> >>> Looking forward,
> >>> Thanks
> >>>
> >>> Tariq
> >>>
> >>>
> >>>
> >>> --
> >>> 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
> >>
> >>
> >
>
> Justin French
> --------------------
> http://Indent.com.au
> Web Development &
> Graphic Design
> --------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Just set register_globals on in the wiki directory.
Like this in your httpd.conf:
<Directory /path/to/wiki> php_admin_flag register_globals on </Directory>
-Rasmus
On Mon, 25 Nov 2002, DL Neil wrote:
> Excuse me breaking in...somewhat similar problem: > > Have set up a client recently, preaching security persuaded them into > updating so that could run Register_Globals=Off. Now they want to install a > 'wiki' which requires (to my horror) Register_Globals=On. > > Short of two Apache/PHP servers, what is a logical way to structure things > so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more > securely? > > Please advise, > =dn > > > > You cannot do it inside a script as the register_globals magic happens > > before the script starts executing, so toggling the setting at runtime is > > too late. > > > > -Rasmus > > > > On Mon, 25 Nov 2002, Tariq Murtaza wrote: > > > > > Dear All, > > > > > > I am wondering if anyone shed some light. > > > i am thinking of setting value for php.ini variables like > > > register_globals = ON/OFF at runtime (within our php script). > > > Is there any function built-in in php?, or can we do it ourselves. > > > > > > Looking forward, > > > Thanks > > > > > > Tariq > > > > > > > > > > > > -- > > > 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:
Hi,
I can't send multiple sql staments in one query, i always get an error saying that the sentece is incorrect, i thorw the sentece in a mysql console and works fine, i'm sepraing sentences with ; i try to separe using ;\n or ;\r\n but don't work
Anyone can help me?
:-)
________________________________________________________
Miguel López Sánchez
Programador
Voz +34 902 014 945 E-mail: mlopez
dinaweb.com
--------------------------------------------------------
Dinaweb Networks s.l.
Rúa das Orfas 27
15703 Santiago de Compostela A Coruña Gz Sp ECC
Voz +34 902 014 945 GMT+1
E-mail: info
dinaweb.com
--------------------------------------------------------
http://www.dinaweb.com http://www.dinahosting.com
http://www.u-lo.com\\\\\\\\ http://www.empregogalego.com
________________________________________________________
attached mail follows:
---------------------------------------------------------------------- I can't send multiple sql staments in one query, i always get an error saying that the sentece is incorrect, i thorw the sentece in a mysql console and works fine, i'm sepraing sentences with ; i try to separe using ;\n or ;\r\n but don't work ----------------------------------------------------------------------
No, can't do it. Only one query per mysql_query() call. Not sure with other database interfaces, but it should be the same.
---John Holmes...
attached mail follows:
Miguel lópez dinaweb dpto. programación wrote:
> Hi,
>
> I can't send multiple sql staments in one query, i always get an error
> saying that the sentece is incorrect, i thorw the sentece in a mysql
> console and works fine, i'm sepraing sentences with ; i try to separe
> using ;\n or ;\r\n but don't work
>
> Anyone can help me?
>
> :-)
> ________________________________________________________
> Miguel López Sánchez
> Programador
> Voz +34 902 014 945 E-mail: mlopez
dinaweb.com
> --------------------------------------------------------
> Dinaweb Networks s.l.
> Rúa das Orfas 27
> 15703 Santiago de Compostela A Coruña Gz Sp ECC
> Voz +34 902 014 945 GMT+1
> E-mail: info
dinaweb.com
> --------------------------------------------------------
> http://www.dinaweb.com http://www.dinahosting.com
> http://www.u-lo.com http://www.empregogalego.com
> ________________________________________________________
>
Hi Miguel,
Here's a function that I use to run multiple SQL statements at once - similar to running MySQL in batch mode. It relies on a semicolon to separate the SQL statements.
function SendBatchQuery($db_host, $db_base, $db_user, $db_pw, $query) { $message = "Connection with server $db_host failed"; mysql_connect($db_host, $db_user, $db_pw) or die($message); $message = "Could not select database $db_base"; mysql_select_db($db_base) or die($message); $array = explode(';', $query); foreach($array as $value) { if(!$result = mysql_query($value)) { break; } } return $result; }
Enjoy,
Seth Remington SaberLogic, LLC 661-B Weber Drive Wadsworth, Ohio 44281 Phone: (330)335-6442 Fax: (330)336-8559
attached mail follows:
Hello,
"Seth Remington" <sremington
saberlogic.com> wrote:
[snip] > Here's a function that I use to run multiple SQL statements at once - [/snip]
...perhaps, a better way to put it is "run multiple SQL statements" _one after another_ :)
It's a good approach though. ;)
- E
attached mail follows:
Hello,
"1LT John W. Holmes" <holmes072000
charter.net> wrote:
[snip] > No, can't do it. Only one query per mysql_query() call. Not sure with other > database interfaces, but it should be the same. [/snip]
Yes, you cannot do it in MySQL. But you can do it with others.
(I think it was discussed before--about "sql injection" or something...)
- E
attached mail follows:
Hi,
The problem is that i need to do only one mysql_query, i'm working whith a remote database and i have .5 seconds in response time, to one - four querys is less than two seconds Ok is fast but is i do 10 querys i need 5 seconds very slow.
:-)
________________________________________________________
Miguel López Sánchez
Programador
Voz +34 902 014 945 E-mail: mlopez
dinaweb.com
--------------------------------------------------------
Dinaweb Networks s.l.
Rúa das Orfas 27
15703 Santiago de Compostela A Coruña Gz Sp ECC
Voz +34 902 014 945 GMT+1
E-mail: info
dinaweb.com
--------------------------------------------------------
http://www.dinaweb.com http://www.dinahosting.com
http://www.u-lo.com\\\\\\\\ http://www.empregogalego.com
________________________________________________________
-----Mensaje original-----
De:
Edwin [mailto:copperwalls
hotmail.com]
Enviado el: lunes, 25 de noviembre de 2002 16:25
Para: Seth Remington; Miguel lópez dinaweb dpto. programación
CC: php-general
lists.php.net
Asunto: Re: [PHP] Re: Send multiple SQL staments in one query
Hello,
"Seth Remington" <sremington
saberlogic.com> wrote:
[snip] > Here's a function that I use to run multiple SQL statements at once - [/snip]
...perhaps, a better way to put it is "run multiple SQL statements" _one after another_ :)
It's a good approach though. ;)
- E
attached mail follows:
Jason, ad infinitum, ad nauseum
However it was your recent post that (sig file) quoted the Freudian: ontogency recapitulates phylogeny
We should make them become more like us - even if we kill them in the process! =dn
> On Sunday 24 November 2002 22:58, DL Neil wrote: > > Neatly done Ernest! > > Also in showing how these questions are best answered with five minutes on > > the PC, than a msg to the list... > > ... until someone else comes along and asks a similar question and you have to > show them again how it's best answered with five minutes on the PC, than a > msg to the list ... ad infinitum > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Who's on first? > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hi I have the following code that breaks:
// PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT $fileID = fopen($path . "/nicknames.txt", "a") or die("Could not open " . $path . "/nicknames.txt"); chmod($path . "/nicknames.txt", 0755); fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID); $fileID = fopen($path . "/messages.txt", "a") or die("Could not open " . $path . "/messages.txt"); fputs($fileID, "*** WELCOME \"" . $nickname . "\" TO THE ROOM ***"); fflush($fileID); fclose($fileID);
I am getting the following error: Warning: fopen("/users/ppowell/web/chat/nicknames.txt", "a") - Permission denied in /users/ppowell/web/chat/chat.php on line 163
I am attempting to write onto the files if they exist, if not, create them on the fly. I need the solution in the next 5 minutes - sorry, kind of an emergency!
If anyone can help, please tell me what to do, the PHP manuals are not giving me a clear solution as to how to write to a file that does not yet exist that has to have the permissions of 0755 for both files.
Thanx Phil
attached mail follows:
you must give the same permissions to the folder also.
"Phil Powell" <soazine
erols.com> wrote in message
news:0ca201c2947e$44690a80$dcbe6444
scandinawa1bo6...
Hi I have the following code that breaks:
// PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT $fileID = fopen($path . "/nicknames.txt", "a") or die("Could not open " . $path . "/nicknames.txt"); chmod($path . "/nicknames.txt", 0755); fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID); $fileID = fopen($path . "/messages.txt", "a") or die("Could not open " . $path . "/messages.txt"); fputs($fileID, "*** WELCOME \"" . $nickname . "\" TO THE ROOM ***"); fflush($fileID); fclose($fileID);
I am getting the following error: Warning: fopen("/users/ppowell/web/chat/nicknames.txt", "a") - Permission denied in /users/ppowell/web/chat/chat.php on line 163
I am attempting to write onto the files if they exist, if not, create them on the fly. I need the solution in the next 5 minutes - sorry, kind of an emergency!
If anyone can help, please tell me what to do, the PHP manuals are not giving me a clear solution as to how to write to a file that does not yet exist that has to have the permissions of 0755 for both files.
Thanx Phil
attached mail follows:
I did just that. Permissions are set the /chat folder as it is in all other folders. This is the first time I've ever done fopen with "w" and I can't get it to write, always getting "unable to access" errors. I want to be able to create the file if it does not exist. It works for me to do "r" in all other folders with the same permissions as /chat.
Phil
"Craig" <craig
phirus.com> wrote in message
news:20021125130406.48304.qmail
pb1.pair.com...
> you must give the same permissions to the folder also.
>
>
> "Phil Powell" <soazine
erols.com> wrote in message
> news:0ca201c2947e$44690a80$dcbe6444
scandinawa1bo6...
> Hi I have the following code that breaks:
>
> // PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT
> $fileID = fopen($path . "/nicknames.txt", "a") or die("Could not open "
.
> $path . "/nicknames.txt");
> chmod($path . "/nicknames.txt", 0755);
> fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID);
> $fileID = fopen($path . "/messages.txt", "a") or die("Could not open "
.
> $path . "/messages.txt");
> fputs($fileID, "*** WELCOME \"" . $nickname . "\" TO THE ROOM ***");
> fflush($fileID); fclose($fileID);
>
>
> I am getting the following error:
> Warning: fopen("/users/ppowell/web/chat/nicknames.txt", "a") - Permission
> denied in /users/ppowell/web/chat/chat.php on line 163
>
> I am attempting to write onto the files if they exist, if not, create them
> on the fly. I need the solution in the next 5 minutes - sorry, kind of an
> emergency!
>
> If anyone can help, please tell me what to do, the PHP manuals are not
> giving me a clear solution as to how to write to a file that does not yet
> exist that has to have the permissions of 0755 for both files.
>
> Thanx
> Phil
>
>
>
attached mail follows:
If you want to create a file, the directory must be writeable to the server proces, so if the directory is owned by you do chmod o+w chat
Phil Powell wrote:
>I did just that. Permissions are set the /chat folder as it is in all other
>folders. This is the first time I've ever done fopen with "w" and I can't
>get it to write, always getting "unable to access" errors. I want to be able
>to create the file if it does not exist. It works for me to do "r" in all
>other folders with the same permissions as /chat.
>
>Phil
>
>"Craig" <craig
phirus.com> wrote in message
>news:20021125130406.48304.qmail
pb1.pair.com...
>
>
>>you must give the same permissions to the folder also.
>>
>>
>>"Phil Powell" <soazine
erols.com> wrote in message
>>news:0ca201c2947e$44690a80$dcbe6444
scandinawa1bo6...
>>Hi I have the following code that breaks:
>>
>>// PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT
>> $fileID = fopen($path . "/nicknames.txt", "a") or die("Could not open "
>>
>>
>.
>
>
>>$path . "/nicknames.txt");
>> chmod($path . "/nicknames.txt", 0755);
>> fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID);
>> $fileID = fopen($path . "/messages.txt", "a") or die("Could not open "
>>
>>
>.
>
>
>>$path . "/messages.txt");
>> fputs($fileID, "*** WELCOME \"" . $nickname . "\" TO THE ROOM ***");
>>fflush($fileID); fclose($fileID);
>>
>>
>>I am getting the following error:
>>Warning: fopen("/users/ppowell/web/chat/nicknames.txt", "a") - Permission
>>denied in /users/ppowell/web/chat/chat.php on line 163
>>
>>I am attempting to write onto the files if they exist, if not, create them
>>on the fly. I need the solution in the next 5 minutes - sorry, kind of an
>>emergency!
>>
>>If anyone can help, please tell me what to do, the PHP manuals are not
>>giving me a clear solution as to how to write to a file that does not yet
>>exist that has to have the permissions of 0755 for both files.
>>
>>Thanx
>>Phil
>>
>>
>>
>>
>>
>
>
>
>
>
attached mail follows:
Hello!
So, let me see if i understood:
1) Static content like Google´s logo(which i see every ten minutes :-) ) are cached with no problems. Actually, i´ve got that working. Does that always depend on the If-Modified-Since header?
2) Given that i send the proper header, could i receive as a response the 304 Not Modified for a dynamic content (GET something.php), just like the logo? If so, what would the proper header be?
3) Lets say that i got the php-response browser-cache working. Is it possible to store the cached response on my reverse proxy instead of the browser itself? Actually, thats what i would like to happen.
Thank you for the help and best regards!
Luanna
-----Mensagem original-----
De: Chris Shiflett [mailto:shiflett
php.net]
Enviada em: sexta-feira, 22 de novembro de 2002 18:40
Para: Luanna Silva; php-general
lists.php.net
Assunto: Re: RES: [PHP] RE: How to cache PHP on Apache
Well, my explanation was not complete, because I wanted to make sure I was talking about the right thing. :-)
One important thing I failed to mention is that caching applies to responses to GET and HEAD requests. If the response you showed us was a reply to a POST, it is not going to be cached.
As far as the 304 responses are concerned, this depends in part on the Web browser. For example, if the browser sends a conditional GET request with an If-Modified-Since header (it has a date as a value), the Web server will make a decision. If the resource being requested has in fact been modified since the specified date, the entire resource is returned in a 200 OK response. If it has remained unchanged, a 304 Not Modified response is sent with no content, saving bandwidth.
If you would like a good example to compare responses with, request an image from your Web server and notice the HTTP headers used. If you take a page such as Google as an example, your browser requests http://www.google/com first, receives the HTML from that, then notices the embedded image and requests http://www.google.com/images/logo.gif in a separate request. If you are like me and visit Google all the time, your browser has this image saved and rarely (usually only on holidays) gets anything but a 304 response from Google.
So, for pages you make available via GET requests that you want to be cachable in the same way as Google's logo, you can start by mimicking what they do. Here is an example of the HTTP transactions required to see http://www.google.com/ (HTML and some headers edited for readability):
------------------------------ GET / HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (...) Accept: text/xml, ... Accept-Language: en-us, en;q=0.50 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Cache-Control: max-age=0 ------------------------------ HTTP/1.1 200 OK Content-Length: 9390 Server: GWS/2.0 Date: Fri, 22 Nov 2002 20:31:18 GMT Content-Type: text/html Cache-control: private
<html>... ------------------------------ GET /images/logo.gif HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (...) Accept-Language: en-us, en;q=0.50 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Accept: video/x-mng, ... Referer: http://www.google.com/ If-Modified-Since: Mon, 21 Oct 2002 02:32:25 GMT Cache-Control: max-age=0 ------------------------------ HTTP/1.1 304 Not Modified Content-Length: 0 Server: GWS/2.0 Content-Type: text/html Date: Fri, 22 Nov 2002 20:31:19 GMT ------------------------------
Hopefully that provides a little more information to get you going.
Chris
--- Luanna Silva <luanna.silva
promon.com.br> wrote:
> For the moment, i want to cache the HTTP Response. So, if i´m > correct, the header that i sent to the list should do the job.
> I thought that, if the responses were cached, the access.log file > would have 304 codes on the responses for php scripts. Is that > correct? Well, if it is, that´s not happening.
attached mail follows:
I remember seeing threads debating this before, but is there anyway to disable/prevent a user from heading back in the browser and getting the "WARNING: Page has Expired" notice?
Cheers Craig
attached mail follows:
on 26/11/02 12:03 AM, Craig (craig
phirus.com) wrote:
> I remember seeing threads debating this before, but is there anyway to > disable/prevent a user from heading back in the browser and getting the > "WARNING: Page has Expired" notice?
This is more like a diversion around the problem... It will either be relevant to your problem, or not :)
In particular, I use this to prevent people from refreshing their page (and hence adding something to the DB twice for example).
Lets say you have form.php, which submits to process.php... the aim is to have process.php as a server-only script (ie, nothing is sent to the browser), with a header() redirect to a thankyou.php page once I've added stuff to the DB, or whatever....
The point is, they'll never see a page expired message in this case, because the script receiving the POST information never gets to the browser.
This may or may not help, depending on your problem :)
Justin French -------------------- http://Indent.com.au Web Development & Graphic Design --------------------
attached mail follows:
Or if you use GET in your forms, instead of POST, you won't have this problem.
---John Holmes...
----- Original Message -----
From: "Justin French" <justin
indent.com.au>
To: "Craig" <craig
phirus.com>; <php-general
lists.php.net>
Sent: Monday, November 25, 2002 8:15 AM
Subject: Re: [PHP] Sessions/Browser back button
> on 26/11/02 12:03 AM, Craig (craig
phirus.com) wrote:
>
> > I remember seeing threads debating this before, but is there anyway to
> > disable/prevent a user from heading back in the browser and getting the
> > "WARNING: Page has Expired" notice?
>
> This is more like a diversion around the problem... It will either be
> relevant to your problem, or not :)
>
> In particular, I use this to prevent people from refreshing their page
(and
> hence adding something to the DB twice for example).
>
> Lets say you have form.php, which submits to process.php... the aim is to
> have process.php as a server-only script (ie, nothing is sent to the
> browser), with a header() redirect to a thankyou.php page once I've added
> stuff to the DB, or whatever....
>
> The point is, they'll never see a page expired message in this case,
because
> the script receiving the POST information never gets to the browser.
>
>
> This may or may not help, depending on your problem :)
>
>
> Justin French
> --------------------
> http://Indent.com.au
> Web Development &
> Graphic Design
> --------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I would notice the difference, but computers don't understand text, it is just data for them, and they represent it the same way (there is no special file type for text and binary in filesystem either). The only difference is in case sensitivity - taken from mysql manual. You can also store binary objects in text.
Chris Shiflett wrote:
>--- Marek Kilimajer <kilimajer
webglobe.sk> wrote:
>
>
>
>>BLOB is like TEXT
>>
>>
>
>In what way? BLOB is binary large object. Text is ... text. One is
>binary, and the other is ASCII. The only similarity I can think of is
>that they both represent data. However, the format is completely
>different.
>
>Open up a binary file in a text editor, and then do the same with a
>regular text file. I think you will notice a significant difference.
>Or, consider the representation of 16 in binary versus ASCII:
>
>binary - 10000
>ascii - 0011000100110110
>
>As Sterling mentioned, using addslashes() on binary data is a bad
>idea. The same can be said for any string operations intended for
>ASCII data.
>
>Chris
>
>
>
attached mail follows:
Lo all,
I upgraded from PHP 4.2.1 to 4.2.2, and now all of a sudden the following code is generating a WARNING???
if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) { $modpath = "themes/$ThemeSel/"; }
I don't get it?
Warning: Unable to access themes/DeepBlue/modules/News/index.php in /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46
Line 46 is the if statement
:/
attached mail follows:
Hello,
"Chris Knipe" <savage
savage.za.org> wrote:
> Lo all, > > I upgraded from PHP 4.2.1 to 4.2.2, and now all of a sudden the following > code is generating a WARNING??? > > > if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) { > $modpath = "themes/$ThemeSel/"; > } > > I don't get it? > > Warning: Unable to access themes/DeepBlue/modules/News/index.php in > /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46 > > Line 46 is the if statement
If you have using a new php.ini file, perhaps you can compare it with an old one and see if there's anything different--might give you a hint.
Or, you might want to check the manual about error reporting and see what you can do about it:
http://www.php.net/manual/en/function.error-reporting.php
But then again, perhaps the problem is somewhere else... (i.e. file is not there, permissions, etc.)
HTH,
- E
attached mail follows:
> > if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) { > > $modpath = "themes/$ThemeSel/"; > > } > > > > I don't get it? > > > > Warning: Unable to access themes/DeepBlue/modules/News/index.php in > > /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46 > > > > Line 46 is the if statement > > If you have using a new php.ini file, perhaps you can compare it with an old > one and see if there's anything different--might give you a hint.
Yeah, and no. It's FreeBSD-Ports, my php.ini is unchanged. FreeBSD installs the new / updated ini files as ini-dist, so hence, nothing on my settings has changed. I did also check to verify this, and it is indeed the correct ini file, with the correct settings...
> But then again, perhaps the problem is somewhere else... (i.e. file is not > there, permissions, etc.)
Yes the file does not exist. But isn't that why file_exists() is there?
-- me
attached mail follows:
"Chris Knipe" <savage
savage.za.org> wrote:
> > > if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) { > > > $modpath = "themes/$ThemeSel/"; > > > } > > > > > > I don't get it? > > > > > > Warning: Unable to access themes/DeepBlue/modules/News/index.php in > > > /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46 > > > > > > Line 46 is the if statement > > > > If you have using a new php.ini file, perhaps you can compare it with an > old > > one and see if there's anything different--might give you a hint. > > Yeah, and no. It's FreeBSD-Ports, my php.ini is unchanged. FreeBSD > installs the new / updated ini files as ini-dist, so hence, nothing on my > settings has changed. I did also check to verify this, and it is indeed the > correct ini file, with the correct settings... > > > But then again, perhaps the problem is somewhere else... (i.e. file is not > > there, permissions, etc.) > > Yes the file does not exist. But isn't that why file_exists() is there?
Right, I might be typing faster than I am thinking... :)
Still, just make sure that PHP is using the php.ini file that you think it's using. The file that _you_ check didn't change but _php_ might be looking somewhere else... Of course, I could be wrong--haven't used FreeBSD/Ports--only linux.
Perhaps, somebody else knows the answer...
- E
attached mail follows:
> > > > if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) { > > > > $modpath = "themes/$ThemeSel/"; > > > > } > > > > > > > > I don't get it? > > > > > > > > Warning: Unable to access themes/DeepBlue/modules/News/index.php in > > > > /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46 > > > > > > > > Line 46 is the if statement > > > > > > If you have using a new php.ini file, perhaps you can compare it with an > > old > > > one and see if there's anything different--might give you a hint. > > > > Yeah, and no. It's FreeBSD-Ports, my php.ini is unchanged. FreeBSD > > installs the new / updated ini files as ini-dist, so hence, nothing on my > > settings has changed. I did also check to verify this, and it is indeed > the > > correct ini file, with the correct settings... > > > > > But then again, perhaps the problem is somewhere else... (i.e. file is > not > > > there, permissions, etc.) > > > > Yes the file does not exist. But isn't that why file_exists() is there? > > Right, I might be typing faster than I am thinking... :) > > Still, just make sure that PHP is using the php.ini file that you think it's > using. The file that _you_ check didn't change but _php_ might be looking > somewhere else... Of course, I could be wrong--haven't used > FreeBSD/Ports--only linux.
As ridiculous as this sounds...
Turning of safe mode made the warning go away. Now, I guess the question is, 1) is this a bug in the file_exists() function, or 2) does the default warning levels increase when operating under safe mode?
Either way, this never happened to me before, and is only now happening since upgrading from 4.2.1 to 4.2.2...
Rather peculiar I think...
-- me
attached mail follows:
Check the owners of directories and files, they must be the same as for /usr/local/www/v-webs/games.savage.za.org/html/index.php, then it should work under safe mode too.
Chris Knipe wrote:
>>>>> if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) >>>>> >>>>> >{ > > >>>>> $modpath = "themes/$ThemeSel/"; >>>>> } >>>>> >>>>>I don't get it? >>>>> >>>>>Warning: Unable to access themes/DeepBlue/modules/News/index.php in >>>>>/usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46 >>>>> >>>>>Line 46 is the if statement >>>>> >>>>> >>>>If you have using a new php.ini file, perhaps you can compare it with >>>> >>>> >an > > >>>old >>> >>> >>>>one and see if there's anything different--might give you a hint. >>>> >>>> >>>Yeah, and no. It's FreeBSD-Ports, my php.ini is unchanged. FreeBSD >>>installs the new / updated ini files as ini-dist, so hence, nothing on >>> >>> >my > > >>>settings has changed. I did also check to verify this, and it is indeed >>> >>> >>the >> >> >>>correct ini file, with the correct settings... >>> >>> >>> >>>>But then again, perhaps the problem is somewhere else... (i.e. file is >>>> >>>> >>not >> >> >>>>there, permissions, etc.) >>>> >>>> >>>Yes the file does not exist. But isn't that why file_exists() is there? >>> >>> >>Right, I might be typing faster than I am thinking... :) >> >>Still, just make sure that PHP is using the php.ini file that you think >> >> >it's > > >>using. The file that _you_ check didn't change but _php_ might be looking >>somewhere else... Of course, I could be wrong--haven't used >>FreeBSD/Ports--only linux. >> >> > >As ridiculous as this sounds... > >Turning of safe mode made the warning go away. Now, I guess the question >is, 1) is this a bug in the file_exists() function, or 2) does the default >warning levels increase when operating under safe mode? > >Either way, this never happened to me before, and is only now happening >since upgrading from 4.2.1 to 4.2.2... > >Rather peculiar I think... > >-- >me > > > >
attached mail follows:
All files are owened by my Apache user + Group, set to rw access on files and rwx on directories...
I do a chown + chmod on my web server's tree every few minutes via cron for my development system.
Just to proove my point...
root
netsonic:~# ls -l
/usr/local/www/v-webs/games.savage.za.org/html/index.php
-rw-r----- 1 www www 2512 Nov 24 22:16
/usr/local/www/v-webs/games.savage.za.org/html/index.php
root
netsonic:~# cat /usr/local/etc/apache/httpd.conf|grep User
User www
----- Original Message -----
From: "Marek Kilimajer" <kilimajer
webglobe.sk>
To: "PHP" <php-general
lists.php.net>
Sent: Monday, November 25, 2002 8:19 PM
Subject: Re: [PHP] Upgrade issues
> Check the owners of directories and files, they must be the same as for > /usr/local/www/v-webs/games.savage.za.org/html/index.php, then it should > work under > safe mode too. > > > Chris Knipe wrote: > > >>>>> if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) > >>>>> > >>>>> > >{ > > > > > >>>>> $modpath = "themes/$ThemeSel/"; > >>>>> } > >>>>> > >>>>>I don't get it? > >>>>> > >>>>>Warning: Unable to access themes/DeepBlue/modules/News/index.php in > >>>>>/usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46 > >>>>> > >>>>>Line 46 is the if statement > >>>>> > >>>>> > >>>>If you have using a new php.ini file, perhaps you can compare it with > >>>> > >>>> > >an > > > > > >>>old > >>> > >>> > >>>>one and see if there's anything different--might give you a hint. > >>>> > >>>> > >>>Yeah, and no. It's FreeBSD-Ports, my php.ini is unchanged. FreeBSD > >>>installs the new / updated ini files as ini-dist, so hence, nothing on > >>> > >>> > >my > > > > > >>>settings has changed. I did also check to verify this, and it is indeed > >>> > >>> > >>the > >> > >> > >>>correct ini file, with the correct settings... > >>> > >>> > >>> > >>>>But then again, perhaps the problem is somewhere else... (i.e. file is > >>>> > >>>> > >>not > >> > >> > >>>>there, permissions, etc.) > >>>> > >>>> > >>>Yes the file does not exist. But isn't that why file_exists() is there? > >>> > >>> > >>Right, I might be typing faster than I am thinking... :) > >> > >>Still, just make sure that PHP is using the php.ini file that you think > >> > >> > >it's > > > > > >>using. The file that _you_ check didn't change but _php_ might be looking > >>somewhere else... Of course, I could be wrong--haven't used > >>FreeBSD/Ports--only linux. > >> > >> > > > >As ridiculous as this sounds... > > > >Turning of safe mode made the warning go away. Now, I guess the question > >is, 1) is this a bug in the file_exists() function, or 2) does the default > >warning levels increase when operating under safe mode? > > > >Either way, this never happened to me before, and is only now happening > >since upgrading from 4.2.1 to 4.2.2... > > > >Rather peculiar I think... > > > >-- > >me > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello,
Myrage wrote: > No luck > I have installed GD lib and zlib and all into c:\php\extensions bur i > still > get an error > > *Fatal error*: Call to undefined function: imagecreate() in > *c:\inetpub\wwwroot\image.php* on line *24*
Run phpinfo() and check again (under GD). See if you can find some hints...
- E
attached mail follows:
Hello,
"Monty" <monty3
hotmail.com> wrote:
> I'm writing a poll app. I want it to work this way: > > 1. On web page, user selects choice, clicks VOTE. > > 2. Clicking VOTE triggers a pop-up window. > > 3. PHP script running in pop-up records vote, displays results. > > Problem is, POSTed vars that come from forms aren't available in the popup > window if I make the FORM action = javascript:popWin('/poll.php'). > > Is setting the vote choice in a session var the only way to make this work, > or is there a way to pass vars via a form POST to the popup window?
I think one way you can try is to use JavaScript's onClick() with submit.form. There was a discussion on a similar subject ("passing js values to php") not long time ago. Maybe you can check the archives...
But, what if JavaScript is turned off?
- E
attached mail follows:
Hello,
There could be a lot of problems here but what *exactly* is the problem? No more coffee, perhaps? :)
Post the error, if there's any. Or, take away the "
" sign and see what
happens...
- E
"Paul Dionne" <PDionne
Speakeasy.net> wrote:
> Ug, I hate Mondays. <stretches> must drink more coffee.</stretches>
>
> Anyway, got a problem I hope someone can help with or at least jumpstart
my
> brain.
>
> I wrote a few web pages, work fine on my machine. Uploaded them on Friday
> and they don't seem to work. Looks like I am not connecting to the
> database because every page I look at seems to end when it is suppose to
> connect.
>
> //******************************************************************
> function ConnOpen($CheckForError)
> {
>
>
>
>
$db = mysql_pconnect("webserver", "username", "password");
> if (!$db)
> {
> $CheckForError= "Error: Could not connect to database.
Ple
> ase try again later.";
> return $CheckForError;
> exit;
> }
> mysql_select_db("database");
>
>
>
> }
> //******************************************************************
>
attached mail follows:
Just to add...
Here's something that might interest you:
http://www.alistapart.com/stories/alternate/
... and here's another one: (Should be better than the one discussed above :) )
http://www.alistapart.com/stories/phpswitch/
- E
"Marek Kilimajer" <kilimajer
webglobe.sk> wrote:
> You might solve this by providing different style sheet to on linux
> running browsers:
> if(ereg('Linux',$_SERVER['HTTP_USER_AGENT'])) {
> echo '<link REL="StyleSheet" HREF="linux.css" TYPE="text/css">';
> } else {
> echo '<link REL="StyleSheet" HREF="win.css" TYPE="text/css">';
> }
>
>
> conbud wrote:
>
> >Hey. This really isnt a PHP question. but what fonts do you reccomend
using
> >so they look decent on linux. Mainly looking for a good font that will
look
> >nice in MoZilla and Galeon. Almost all the fonts Ive used so far appear
> >really tiny or really bold and not very good to read.
attached mail follows:
On Mon, 2002-11-25 at 10:35, > > conbud wrote: > > > > >Hey. This really isnt a PHP question. but what fonts do you reccomend > using > > >so they look decent on linux. Mainly looking for a good font that will > look > > >nice in MoZilla and Galeon. Almost all the fonts Ive used so far appear > > >really tiny or really bold and not very good to read.
If you use a range of fonts with a generic family you should be ok, for example:
verdana, helvetica, arial, sans-serif
Also, try to use relative sizes, if you use fixed sized like 10pt. you will have size discrepancies on different platforms. If you use a relative scheme like 12px it will render more consistently....
BTW: I bet you'd find the same issues if you looked at your pages on a MAC as well...
-Brian
attached mail follows:
I am in need of a search engine. I'd rather do one in PhP. Is there one available that I can see or at least get the code for?
I'm a newbie to php. :)
Krystal
attached mail follows:
Can you be a bit more specific as to what you need to search on? Is it a database, a set of web documents or do you want to create a search engine like Google, which crawls websites as needed?
Let us know!
Marco
-- ------------ php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmersCome visit us at http://www.phparch.com!
attached mail follows:
I am in need of a search engine. I'd rather do one in PhP. Is there one available that I can see or at least get the code for?
I'm a newbie to php. :)
Krystal
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
hotscripts.com
<msmecca
mindspring.com> wrote in message
news:Springmail.0994.1038238261.0.84389600
webmail.atl.earthlink.net...
> I am in need of a search engine. I'd rather do one in PhP. Is there one
> available that I can see or at least get the code for?
>
> I'm a newbie to php. :)
>
>
> Krystal
attached mail follows:
On Mon, 2002-11-25 at 08:31, msmecca
mindspring.com wrote:
> I am in need of a search engine. I'd rather do one in PhP. Is there one
> available that I can see or at least get the code for?
This article might help.
http://www.onlamp.com/pub/a/php/2002/10/24/simplesearchengine.html
Brad
attached mail follows:
Hi The problem I am having is as follows: I setup PHP with IIS and it seems to work fine. I am creating a Intranet site and would like to obtain the user logged on to the networks username. I have setup basic auth but when I visit the site it asks me for my username and password before I can get in. Integrated Windows Auth is turned off. When I turn it on and try to login it says login failed. I know that ASP can have a script added to the page to turn pass through auth but I need one for PHP. I am using $HTTP_SERVER_VARS["LOGON_USER"] to get the username and it works when I login. I just need to get rid of the login box.
Thanks for your help in advance.
Shaun Garriock
*** The contents of this message are confidential and are intended for the addressee only. The views expressed in this message do not necessarily represent those of Robert Gordon's College. Electronic mail transmission is not guaranteed to be secure, therefore, Robert Gordon's College does not accept liability for the contents of this transmission. This message does not form a legal binding contract. ***
attached mail follows:
Hello,
"Leif K-Brooks" <eurleif
buyer-brokerage.com> wrote:
> I'm having a weird problem.
I guess so. I don't understand what it is :)
> When I submit a form on my site, it often > sends twice.
Sends what twice?
> I'm not sure if this is a client-side or server-side > problem, but it doesn't happen on other sites.
Which sites?
> Is this a common > problem, or am I making some dumb mistake?
I'm not sure :) But perhaps you can post some code or something...
- E
attached mail follows:
Is it still possible to use enable-inline-optimization? Is it adviceable?
I am using RedHat Linux 7.3 with all RPM's updated (i.e. GCC and so on), Php 4.2.3 and Apache 1.3.27
Regards Jacob http://www.sharksforum.com
attached mail follows:
Hello,
"Chris" <cgoodno
comcast.net> wrote:
> I'm trying to write PHP code that will not only parse the XML but also > allow me to sort the parsed information by the values parsed.
I'm not sure if I really understand but let me try...
...[snip code]...
Adding echo '<table border="1">'; before this and
> $xml_parser = xml_parser_create();
...[snip code]...
after this
> xml_parser_free($xml_parser);
echo '</table>';
shows a good view that you have a table with two columns.
If you'd like to sort these, then I think you might be able to do something like this: 1. Instead of printf()'ing your <td>'s or <tr>'s inside the class/function, why don't you try "putting" it inside an array? (Maybe with array_push() or something.) Then, 2. If you already have an array, perhaps you can use one of the functions here for sorting:
http://www.php.net/manual/en/ref.array.php
HTH,
- E
...[snip]...
attached mail follows:
Sorry, use to using to a listserv that auto-plants the listserv address, not the responder's address on replies :P
> From:
Edwin [mailto:copperwalls
hotmail.com]
> If you'd like to sort these, then I think you might be able
> to do something like this: 1. Instead of printf()'ing your
> <td>'s or <tr>'s inside the class/function, why don't you try
> "putting" it inside an array? (Maybe with array_push() or
> something.) Then,
> 2. If you already have an array, perhaps you can use one of
> the functions here for sorting:
Aye, this is essentially what I need help with, is making the array.
What I'm looking for is a way to put the data into an array and then sort it based on the user's want and then print it out in a table format.
I've already got the xml info working as intended:
But what I've tried with getting the data placed into an array so far hasn't worked. Not many parsed XML examples out there or anything the 10 odd books I have help me with this. Books, I've found, in general, can't help me with most of my array needs due to their very basic examples and descriptions.
I am about to try doing an array as such:
Instead of:
function serverData($parser, $data) { if ($this->insideitem) { switch ($this->tag) { case "POPULATION": $this->ServerPopulation .= $data; break; case "STATUS": $this->ServerStatus .= $data; break; } } }
Something to this affect:
function serverData($parser, $data) { if ($this->insideitem) { switch ($this->tag) { case "POPULATION": $ServerArray[$this->ServerName][$this->ServerPopulation] = $data; break; case "STATUS": $ServerArray[$this->ServerName][$this->ServerStatus]= $data; break; } } }
Course, I'm unsure how this will work (but I'll try it out) since $this->ServerName may not carry to the $this->insideitem check. I would then plan to use function endElement to determine the user's want and then print the HTML out based on that, such as wanting the current data sorted by population (default) or by server name, type, or status.
Sorry, I'm new to dynamic web page creation and especially to XML, but I've got a love for programming and a head that just wants to learn more of it, so I create tons of web sites based around my hobbies so that I can practice and learn more. I'm glad I found this listserv and hope you guys don't mind my questions.
Thanks for any help you can provide.
attached mail follows:
This seems to me to be more easily handled by XSLT. (Not the only option but a good one). XSLT lets you select only the nodes you want and also sort them as well.
Edwin wrote:
>Hello,
>
>"Chris" <cgoodno
comcast.net> wrote:
>
>
>
>>I'm trying to write PHP code that will not only parse the XML but also
>>allow me to sort the parsed information by the values parsed.
>>
>>
>
>I'm not sure if I really understand but let me try...
>
>...[snip code]...
>
>Adding echo '<table border="1">'; before this and
>
>
>
>>$xml_parser = xml_parser_create();
>>
>>
>
>...[snip code]...
>
>after this
>
>
>
>>xml_parser_free($xml_parser);
>>
>>
>
> echo '</table>';
>
>shows a good view that you have a table with two columns.
>
>If you'd like to sort these, then I think you might be able to do something
>like this:
>1. Instead of printf()'ing your <td>'s or <tr>'s inside the class/function,
>why don't you try "putting" it inside an array? (Maybe with array_push() or
>something.) Then,
>2. If you already have an array, perhaps you can use one of the functions
>here for sorting:
>
> http://www.php.net/manual/en/ref.array.php
>
>HTH,
>
>- E
>
>...[snip]...
>
>
>
attached mail follows:
Unavailable as I am reading an XML file produced by another web site and it dynamically updates the information on the sheet every 5 minutes or so. At least to my knowledge of what XSLT can do.
> From: Geoff Hankerson [mailto:ghank
millerdavis.com]
>
> This seems to me to be more easily handled by XSLT. (Not the
> only option
> but a good one).
> XSLT lets you select only the nodes you want and also sort
> them as well.
attached mail follows:
I still havent found a site that shows what I need. I dont think php.net explain how ereg works.
I only want to publish stuff from the stringvariable $text thats inside tags looking like this
<FONT COLOR="#8f8f15">This shall be visible</FONT> or <FONT COLOR="#007f7f">This shall be visible too</FONT>
thanks Martin
attached mail follows:
> I still havent found a site that shows what I need. > I dont think php.net explain how ereg works. > > I only want to publish stuff from the stringvariable $text thats inside tags > looking like this > > <FONT COLOR="#8f8f15">This shall be visible</FONT> > or > <FONT COLOR="#007f7f">This shall be visible too</FONT> > > thanks > Martin
Try the following:
<?php function format_text($text){ $text = ereg_replace("(<[^>]+>)([^<]+)(</[^>]+>)",'\\2',$text); return $text; }
print format_text('<FONT COLOR="#8f8f15">This shall be visible</FONT>.');
?>
-- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/
attached mail follows:
I don't know if I got it right bu try
echo htmlentities('<FONT COLOR="#8f8f15">This shall be visible</FONT>'); htmlentities() will translate your string in '<FONT COLOR="#8f8f15">This shall be visible<FONT>'
> <FONT COLOR="#8f8f15">This shall be visible</FONT> > or > <FONT COLOR="#007f7f">This shall be visible too</FONT>
attached mail follows:
Hello all,
I have searched the archives and cannot find an answer to this question.
I would like to implement the same type of white list spam protection
(where you must send a confirmation to be accepted) that php.net is
using at my company. Does anyone know what type of software packages are
used to protect the
php.net addresses?
Thanks in advance,
Gene
attached mail follows:
On Tuesday 26 November 2002 00:02, Gene Bandy wrote: > Hello all, > > > > I have searched the archives and cannot find an answer to this question. Which archives did you search? Not the PHP ones I hope?
> I would like to implement the same type of white list spam protection
> (where you must send a confirmation to be accepted) that php.net is
> using at my company. Does anyone know what type of software packages are
> used to protect the
php.net addresses?
Look at the headers of any of the posts to this mailing list, you'll see that this list is managed by something called ezmlm. It is something that runs in conjunction with qmail. Google for more details.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* I have never been one to sacrifice my appetite on the altar of appearance. -- A.M. Readyhough */
attached mail follows:
Heyas,
Once upon a time I used to be able to POST form data to external sites with ASP and an MSXML (or something) server object on IIS and I'm wondering if there's a similar sort of technique using PHP. Would prefer it if I didn't have to use anything that isn't part of your typical PHP/Apache install (if there is such a thing) but will take what I can get.
The easiest description of what I'm attempting is: user hits PHP page, page submits predefined search terms to Google and the results are displayed. The user wouldn't have interacted with the search at all (ie: no button clicks) as it's all performed by the PHP script.
Thoughts? Kris
attached mail follows:
> Once upon a time I used to be able to POST form data to external sites > with > ASP and an MSXML (or something) server object on IIS and I'm wondering if > there's a similar sort of technique using PHP. Would prefer it if I > didn't > have to use anything that isn't part of your typical PHP/Apache install > (if > there is such a thing) but will take what I can get. > > The easiest description of what I'm attempting is: user hits PHP page, > page submits predefined search terms to Google and the results are > displayed. The user wouldn't have interacted with the search at all (ie: > no button clicks) as it's all performed by the PHP script.
Yeah, I'm pretty sure that's against Google's policy. No help here...
---John Holmes...
attached mail follows:
--- Kris Williams <ahrt
enternet.com.au> wrote:
> Once upon a time I used to be able to POST form data to external > sites with ASP and an MSXML (or something) server object on IIS > and I'm wondering if there's a similar sort of technique using > PHP.
You can post with PHP using cURL or doing it yourself manually. Search the archives for this, as the previous answers to this are more complete than what I have time to explain now. Here is a quick example of the manual approach:
http://shiflett.org/tutorials/php_post.txt
> The easiest description of what I'm attempting is: user hits PHP > page, page submits predefined search terms to Google and the > results are displayed.
Since Google's search uses GET, your question about POST doesn't matter anyway. The following URL will display the search results of a Google search on PHP:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=PHP&btnG=Google+Search
If you are wanting to display the search results on your own page, you should use Google's API. I believe parsing their HTML results violates the terms of use, so you might want to read that if you do not want to use the API.
The API can be found here:
A low-level demonstration of how the API works is given here (I plan to improve this when I have time):
http://shiflett.org/tutorials/google.php
Hope that helps.
Chris
attached mail follows:
Hello,
"David Pratt" <fairwinds
shaw.ca> wrote:
> Anyone have a simple technique for obtaining a unique list of elements from > an XML file? > > Am looking for something that will identify the first opening tag ie > <thistag> and the single tag <anothertag/> so that I get an array of tags > that I can print out. Having a bit of trouble with regex to get something > to work. > > Basic idea I had is to open file, read through each line with regex, add > matches to array, and then do unique elements of array and write to another > file. > > Is there a better way?
Yes. Have you checked the manual? :)
http://www.php.net/manual/en/ref.xml.php
- E
attached mail follows:
> Thanks a lot, but do you know how to do the same with ereg_replace? I'm > trying to learn PCRE, but until I do, I won't be able to add anything to > this...
<?php function bbcode($text){ $text = ereg_replace("(\\[i\\])([^\\[]+)(\\[/i\\])",'<i>\\2</i>',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ?>
Works...
-- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/
attached mail follows:
Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] tag, for example).
Kyle Gibson wrote:
>> Thanks a lot, but do you know how to do the same with ereg_replace? >> I'm trying to learn PCRE, but until I do, I won't be able to add >> anything to this... > > > > <?php > function bbcode($text){ > $text = ereg_replace("(\\[i\\])([^\\[]+)(\\[/i\\])",'<i>\\2</i>',$text); > return $text; > } > print bbcode('[i]This[/i] is a [i]test[/i].'); > ?> > > > Works... > > >
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
On Tuesday 26 November 2002 01:42, Leif K-Brooks wrote: > Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] > tag, for example).
If you want to deal with nested tags then it's probably best to replace each opening and closing tag individually. Otherwise you might end up with some fiendishly complicated regex.
Did I say I preferred the PCRE functions to the EREG ones?
Well using preg_replace() you can put all your search strings in one array and all the corresponding replacement strings in another and it'll replace all those tags for you in a single operation:
$text = '[i]This[/i] is a [i]test[/i].'; $search_for_tags = array("/\[i\]/", "/\[\/i\]/"); $replace_with_tags = array("<i>", "</i>"); $text = preg_replace($search_for_tags, $replace_with_tags, $text); print $text;
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Ignorance must certainly be bliss or there wouldn't be so many people so resolutely pursuing it. */
attached mail follows:
This will replace all versions (open and close) of bold, italicize and underline tags with brackets using preg_replace.
$text = preg_replace("/\[(\/)?([biu])\]/","<\\1\\2>",$text) ; <definition> - find [ = "\[" - match IF slash exists = "(\/)?" - match one of the following = "([biu])" - find ] = "\]"
- matches get put into 'memory' (\\1 \\2) even if not found (ie. slash didn't exist). - replace with "< 'first match' 'second match' >"
- NOTE : in PCRE regexs, brackets and forward-slashes are special characters and must be escaped (preceded with a back-slash) when looking for them as regular characters. </definition>
Even if you do not know PCRE yet, don't hamstring yourself looking for a solution that is too complicated and time-consuming. EREG does not work very well on this type of problem.
Buck up, learn PCRE and use this type of solution (if you find something that works for you, use it...by no means does the code above cover every tag you 'may' want to use).
Builder.com has a pretty good regular expression checker for PERL-style regexs that make PCRE pretty easy. http://builder.com -> Go To: Web Scripting (left menu) -> Cool Tools (right menu) -> Regular Expression Inspector (2/3 way down page)
.mike
=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
email: operations
cdmsports.com
phone: 314.991.1511 x 6505
----------------------------------------------- This email sent using CDM Sports Webmail v3.1 [ http://webmail.cdmsports.com ]
attached mail follows:
> Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] > tag, for example).
Nested tags? Do you mean [ib] ? Or [i[b]]?
If you mean [ib], then I'm afraid what you want cannot be done in ereg_replace.
As far as I am aware, that is.
-- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/
attached mail follows:
On Tuesday 26 November 2002 04:42, Kyle Gibson wrote: > > Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] > > tag, for example). > > Nested tags? Do you mean [ib] ? Or [i[b]]?
I think he means:
"[i]A sentence in italics, with a word in [b]bold[/b][/i]"
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* The more I know men the more I like my horse. */
attached mail follows:
> I think he means: > > "[i]A sentence in italics, with a word in [b]bold[/b][/i]"
Yeah he told me.
-- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/
attached mail follows:
> Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] > tag, for example).
Try this:
<?
function format_text($text) { $open="\\["; $close="\\]";
$pattern=$open."(.)".$close."([^".$open."]+)".$open."/"."(.)".$close;
$temp = $text; $text = ereg_replace($pattern,'<\1>\2</\3>',$text);
while($temp != $text) { $temp = $text; $text = ereg_replace($pattern,'<\1>\2</\3>',$text); }
return $text; }
print format_text('[i] this is a [b]bold[/b] test [/i]');
?>
-- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/
attached mail follows:
hi i'm having problems resizing jpegs. here's an e.g. using manual example. code used : <? $new_w=395; $new_h=297; header("Content-type: image/jpeg"); $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromJpeg($name); ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); ImageJpeg($dst_img); ?>
and the result can be seen here. http://www.sitestogo.biz/temp/test.php
i'm wondering if it's to do with the gd library installed.
attached mail follows:
On Tuesday 26 November 2002 02:10, adrian.murphy
2020tourism.com wrote:
> hi
> i'm having problems resizing jpegs.
> here's an e.g. using manual example.
> code used :
> <?
> $new_w=395;
> $new_h=297;
> header("Content-type: image/jpeg");
> $dst_img=ImageCreate($new_w,$new_h);
> $src_img=ImageCreateFromJpeg($name);
> ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),
>ImageSY($src_img)); ImageJpeg($dst_img);
> ?>
>
> and the result can be seen here.
> http://www.sitestogo.biz/temp/test.php
You may get a better response if you actually copy and paste the error message or whatever. If that's not possible at least give a brief description as to what the problem is. Having to make people go through extra steps to help you is not a very good idea.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Too much is just enough. -- Mark Twain, on whiskey */
attached mail follows:
On Mon, 25 Nov 2002, adrian murphy
2020tourism.com wrote:
> hi > i'm having problems resizing jpegs. > here's an e.g. using manual example. > code used : > <? > $new_w=395; > $new_h=297; > header("Content-type: image/jpeg"); > $dst_img=ImageCreate($new_w,$new_h); > $src_img=ImageCreateFromJpeg($name); > ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); > ImageJpeg($dst_img); > ?> > > and the result can be seen here. > http://www.sitestogo.biz/temp/test.php > i'm wondering if it's to do with the gd library installed.
Try it with ImageCreateTruecolor(), since ImageCreate() produces 8-bit indexed-color images... If that function doesn't exist, you're using a pre-2.x GD, and those can't do 24-bit images at all...
Good luck!
-- Morgan Hughes C programmer and highly caffeinated mammal. kyhmkyhm.com ICQ: 79293356
attached mail follows:
sorry.i included the link so you can see the result
it's difficult to explain what it looks like without including
attachments - which is a worse idea i think!
there are no errors it just looks bad.
i didn't know that imagecreate() produces 8-bit images.
this implies that with older versions of gd (< 2.x) you can't
manipulate jpegs? gd is my only option.
adrian
----- Original Message -----
From: "Jason Wong" <php-general
gremlins.biz>
To: <php-general
lists.php.net>
Sent: Monday, November 25, 2002 6:26 PM
Subject: Re: [PHP] imagecopyresized
> On Tuesday 26 November 2002 02:10, adrian.murphy
2020tourism.com wrote:
> > hi
> > i'm having problems resizing jpegs.
> > here's an e.g. using manual example.
> > code used :
> > <?
> > $new_w=395;
> > $new_h=297;
> > header("Content-type: image/jpeg");
> > $dst_img=ImageCreate($new_w,$new_h);
> > $src_img=ImageCreateFromJpeg($name);
> >
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),
> >ImageSY($src_img)); ImageJpeg($dst_img);
> > ?>
> >
> > and the result can be seen here.
> > http://www.sitestogo.biz/temp/test.php
>
> You may get a better response if you actually copy and paste the error
message
> or whatever. If that's not possible at least give a brief description as
to
> what the problem is. Having to make people go through extra steps to help
you
> is not a very good idea.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Too much is just enough.
> -- Mark Twain, on whiskey
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Mon, 25 Nov 2002, adrian murphy
2020tourism.com wrote:
> sorry.i included the link so you can see the result > it's difficult to explain what it looks like without including > attachments - which is a worse idea i think! > there are no errors it just looks bad. > i didn't know that imagecreate() produces 8-bit images. > this implies that with older versions of gd (< 2.x) you can't > manipulate jpegs? gd is my only option. > adrian
You can read and produce JPEGs with GD < 2.x, but any JPEG you read is stripped to 8-bit, with as many colors as the reader can allocate. Any JPEG you produce will be 8-bit as well.
GD stayed at 2.0.1 for quite a while (a year or more), which was a beta and had some serious bugs, but now it's being maintained again, and is up to 2.0.8... Unfortunately the PHP extension is broken and requires specific patches, so GD 2 support probably won't be widespread with ISPs until it's sorted out and stable... So you'll have to wait, or look into something like ImageMagick.
-- Morgan Hughes C programmer and highly caffeinated mammal. kyhmkyhm.com ICQ: 79293356
attached mail follows:
Does anyone know of any significant changes to the fgets() function in php-4.3.0pre2 which might affect reading from a socket a single byte at a time in the way I describe below? I've had to change to using fread() instead, which is fine, but I'd like to know why I've had to do this, and whether this behaviour is a bug or intentional change in php-4.3.0pre2.
Thanks, Stephen
Stephen Grier wrote: > > An application I am developing contains something like the following: > > $this->socket = fsockopen($server, $port, $errnum, $errstr, "60"); > ... > while (!feof($this->socket)) { > > $char = fgets($this->socket,1); > > if (($char == "\n") || ($char == "\r")) > return $buffer; > } > $buffer .= $char; > } > return $buffer; > > This works fine upto php-4.2.x. However, I've recently built and > installed php-4.3.0pre2 and now the above code appears to hang. > > Substituting fread in place of fgets solves the problem. I know that > fgets is supposed to be 'binary safe' as of php-4.3 but I'm not sure if > this could be causing the above problem. > > Does anyone know of any changes to fgets in php-4.3.0 which might be > causing this? Are there any reasons why I should not use fread instead > of fgets here? > > Also, I am looking at using something like: > > $status = socket_get_status($this->socket); > if ($status["unread_bytes"] <= 0) > return false; > > However, $status["unread_bytes"] always returns 0 until the first call > to fgets($this->socket). Is this right? I'd like to check the status of > the socket before I try to read from it. > > Thanks, > > Stephen Grier
attached mail follows:
Dave, et al --
...and then Merritt, Dave said... % % I working with helping our local high school technical center set up a web % server/site. Went with the typical AMP solution (unfortunately on MSWin
Hey, three out of four ain't bad :-)
% though). The center is wanting to add an on-line calendar system. This
If you'll consider perl, Maorong Zou's webcalendar (see
http://www.ma.utexas.edu/~mzou/webCal/
and
http://www.math.utexas.edu/pipermail/webcalendar/
for info) is quite mature.
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://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD4DBQE94mpFGb7uCXufRwARAiLcAJ46pHqpmwwh6wWkbL/Y32x4V69JJACYkJoF BXrOkCKG4PK1tdtzxSPIPg== =TW9c -----END PGP SIGNATURE-----
attached mail follows:
Hi,
I really need some help here because I am going to lose my mind otherwise!! A script that was running fine Friday has decided not to work for no apparent reason today. The problem seems to be with a socket_create that just stops the script, so I created a simple test script as shown below to see what happens. When I run this is simply drops out at the socket_create, no error message, nothing. Again this worked fine Friday and nothing has changed on my machine. I am running 4.2.3 on Win2K... any ideas? Help!!
G.
$zone = "192.168.0.60"; $port = "10000"; $command = "play";
echo('here');
$slip_socket = socket_create (AF_INET, SOCK_STREAM, 0);
echo('here 2');
if ($slip_socket < 0) { echo "socket_create() failed: reason: " . socket_strerror ($slip_socket) . "\n"; } else { $result = socket_connect ($slip_socket, $zone, $port); if ($result < 0) { echo "socket_connect() failed.\nReason: ($result) " . socket_strerror($result) . "\n"; } }
$command=$command."\n"; echo('Sending command: '.$command.' for '.$zone.'\n'); socket_write ($slip_socket, $command, strlen ($command));
attached mail follows:
Hi,
You have to choose a protocol for AF_INET sockets. Try getprotobyname() with tcp and udp to get one.
bye
On Mon, 25 Nov 2002 10:24:46 -0800
gdthomas
mercurysoft.com (Gareth Thomas) wrote:
> Hi, > > I really need some help here because I am going to lose my mind otherwise!! > A script that was running fine Friday has decided not to work for no > apparent reason today. The problem seems to be with a socket_create that > just stops the script, so I created a simple test script as shown below to > see what happens. When I run this is simply drops out at the socket_create, > no error message, nothing. Again this worked fine Friday and nothing has > changed on my machine. I am running 4.2.3 on Win2K... any ideas? Help!! > > > G. > > $zone = "192.168.0.60"; > $port = "10000"; > $command = "play"; > > echo('here'); > > $slip_socket = socket_create (AF_INET, SOCK_STREAM, 0); > > echo('here 2'); > > if ($slip_socket < 0) { > echo "socket_create() failed: reason: " . socket_strerror ($slip_socket) > . "\n"; > } else { > $result = socket_connect ($slip_socket, $zone, $port); > if ($result < 0) { > echo "socket_connect() failed.\nReason: ($result) " . > socket_strerror($result) . "\n"; > } > } > > $command=$command."\n"; > echo('Sending command: '.$command.' for '.$zone.'\n'); > socket_write ($slip_socket, $command, strlen ($command)); > > >
attached mail follows:
Can I user php to create IMAP mailboxes? I'm using Cyrus and php and apache are running on the same computer as Cyrus. Thanks! -Greg
attached mail follows:
On Tuesday 26 November 2002 03:14, Greg wrote: > Can I user php to create IMAP mailboxes? I'm using Cyrus and php and > apache are running on the same computer as Cyrus. Thanks!
The short answer is, yes.
The long answer is, if you have to ask then no.
Try searching the archives for something along the lines of "create mail account using php".
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* I'm going to live forever, or die trying! -- Spider Robinson */
attached mail follows:
On Mon, 25 Nov 2002 14:14:54 -0500 gregchagnon
hotmail.com (Greg) wrote:
> Can I user php to create IMAP mailboxes? I'm using Cyrus and php and apache > are running on the same computer as Cyrus. Thanks! > -Greg > >
Maybe something like that would fit your needs: http://www.delouw.ch/linux/web-cyradm/
Thomas
attached mail follows:
When trying to imap_connect to my local imap server, I get this error:
Warning: Couldn't open stream {localhost:143} in /var/www/html/user/mail.php on line 2 can't connect:
Any ideas? Thanks
"Greg" <gregchagnon
hotmail.com> wrote in message
news:20021125191450.74238.qmail
pb1.pair.com...
> Can I user php to create IMAP mailboxes? I'm using Cyrus and php and
apache
> are running on the same computer as Cyrus. Thanks!
> -Greg
>
>
attached mail follows:
Hi.
I'm working on a project where I need to send a user an e-mail whose content is identical to an already existing PHP-generated web page. (This web page relies on session data to do its work.) The mail function in PHP requires that I save the HTML of this page into a variable and send it along as the third parameter. The simplest way to retrieve the HTML is through a socket connection, correct? The problem I'm suffering from, however, is that when I try to GET a page and send along with it ?session_name()=session_id(), the browser hangs for an indeterminate amount of time.
Here's the code I've been working with.
$fp = fsockopen ("www.example.com", 80, $errno, $errstr);
fputs ($fp, "GET /itemizeFoods.php?" . session_name() . "=" . session_id() . " HTTP/1.0\n\n");
while (! feof ($fp)) { $message .= fgets ($fp, 128); }
mail ($target_email, "Food Reports", $message, "From: " . $row["userFullName"] . " <" . $source_email . ">\n" . "Reply-To: " . $source_email . "\n" . "X-Mailer: PHP/" . phpversion() . "\n" . "Content-type: text/html; charset=iso-8859-1\n" );
I've also tried just passing the query string as ?id=session_id() and including at the top of the the PHP-generated page the following.
session_id($id); session_start();
That also causes the browser to hang.
If I open a new browser and manually type itemizeFoods.php?PHPSESSID=396 (or whatever the ID happens to be of my current session) or link to itemizeFoods.php?396 the session continues just fine. The page loads properly and session variable values are consistent. It's only when I try to retrieve a page through a socket that the problems arises.
Others have referred me to the curl library, but the installation of PHP I have to work with was not compiled with curl.
If you have any ideas as to how I might fix of circumvent my problem, please let me know.
attached mail follows:
Hi.
I'm working on a project where I need to send a user an e-mail whose content is identical to an already existing PHP-generated web page. (This web page relies on session data to do its work.) The mail function in PHP requires that I save the HTML of this page into a variable and send it along as the third parameter. The simplest way to retrieve the HTML is through a socket connection, correct? The problem I'm suffering from, however, is that when I try to GET a page and send along with it ?session_name()=session_id(), the browser hangs for an indeterminate amount of time.
Here's the code I've been working with.
$fp = fsockopen ("www.example.com", 80, $errno, $errstr);
fputs ($fp, "GET /itemizeFoods.php?" . session_name() . "=" . session_id() . " HTTP/1.0\n\n");
while (! feof ($fp)) { $message .= fgets ($fp, 128); }
mail ($target_email, 'Food Reports', $message, "From: $source_email\n" . "Reply-To: $source_email\n" . 'X-Mailer: PHP/' . phpversion() . "\n" . "Content-type: text/html; charset=iso-8859-1\n" );
I've also tried just passing the query string as ?id=session_id() (not PHPSESSID=session_id() and including at the top of the the PHP-generated page the following.
session_id($id); session_start();
That also causes the browser to hang.
If I open a new browser and manually type itemizeFoods.php?PHPSESSID=396 (or whatever the ID happens to be of my current session) or link to itemizeFoods.php?396 the session continues just fine. The page loads properly and session variable values are consistent. It's only when I try to retrieve a page through a socket that the problems arises.
Others have referred me to the curl library, but the installation of PHP I have to work with was not compiled with curl.
If you have any ideas as to how I might fix of circumvent my problem, please let me know.
-- Chris Johnson Dyton Media, Inc.
attached mail follows:
Can anyone suggest an ELEGANT way to find out if an array is made of empty strings or not?
example
$a = Array( '' , '' , '' ); //ok $b = Array( '' , '' , 'error' ); // not ok $c = Array( 'error' , '' , 'error' ); // not ok
tia Mattia
attached mail follows:
Hi,
After I submited a query, if I use back then forward again the form will resubmit itself. Which I do not want. Does anyone have a solution for this problem?
Thanks, David
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus – Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
When the form is submitted check the database with the info that is being submitted. If a record matches the data being submitted then don't do the insert. If there is not a record there, then insert the record..
HTH Clint
-----Original Message-----
From: David H [mailto:godave621
yahoo.com]
Sent: Monday, November 25, 2002 2:21 PM
To: php-general
lists.php.net
Subject: [PHP] Form trouble
Hi,
After I submited a query, if I use back then forward again the form will resubmit itself. Which I do not want. Does anyone have a solution for this problem?
Thanks, David
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> When the form is submitted check the database with the info that is > being submitted. If a record matches the data being submitted then don't > do the insert. If there is not a record there, then insert the record..
Either that or, if you are using mySQL, instead of using "INSERT INTO..." use "REPLACE INTO...". Though, there are a few cases where this might not work. Read the docs on "REPLACE".
Chris
attached mail follows:
But what about updates to the database...? Is there away not to have the information send to the server at all?
Thanks,
David
--- Clint Tredway <ctredway
fishermenstudios.com>
wrote:
> When the form is submitted check the database with
> the info that is
> being submitted. If a record matches the data being
> submitted then don't
> do the insert. If there is not a record there, then
> insert the record..
>
> HTH
> Clint
>
> -----Original Message-----
> From: David H [mailto:godave621
yahoo.com]
> Sent: Monday, November 25, 2002 2:21 PM
> To: php-general
lists.php.net
> Subject: [PHP] Form trouble
>
>
> Hi,
>
> After I submited a query, if I use back then forward
> again the form will resubmit itself. Which I do not
> want. Does anyone have a solution for this problem?
>
> Thanks,
> David
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus – Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
Not really. The back button uses the browers history to go back.. And there is no way to disable the back button.
-----Original Message-----
From: David H [mailto:godave621
yahoo.com]
Sent: Monday, November 25, 2002 2:33 PM
To: Clint Tredway; php-general
lists.php.net
Subject: RE: [PHP] Form trouble
But what about updates to the database...? Is there away not to have the information send to the server at all?
Thanks,
David
--- Clint Tredway <ctredway
fishermenstudios.com>
wrote:
> When the form is submitted check the database with
> the info that is
> being submitted. If a record matches the data being
> submitted then don't
> do the insert. If there is not a record there, then
> insert the record..
>
> HTH
> Clint
>
> -----Original Message-----
> From: David H [mailto:godave621
yahoo.com]
> Sent: Monday, November 25, 2002 2:21 PM
> To: php-general
lists.php.net
> Subject: [PHP] Form trouble
>
>
> Hi,
>
> After I submited a query, if I use back then forward
> again the form will resubmit itself. Which I do not
> want. Does anyone have a solution for this problem?
>
> Thanks,
> David
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
There is one common method used to avoid this that is pretty reliable.
1. http://example.org/1.php submits to http://example.org/2.php 2. http://example.org/2.php processes the form, then uses a Location header to redirect to http://example.org/3.php. For example:
header("Location: http://example.org/3.php");
From the user's perspective, there are only two URLs involved, http://example.org/1.php and http://example.org/3.php. Clicking back from 3.php brings the user to 1.php and clicking forward simply brings the user to 3.php. It is impossible without clicking the submit button again to execute 2.php again.
Thus, 2.php does not display anything but just processes the form and redirects the user to the appropriate URL.
That's one technique, anyway.
Chris
--- David H <godave621
yahoo.com> wrote:
> But what about updates to the database...? Is there > away not to have the information send to the server at > all?
attached mail follows:
Hi,
I'm trying to use disable_functions inside an Apache's VirtualHost, like this:
php_value disable_functions basename,chgrp,chmod,phpinfo
I tried both with and without " but the functions are not disabled. I'm using php_flag safe_mode on in the same virtual host. Any help on what I'm doing wrongly is appreciated.
Thanks. Rodolfo.
attached mail follows:
You can't disable functions in your httpd.conf. That particular directive is probably the only one that is server-wide and can only be set in your php.ini file. The reason is that it is too expensive to disable and re-enabled functions on a per-request basis which is what we would need to do if we allowed you to set it per-dir or per-vhost.
-Rasmus
On Mon, 25 Nov 2002, Rodolfo Gonzalez wrote:
> Hi, > > I'm trying to use disable_functions inside an Apache's VirtualHost, like > this: > > php_value disable_functions basename,chgrp,chmod,phpinfo > > I tried both with and without " but the functions are not disabled. I'm > using php_flag safe_mode on in the same virtual host. Any help on what I'm > doing wrongly is appreciated. > > > Thanks. > Rodolfo. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
On Mon, 25 Nov 2002, Rasmus Lerdorf wrote:
> You can't disable functions in your httpd.conf. That particular directive > is probably the only one that is server-wide and can only be set in your > php.ini file. The reason is that it is too expensive to disable and > re-enabled functions on a per-request basis which is what we would need to > do if we allowed you to set it per-dir or per-vhost.
Hmm, that's a pitty, now I have two choices: disable user access and modification of files on the ser