[PHP] EOF: how to generate one in a string
I am trying to use a command line program in Linux using this form: $result = `/path/prog $arg`; But this doesn't work as the program is expecting and EOF that never comes. If I use the program on the command line when I am finished entering all the data I need to hit return and then CTRL-D to give an EOF. How can I simulate this using the backticks? Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
What about transactions ? In all the discussion noone points that PostgreSQL uses them. Maybe noone uses transactions so they have no matter. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] EOF: how to generate one in a string
- Original Message - From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 9:52 AM Subject: [PHP] EOF: how to generate one in a string > I am trying to use a command line program in Linux using this form: > > $result = `/path/prog $arg`; > > But this doesn't work as the program is expecting and EOF that never comes. > > If I use the program on the command line when I am finished entering all > the data I need to hit return and then CTRL-D to give an EOF. > > How can I simulate this using the backticks? If $arg is, what you would enter in the command line, you need to pass it to prog's stdin. You could use `echo "$arg" | /path/prog` for example. If $arg is more that just a single line w/o special characters, you should probably use popen for more control (is it popen in php?...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Directory Listing with php on unix boxes
> Here is where I'm running into some problems. I need the file listing to be > sorted as if I were performing an 'ls -lt' listing on the server itself. I do not think opendir() or readdir() quarantees any sort. You where lucky rather you got dirs in the time order. You should use filemtime() or something like this to sort dirs. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editors
> I'm running Apache 2.0 as a service and PHP (like a > module) onto a Windows Advanced Server. I´m looking > for a good and free Editor to use with PHP (With > debugging features). Can anyone with experience guide > me? Look up archives. You will get full list of PHP editors. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] EOF: how to generate one in a string
$result = `echo | /path/prog $arg`; should work Jean-Christian Imbeault wrote: I am trying to use a command line program in Linux using this form: $result = `/path/prog $arg`; But this doesn't work as the program is expecting and EOF that never comes. If I use the program on the command line when I am finished entering all the data I need to hit return and then CTRL-D to give an EOF. How can I simulate this using the backticks? Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Double entry into MySQL..
You should be able to get around it also by checking if $_SERVER[REQUEST_METHOD]=='HEAD' Timothy Hitchens (HiTCHO) wrote: When they first click on the file their browser will make a request for type, size etc then when it display's the dialog box on the screen of the client it will make another request to start the download. I get around this by putting the session id into the database and if it is double requested within 5 seconds to discard. So you will need to do a select, num_rows then if below 1 insert. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Altug Sahin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 8 January 2003 2:07 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Double entry into MySQL.. Another strange behaviour... When I send the name of the file to be downloaded to this script, it works (still makes a double entry into MySQL though) with GET method but it doesn't work if the file's name is sent with the POST method. Why? I am pulling my hair out here!!! Please help... Thanks again "Altug Sahin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi here, I am sending a file to user's browser and logging the downloaded file into MySQL but everytime this script works, I see double entry in the MySQL table... Why is this happening? Any ideas? Thanks $today = date("Y-m-d"); $conn = db_connect(); if(!$conn) echo "Can't connect to database..."; $query = "INSERT INTO track_dl (dldate, email, file) VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')"; $result = mysql_query($query); if(!$result) echo "Can't execute query: " . mysql_error(); header("Content-type: application/pdf"); readfile("file.pdf"); exit(); ?> -- 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
Re: [PHP] EOF: how to generate one in a string
Marek Kilimajer wrote: $result = `echo | /path/prog $arg`; should work That didn' work ... don't know why. Isn't there a way to say echo "EOF"? There must be a way to specify the ascii or hex value for EOF in an echo statement no? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Double entry into MySQL..
I wish it was as simple as that but in the past it just hasn't always worked!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 7:29 PM > To: Timothy Hitchens (HiTCHO) > Cc: 'Altug Sahin'; [EMAIL PROTECTED] > Subject: Re: [PHP] Re: Double entry into MySQL.. > > > You should be able to get around it also by checking > if $_SERVER[REQUEST_METHOD]=='HEAD' > > Timothy Hitchens (HiTCHO) wrote: > > >When they first click on the file their browser will make a > request for > >type, size etc then when it display's the dialog box on the > screen of > >the client it will make another > >request to start the download. > > > >I get around this by putting the session id into the > database and if it > >is double requested within 5 seconds to discard. So you will > need to do > >a select, num_rows then if below 1 insert. > > > > > >Timothy Hitchens (HiTCHO) > >Open Platform Consulting > >e-mail: [EMAIL PROTECTED] > > > > > > > >>-Original Message- > >>From: Altug Sahin [mailto:[EMAIL PROTECTED]] > >>Sent: Wednesday, 8 January 2003 2:07 PM > >>To: [EMAIL PROTECTED] > >>Subject: [PHP] Re: Double entry into MySQL.. > >> > >> > >>Another strange behaviour... When I send the name of the file > >>to be downloaded to this script, it works (still makes a > >>double entry into MySQL > >>though) with GET method but it doesn't work if the file's > >>name is sent with the POST method. > >> > >>Why? I am pulling my hair out here!!! > >> > >>Please help... > >> > >>Thanks again > >> > >>"Altug Sahin" <[EMAIL PROTECTED]> wrote in message > >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> > >> > >>>Hi here, > >>> > >>> > >>> > >>> > >>I am sending a file to user's browser and logging the > downloaded file > >> > >> > >>>into MySQL but everytime this script works, I see double > >>> > >>> > >>entry in the > >> > >> > >>>MySQL table... Why is this happening? > >>> > >>>Any ideas? > >>> > >>>Thanks > >>> > >>> >>> $today = date("Y-m-d"); > >>> > >>> $conn = db_connect(); > >>> > >>> if(!$conn) > >>> echo "Can't connect to database..."; > >>> > >>> $query = "INSERT INTO track_dl (dldate, email, file) > >>>VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')"; > >>> > >>> $result = mysql_query($query); > >>> > >>> if(!$result) > >>> echo "Can't execute query: " . mysql_error(); > >>> > >>>header("Content-type: application/pdf"); readfile("file.pdf"); > >>>exit(); ?> > >>> > >>> > >>> > >>> > >> > >>-- > >>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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uid checked by file_exists()
Hello, I've just installed PHP 4.3.0. The 4.0.6 was installed before. With the new version, in safe mode, the 'file_exists' function produce this warning: Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 302 is not allowed to access /full/path/to/file.gif owned by uid 301 in /full/path/to/script.php on line 12 I did not have this problem with version 4.0.6. Please help me! Thank you, Emmanuel. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Build errors: php 4.3.0 on FreeBSD 5.0 RC2
Hello I try to install php 4.3.0 on FreeBSD 5.0 RC2 Please help Alexander Rijnbeek -su-2.05b# make /bin/sh libtool --silent --mode=compile gcc -Iext/zlib/ -I/usr/local/src/php4/php-4.3.0/ext/zlib/ -DPHP_ATOM_INC -I /usr/local/src/php4/php-4.3.0/include -I/usr/local/src/php4/php-4.3.0/main - I/usr/local/src/php4/php-4.3.0 -I/usr/local/src/php4/php-4.3.0/Zend -I/usr/l ocal/include -I/usr/local/include/libxml2 -I/usr/local/include/mysql -I/usr/ local/include/pspell -DMOD_SSL=208112 -DMOD_PERL -DUSE_PERL_SSI -DAPPLLIB_E XP="/usr/local/lib/perl5/5.6.1/BSDPAN" -DEAPI -DAPPLLIB_EXP=/usr/local/lib/p erl5/5.6.1/BSDPAN -I/usr/local/src/php4/php-4.3.0/TSRM -g -O2 -prefer-pic -c /usr/local/src/php4/php-4.3.0/ext/zlib/zlib.c -o ext/zlib/zlib.lo In file included from /usr/local/src/php4/php-4.3.0/main/php.h:360, from /usr/local/src/php4/php-4.3.0/ext/zlib/zlib.c:28: /usr/local/src/php4/php-4.3.0/TSRM/tsrm_virtual_cwd.h:159: warning: `struct utimbuf' declared inside parameter list /usr/local/src/php4/php-4.3.0/TSRM/tsrm_virtual_cwd.h:159: warning: its scope is only this definition or declaration, which is probably not what you want In file included from /usr/local/src/php4/php-4.3.0/ext/standard/php_standard.h:23, from /usr/local/src/php4/php-4.3.0/ext/zlib/zlib.c:48: /usr/local/src/php4/php-4.3.0/ext/standard/php_string.h: In function `php_memnstr': /usr/local/src/php4/php-4.3.0/ext/standard/php_string.h:142: warning: assignment makes pointer from integer without a cast In file included from /usr/local/src/php4/php-4.3.0/ext/standard/fsock.h:38, from /usr/local/src/php4/php-4.3.0/ext/standard/php_standard.h:44, from /usr/local/src/php4/php-4.3.0/ext/zlib/zlib.c:48: /usr/local/src/php4/php-4.3.0/main/php_network.h: At top level: /usr/local/src/php4/php-4.3.0/main/php_network.h:113: syntax error before "socklen_t" /usr/local/src/php4/php-4.3.0/main/php_network.h:113: warning: `struct sockaddr' declared inside parameter list In file included from /usr/local/src/php4/php-4.3.0/ext/standard/php_standard.h:44, from /usr/local/src/php4/php-4.3.0/ext/zlib/zlib.c:48: /usr/local/src/php4/php-4.3.0/ext/standard/fsock.h:43: warning: `struct in_addr' declared inside parameter list *** Error code 1 Stop in /usr/local/src/php4/php-4.3.0. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uid checked by file_exists()
Have you checked your php.ini for a safe mode setting to true/on ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Emmanuel.Leguy [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 7:49 PM > To: [EMAIL PROTECTED] > Subject: [PHP] uid checked by file_exists() > > > Hello, > > I've just installed PHP 4.3.0. The 4.0.6 was installed > before. With the > new version, in safe mode, the 'file_exists' function produce > this warning: > > Warning: file_exists() [function.file-exists]: SAFE MODE > Restriction in > effect. The script whose uid is 302 is not allowed to access > /full/path/to/file.gif owned by uid 301 in > /full/path/to/script.php on > line 12 > > I did not have this problem with version 4.0.6. > > Please help me! > > Thank you, > > > Emmanuel. > > > -- > 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
[PHP] Re: EOF: how to generate one in a string
I also tried tried with popen with no success. $fp = popen('/usr/src/bsfmdk/CCCallServer 2>&1', 'r'); fwrite($fp, $query); $result = fread($fp, 8096); echo "result is "; echo "$result "; I get back and empty result string ... Any more hints? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] EOF: how to generate one in a string
No, there is no such value as far as I know, you may try `/path/prog $arg < somefile`, but I doubt it will be different. What prog is it anyway. If it is passwd, I know this behaves somewhat different, but I think there is still some workaround, you should as at a linux list. Jean-Christian Imbeault wrote: Marek Kilimajer wrote: $result = `echo | /path/prog $arg`; should work That didn' work ... don't know why. Isn't there a way to say echo "EOF"? There must be a way to specify the ascii or hex value for EOF in an echo statement no? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] EOF: how to generate one in a string
Marek Kilimajer wrote: What prog is it anyway. It is a credit card processing program. It is interactive. You can it, type values in hit return, then ctrl-D and it spits out a status code. If I put all the values in a file I can get the prog to work by doing: #./prog < filename It does not take any command line arguments. So I cannot just do "exec prog $args" since the "args" have to be typed in, one value per line (i.e hit return between values) and then on the last line ctrl-D ... Can anyone think of a way I can get PHP to do this short of writing to a file and the doing "exec 'prog < file_I_wrote'"?? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: EOF: how to generate one in a string
I'm at wits end ... I've tried everything from system(), shell_exec(), bacticks, popen() and still no go ... I even tried writing the data to file first and then doing a system("./prog 2>&1 < ./datafile") and that didn't work either. I know that it shoudl work b/c if from the command line I issue the same command (using the file created by PHP) it works fine. Can anyone offer advice on why I can't get PHP to execute this external program? Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: EOF: how to generate one in a string
I would suggest you have a look at: http://expect.nist.gov/ Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 8:24 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: EOF: how to generate one in a string > > > I'm at wits end ... I've tried everything from system(), > shell_exec(), > bacticks, popen() and still no go ... > > I even tried writing the data to file first and then doing a > system("./prog 2>&1 < ./datafile") and that didn't work either. > > I know that it shoudl work b/c if from the command line I > issue the same > command (using the file created by PHP) it works fine. > > Can anyone offer advice on why I can't get PHP to execute > this external > program? > > Thanks! > > Jc > > > -- > 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
[PHP] $_SERVER content
Hi folks, I've seen a lot phpinfo() on different platforms, different PHP versions with different web servers. Always the content of $_SERVER is different. i.e PHP4.3.0 on win32 with Apache2 doesn't show PATH_TRANSLATED and HTTP_REFERER. someone knows how to get a consitent content of $_SERVER? Or where and how can I configure my system to see the above? thanks in advance Fritz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER content
On Wednesday 08 January 2003 19:00, Fritzek wrote: > Hi folks, > > I've seen a lot phpinfo() on different platforms, different PHP versions > with different web servers. > Always the content of $_SERVER is different. i.e PHP4.3.0 on win32 with > Apache2 doesn't > show PATH_TRANSLATED and HTTP_REFERER. > someone knows how to get a consitent content of $_SERVER? Or where and how > can I configure my > system to see the above? The contents of $_SERVER is provided by the webserver and hence the differences between versions and platforms. There's nothing that you can do about it. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Pardon me, but do you know what it means to be TRULY ONE with your BOOTH! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER content
Hmmm. What does it mean? Is PHP deciding at runtime which variable in $_SERVER have to be filled? PATH_TRANSLATED should always be filled because you always have a path where your script is located. Also HTTP_REFERER because in easiest case you refering on the same script at localhost (I guess). "Marek Kilimajer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You did not see HTTP_REFERER likely because there was none > > > Fritzek wrote: > > >Hi folks, > > > >I've seen a lot phpinfo() on different platforms, different PHP versions > >with different web servers. > >Always the content of $_SERVER is different. i.e PHP4.3.0 on win32 with > >Apache2 doesn't > >show PATH_TRANSLATED and HTTP_REFERER. > >someone knows how to get a consitent content of $_SERVER? Or where and how > >can I configure my > >system to see the above? > > > >thanks in advance > > > >Fritz > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: EOF: how to generate one in a string
Ok, found the problem. The external program I was trying to run is only happy is it is called from the same directory as the one it resides in. I guess it needs to access files in it's directory and by calling from php somehow it gets confused as to where to files are. Thanks to everyone for their patience and help! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER content
but there must be a way which causes differences. I've searched the net and found a page which shows phpinfo(); and this was the same versions of php, webserver and os and the PATH_TRANSLATED was setted, but not on my server. "Jason Wong" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wednesday 08 January 2003 19:00, Fritzek wrote: > > Hi folks, > > > > I've seen a lot phpinfo() on different platforms, different PHP versions > > with different web servers. > > Always the content of $_SERVER is different. i.e PHP4.3.0 on win32 with > > Apache2 doesn't > > show PATH_TRANSLATED and HTTP_REFERER. > > someone knows how to get a consitent content of $_SERVER? Or where and how > > can I configure my > > system to see the above? > > The contents of $_SERVER is provided by the webserver and hence the > differences between versions and platforms. There's nothing that you can do > about it. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Pardon me, but do you know what it means to be TRULY ONE with your BOOTH! > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER content
At 12:00 PM 1/8/03 +0100, Fritzek wrote: Hi folks, I've seen a lot phpinfo() on different platforms, different PHP versions with different web servers. Always the content of $_SERVER is different. i.e PHP4.3.0 on win32 with Apache2 doesn't show PATH_TRANSLATED and HTTP_REFERER. someone knows how to get a consitent content of $_SERVER? Or where and how can I configure my system to see the above? There isn't anything PHP can do about this, all it can do is return what the server sends. Browsers, firewalls and proxies can all decide to hide information from you. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER content
You did not see HTTP_REFERER likely because there was none Fritzek wrote: Hi folks, I've seen a lot phpinfo() on different platforms, different PHP versions with different web servers. Always the content of $_SERVER is different. i.e PHP4.3.0 on win32 with Apache2 doesn't show PATH_TRANSLATED and HTTP_REFERER. someone knows how to get a consitent content of $_SERVER? Or where and how can I configure my system to see the above? thanks in advance Fritz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER content
Fritzek wrote: Hmmm. What does it mean? Is PHP deciding at runtime which variable in $_SERVER have to be filled? PATH_TRANSLATED should always be filled because you always have a path where your script is located. Also HTTP_REFERER because in easiest case you refering on the same script at localhost (I guess). referer is set only if you get to the page by clicking a link or submiting a form (if the browser is not set up to do different). so it is not set if you select the page from a bookmark or write it directly to location bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions error
> -Original Message- > From: Mike Tuller [mailto:[EMAIL PROTECTED]] > Sent: 08 January 2003 01:23 > > I am working with sessions, and following an example in a book and am > getting an error that I am not sure of. I have an html doc > that has the > fields for username and password and the information entered goes to > this script. > > session_start(); [...] > if ($num > 0 ) > { > $valid_user = $_POST[username]; > session_register("valid_user"); > } > > // PHP script to create the html for the login page > if (session_is_registered("valid_user")) [...] > > Warning : Unknown(): Your script possibly relies on a session > side-effect which existed until PHP 4.2.3. Please be advised that the > session extension does not consider global variables as a source of > data, unless register_globals is enabled. You can disable this > functionality and this warning by setting session.bug_compat_42 or > session.bug_compat_warn to off, respectively. in Unknown on line 0 > > What does this mean, and what am I doing wrong? Well, you're not necessarily doing anything wrong -- as the warning says, your script *possibly* relies on... What's happened is that in version 4.3.0, a bug in session variable handling was fixed -- but the fix changes the way session variables behave in certain situations, and PHP has detected that you *may* have coded in a way that is sensitive to those changes. If you understand the issues (and I'm not 100% sure I do!) and are *sure* you're not relying on them, then you can set the session.bug_compat_* values in php.ini as specified. The best way of avoiding this error, however, is to drop the use of session_register() and friends, and switch to using the $_SESSION[] array -- so the fragment of code I've left in above would become: if ($num > 0 ) { $_SESSION['valid_user'] = $_POST['username']; } // PHP script to create the html for the login page if (isset($_SESSION["valid_user"])) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compiling php
Hello list, just a simple question regarding php - compiling: when I compile php --with-gd="/usr..." How can I get the exact directory of gd (or gd-libs)??? Qualified answers are welcome. Oliver Etzel
Re: [PHP] Re: custom error handling
actually its getting there $backtrace = debug_backtrace(); foreach ($backtrace as $val) { if (eregi($val['function'],'query')){ echo $val['file'].""; echo $vale['line'].""; } } "Michael Sims" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Wed, 8 Jan 2003 08:28:58 +1100, you wrote: >> hi there i am trying to build a ustom error handler for the pear db aswell >> as catch fatal and parse errors , unfortunatly the pear db error message >> wont give me back the file and the line where the error is, how can i >> determine the line and file where the error is caused ufortunatly the >> callback funtion with the params $errfile and $errline return the file >that >> contains the trigger not the script itself ! If you're running PHP 4.3.0 use debug_backtrace() inside your custom error handler to trace the error. If you're not running PHP 4.3.0 consider upgrading, because debug_backtrace() is a lifesaver. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.0 and multibytestrings?
I got a simple question. What do you have to do when you want to use multibytestring functions under PHP 4.3.0 assuming you're using the windows binaries and you're running on XP? Is it standard or do you have to adjust some things? Cheers, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: Unlink failed (Permission denied) in
Please could someone let me know the cause of this error message "Warning: Unlink failed (Permission denied) in ...". Regards Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP mySQL Syntax problem
I'm working in PHP4 and have suceeded in creating a mySQL table. I can fill the table using the INSERT command as follows: The above works fine. Here is the problem: Instead of specifying the color, red, green, etc. I would like to generate a random color and store it in a variable, then use the variable in the INSERT command. To simplify the code in this example, I have just assigned a color to the varialble. $color = "red"; MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', $color)"); $color="green" MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(2, 'Jane Smith', $color)"); This syntax does not work. The table is created, but it has 0 rows. I have tried a multitude of variations, including ECHO $color '$color' \'$color\' {$color} etc. No combination I have tried works. Could some kind person please point me in the right direction? Thanks, Jo Ann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Unlink failed (Permission denied) in
You are trying to delete/unlink a file with a php script. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Kevin Meredith [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:54 PM > To: PHP > Subject: [PHP] Warning: Unlink failed (Permission denied) in > > > Please could someone let me know the cause of this error message > "Warning: Unlink failed (Permission denied) in ...". > > Regards > Kevin > > -- > 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
Re: [PHP] PHP mySQL Syntax problem
MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', '$color')"); - single quotes around $color Jo Ann Comito wrote: I'm working in PHP4 and have suceeded in creating a mySQL table. I can fill the table using the INSERT command as follows: The above works fine. Here is the problem: Instead of specifying the color, red, green, etc. I would like to generate a random color and store it in a variable, then use the variable in the INSERT command. To simplify the code in this example, I have just assigned a color to the varialble. $color = "red"; MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', $color)"); $color="green" MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(2, 'Jane Smith', $color)"); This syntax does not work. The table is created, but it has 0 rows. I have tried a multitude of variations, including ECHO $color '$color' \'$color\' {$color} etc. No combination I have tried works. Could some kind person please point me in the right direction? Thanks, Jo Ann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Img src
Try using single quotes inside your double quotes, just like you did with the width and haight values. he following line: print ""; __ 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
[PHP] Re: Img src
Try using single quotes inside your double quotes, just like you did with the width and haight values. The following line should work: print ""; Robert Fisher Axis Solutions, Inc. __ 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
[PHP] How do I get the entire data sended to the web server?
Is it possible with php to print the http header and the attached data for a transmitted http request? How can I do this? an example of what I want to see: POST /cgi-bin/CgiMfc1?MyQuery%3dQData HTTP/1.1 Accept: text/* User-Agent: HttpCall Accept-Language: en-us Host: localhost:680 Content-Length: 98 000629EF2656+vs+%0d%0a143%2e114%2e37%2e22+vs+%0d%0aDEKGKIEG+vs+ %0d%0a000629ef2656+vs+%0d%0a2051586 Thanks Heiko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to detect a PHP script time-out?
If you are willing to do a rewrite, then have your main script start a fork, or child process. The child process would run your script while the parent would do nothing else but wait for the child. if the child times out the parent will know and you can then print out a error message. See the following on how to implement forks (process controls). It is kind of confusing and could be fatal to your system load if done incorrectly. http://www.php.net/manual/en/ref.pcntl.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
Re: [PHP] Re: PHP and MySQL bug
@mysql_select_db("be"); // this doesn't fail, because only the second (UPDATE) query fails. The first query (SELECT) is done! - Original Message - From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "Nuno Lopes" <[EMAIL PROTECTED]> Cc: "MySQL List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 5:06 PM Subject: Re: [PHP] Re: PHP and MySQL bug > @mysql_select_db("be"); -- this failed > do echo mysql_error(); to see what went wrong > > > > Nuno Lopes wrote: > > >I done a echo of Mysql_error and it returned: > >'Nenhum banco de dados foi selecionado' > > > >(I have the mysql server in portuguese, but the translation is something > >like 'no db was selected') > > > > > >- Original Message - > >From: "David Freeman" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Sent: Sunday, January 05, 2003 10:29 PM > >Subject: RE: [PHP] Re: PHP and MySQL bug > > > > > > > > > >> > @MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this > >> > query doesn't work > >> > >>Personally, I'd call it bad programming practice to do a database update > >>and not check to see if it worked or not. In this case, how are you > >>determining that the query did not work? Are you manually checking the > >>database? You don't have anything in your code to check the status of > >>this query. > >> > >>Perhaps this might get you somewhere: > >> > >>$qid = @mysql_query("UPDATE d SET h = '$h' WHERE id = '$id'"); > >> > >>if (isset($qid) && mysql_affected_rows() == 1) > >>{ > >> echo "query executed"; > >>} else { > >> echo "query failed: " . mysql_error(); > >>} > >> > >>At least this way you might get some indication of where the problem is. > >> > >>CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and MySQL bug
Doesn't you have any simpler answer?? Maybe installing the new version of mysql server - I have version 3.23.49 - should do the trick - Original Message - From: "Larry Brown" <[EMAIL PROTECTED]> To: "Nuno Lopes" <[EMAIL PROTECTED]>; "MySQL List" <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 4:12 PM Subject: RE: [PHP] Re: PHP and MySQL bug > Since nobody is jumping in to say it is some simple configuration/setting > personally my next step would be to shut down all services on the box that > aren't absolutely necessary and stop everything in the registry under run > and stop anything in the start folder of the start menu and run the same > tests. If no positive results I would uninstall php completely and clean > any reference in the registry of it and then install with everything still > shut down. Retest, if no progress do the same with mysql. These are > radical and time-consuming methods, but it seems as though it is broken. If > you absolutely need this fixed fast you might resort to paying the > developers to give you a solution, although it may end up being what I just > listed, or it could be some simple fix that we aren't aware of. > > Larry S. Brown > Dimension Networks, Inc. > (727) 723-8388 > > -Original Message- > From: Nuno Lopes [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 07, 2003 4:31 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] Re: PHP and MySQL bug > > I have the latest version of PHP (4.3.0) as module in apache 2.0.43 and > mysql 3.23.49. > Everything is working fine, except this. > With pconnect the error is the same! > > > - Original Message - > From: "Larry Brown" <[EMAIL PROTECTED]> > To: "MySQL List" <[EMAIL PROTECTED]> > Sent: Monday, January 06, 2003 6:28 PM > Subject: RE: [PHP] Re: PHP and MySQL bug > > > > This definitely sounds like a buggy installation or there may be some > > problem with the communication between the web server and the mysqld. Is > > the db on a different machine? Try using mysql_pconnect instead of > connect > > just to see what result you get. I have read some unfavorable statements > > about using pconnect with a large number of hits so if it works you should > > read the comments about it on php.net. Do a search for mysql_pconnect. > > > > Larry S. Brown > > Dimension Networks, Inc. > > (727) 723-8388 > > > > -Original Message- > > From: Nuno Lopes [mailto:[EMAIL PROTECTED]] > > Sent: Monday, January 06, 2003 1:09 PM > > To: MySQL List; [EMAIL PROTECTED] > > Subject: [PHP] Re: PHP and MySQL bug > > > > The problem is if I close the connection and reopen it the query is done, > > but if I remain with the same connection has the previous query, mysql > > returns an error. > > > > > > - Original Message - > > From: "Larry Brown" <[EMAIL PROTECTED]> > > To: "MySQL List" <[EMAIL PROTECTED]> > > Sent: Sunday, January 05, 2003 4:16 PM > > Subject: Re:PHP and MySQL bug > > > > > > > Try replacing the following line... > > > > > > @MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this query > doesn't > > > work > > > > > > With... > > > > > > $query = "UPDATE d SET h='$h' WERE id='$id'"; > > > $queryr = mysql_query($query) or die("The sql statement does not > > execute"); > > > > > > if(mysql_affected_rows() !== 1) > > > { > > >die("The sql statement is successfully run however either h did not > > > change or there is an internal error. Try executing the sql from the > > > command line to make sure it otherwise works."); > > > } > > > > > > and see which is coming back. > > > > > > > > > Larry S. Brown > > > Dimension Networks, Inc. > > > (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I get the entire data sended to the web server?
I don't think there is a single variable, but you can build it from various variables and functions: $_SERVER array: REQUEST_METHOD REQUEST_URI SERVER_PROTOCOL function getallheaders() |$HTTP_RAW_POST_DATA| |this should be all you need| Heiko Mundle wrote: Is it possible with php to print the http header and the attached data for a transmitted http request? How can I do this? an example of what I want to see: POST /cgi-bin/CgiMfc1?MyQuery%3dQData HTTP/1.1 Accept: text/* User-Agent: HttpCall Accept-Language: en-us Host: localhost:680 Content-Length: 98 000629EF2656+vs+%0d%0a143%2e114%2e37%2e22+vs+%0d%0aDEKGKIEG+vs+ %0d%0a000629ef2656+vs+%0d%0a2051586 Thanks Heiko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: graph libs
I use chartDirector (http://www.advsofteng.com) for generating graphs and reports with PHP. chartDirector charts look really good and the license is cheap. There's also jpGraph: http://www.aditus.nu/jpgraph/ -Rosie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to detect a PHP script time-out?
On Wednesday 08 January 2003 06:42, Jean-Christian Imbeault wrote: > Timothy Hitchens ) wrote: > > Issue... as I said before the register shutdown won't work because: > > > > - output from the shutdown is not visible nor do you have access to some > > variables > > You are right. From the manual: > > http://www.php.net/manual/en/function.register-shutdown-function.php > > " The registered shutdown functions are called after the request has > been completed (including sending any output buffers), so it is not > possible to send output to the browser using echo() or print(), or > retrieve the contents of any output buffers using ob_get_contents()." That's not right now. The manual is outdated. See this bug report http://bugs.php.net/bug.php?id=15209. This behavior was changed from 4.06 to 4.1. In newer versions of php the registered functions will run before the connection is closed so ouptput can be done from there as well. So Jean you can make it as it is suggested on this page: http://www.php.net/manual/en/features.connection-handling.php Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] graph libs
http://www.aditus.nu/jpgraph/ Larry Brown wrote: Can anyone give any suggestions on the best/most intuitive tools or libraries for generating graphs with PHP? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unlink ($files);
Can't do wildcards like * because thats something that as I found out a few days ago, is expanded by the shell into a full command, so because your not running a shell, it can't be expanded and the raw unlink call to *.* fails because the unlink function doesn't understand wildcards. If you really want to do a recursive deletion (i.e., remove both a directory and everything under it) you could use: exec("/bin/rm -rf path/$name-of-dir-to-be-erased"); Just be very sure about what your doing (multiple checks on the variable's value to make sure your not erasing anything you don't want to) cause this command, when executed with the proper permissions, will kill any directory and everything under it. On Wed, 2003-01-08 at 00:29, [EMAIL PROTECTED] wrote: Ok, Jason, here's another one! I think I've read how to delete a file. I need to delete 25 files, then do a rmdir(blah); Line 16: $directory = "path/*.*"; Warning: Unlink failed (No such file or directory) in /mnt/ls6/17/169//htdocs/2003/_admin/del_listing_action.php on line 16 Warning: RmDir failed (File exists) in /mnt/ls6/17/169//htdocs/2003/_admin/del_listing_action.php on line 17 Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: EOF: how to generate one in a string
What is the ASCII value of an EOF? Find that and use Matt - Original Message - From: Jean-Christian Imbeault <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 5:24 AM Subject: [PHP] Re: EOF: how to generate one in a string > I'm at wits end ... I've tried everything from system(), shell_exec(), > bacticks, popen() and still no go ... > > I even tried writing the data to file first and then doing a > system("./prog 2>&1 < ./datafile") and that didn't work either. > > I know that it shoudl work b/c if from the command line I issue the same > command (using the file created by PHP) it works fine. > > Can anyone offer advice on why I can't get PHP to execute this external > program? > > Thanks! > > Jc > > > -- > 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
[PHP] Looping through directories?
Currently I have a script that reads an index file and from that index file it then loops through all files in that directory based on the index. Instead of one directory now I have several and I want to loop through each directory and go to each directory's index file. Since there is no pattern for the name if the indexes, I assume I need to create an array holding the directory name and the associated index file name like so $dirs = array("Sports" => "spindex.xml", "Business News" => "business.xml") etc Now, I need help with the loop to whip through each directory. Would I do a foreach on the array I just created? Any help would be greatly appreciated. I need to be able to access both the directory name and index name. Jeff
[PHP] stripslashes and quoted material
Hey all. I noticed a string containing slashes was breaking some code of mine on an w2k/IIS box running php 4.2.3. For example -> http://www.apache.org/\"; target=\"_blank\"> When trying to apply stripslashes, the slashes remained. So I applied str_replace('\"', '', $var) and that worked. Any idea as to why stripslashes would not remove the slashes in the string? Thanks for any input. -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: confirm unsubscribe from php-general@lists.php.net
-- Ft. Meade cryptographic KGB munitions jihad nitrate class struggle Semtex radar spy Iran supercomputer Treasury FSF nuclear [See http://www.aclu.org/echelonwatch/index.html for more about this] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] graph libs
This is by no means an advertisement, just one of the results I got looking around for charts. The following link lists a few viable solutions. http://www.hotscripts.com/PHP/Scripts_and_Programs/Graphs_and_Charts/ Jpgraph renders an excellent image from the examples but the prerequisite packages were many and ultimately the install/readme didn't work for compiling the package. I could have looked further and found a solution, but with the number of prerequisites I dropped it looking for a faster install. The next one I came across that gave a reasonable looking chart was phplot which only requires GD which is stock on my RH distro. I got it up and working without any installation (not to mention dependencies). So I am up and running quickly and smoothly with phplot. It's a shame jpgraphs' dependencies aren't packaged with the distro. The transparent option on the colors is really smooth and I just don't have the time. Thanks to all for suggestions, I still want to look at one other site that was recommended here on the list. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 9:10 AM To: Larry Brown Cc: PHP List Subject: Re: [PHP] graph libs http://www.aditus.nu/jpgraph/ Larry Brown wrote: >Can anyone give any suggestions on the best/most intuitive tools or >libraries for generating graphs with PHP? > >Larry S. Brown >Dimension Networks, Inc. >(727) 723-8388 > > > > > > -- 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
Re: [PHP] stripslashes and quoted material
On Wed, 8 Jan 2003, Gerard Samuel wrote: > http://www.apache.org/\"; target=\"_blank\"> > > When trying to apply stripslashes, the slashes remained. So I applied > str_replace('\"', '', $var) and that worked. > Any idea as to why stripslashes would not remove the slashes in the string? stripslashes() will unescape single-quotes if magic_quotes_runtime = Off in your php.ini. If you have magic_quotes_runtime = On, then it will also unescape double-quotes (and backslashes and NULLs). ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] graph libs
My extreme apologies to jpgraphs. They are more in line with phplot. I might even end up using them instead. Vagarant is the more difficult package. Again, their graph examples are pretty smooth but required a lot of package/dependency updates to RH. >This is by no means an advertisement, just one of the results I got looking around for charts. The following link lists a few viable > solutions. >http://www.hotscripts.com/PHP/Scripts_and_Programs/Graphs_and_Charts/ >Jpgraph renders an excellent image from the examples but the prerequisite packages were many and ultimately the install/readme didn't work >for compiling the package. I could have looked further and found a solution, but with the number of prerequisites I dropped it looking for a >faster install. The next one I came across that gave a reasonable looking chart was phplot which only requires GD which is stock on my RH >distro. I got it up and working without any installation (not to mention dependencies). So I am up and running quickly and smoothly with >phplot. It's a shame jpgraphs' dependencies aren't packaged with the distro. The transparent option on the colors is really smooth and I just >don't have the time. Thanks to all for suggestions, I still want to look at one other site that was recommended here on the list. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Looping through directories?
On Wed, 8 Jan 2003, Jeff Lewis wrote: > pattern for the name if the indexes, I assume I need to create an array > holding the directory name and the associated index file name like so > $dirs = array("Sports" => "spindex.xml", "Business News" => > "business.xml") etc > > Now, I need help with the loop to whip through each directory. Would I > do a foreach on the array I just created? Any help would be greatly > appreciated. I need to be able to access both the directory name and > index name. foreach() would work for you ... foreach( $dirs as $dirName => $indexName ){ $indexPath = "${dirName}/${indexName}"; $fh = fopen( $indexPath, "r" ); // ... fclose( $fh ); // I'm just guessing; do whatever you want in this loop } hth, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stripslashes and quoted material
I figured out the problem. magic_quotes_sybase was turned on, on the IIS box. All is well with stripslashes() again. Chris Wesley wrote: On Wed, 8 Jan 2003, Gerard Samuel wrote: http://www.apache.org/\"; target=\"_blank\"> When trying to apply stripslashes, the slashes remained. So I applied str_replace('\"', '', $var) and that worked. Any idea as to why stripslashes would not remove the slashes in the string? stripslashes() will unescape single-quotes if magic_quotes_runtime = Off in your php.ini. If you have magic_quotes_runtime = On, then it will also unescape double-quotes (and backslashes and NULLs). ~Chris -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions error
That did it! Thanks. On Wednesday, January 8, 2003, at 05:16 AM, Ford, Mike [LSS] wrote: -Original Message- From: Mike Tuller [mailto:[EMAIL PROTECTED]] Sent: 08 January 2003 01:23 I am working with sessions, and following an example in a book and am getting an error that I am not sure of. I have an html doc that has the fields for username and password and the information entered goes to this script. [...] if ($num > 0 ) { $valid_user = $_POST[username]; session_register("valid_user"); } // PHP script to create the html for the login page if (session_is_registered("valid_user")) [...] Warning : Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 What does this mean, and what am I doing wrong? Well, you're not necessarily doing anything wrong -- as the warning says, your script *possibly* relies on... What's happened is that in version 4.3.0, a bug in session variable handling was fixed -- but the fix changes the way session variables behave in certain situations, and PHP has detected that you *may* have coded in a way that is sensitive to those changes. If you understand the issues (and I'm not 100% sure I do!) and are *sure* you're not relying on them, then you can set the session.bug_compat_* values in php.ini as specified. The best way of avoiding this error, however, is to drop the use of session_register() and friends, and switch to using the $_SESSION[] array -- so the fragment of code I've left in above would become: if ($num > 0 ) { $_SESSION['valid_user'] = $_POST['username']; } // PHP script to create the html for the login page if (isset($_SESSION["valid_user"])) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade help!
In case any one else needs to know: I had to erase the rpm version of gd, gd-devel and libpng, libpng-devel The rpm versions were 1.0.12. For some reason the configure option -with-png-dir=../libpng-1.2.1 was using the headers from the right dir, but somehow used the rpm version for compiling instead. Is this a bug? Shouldn't it use libpng-1.2.1 for everything? Once I got rid of the rpm versions, I know longer had a problem. - Original Message - From: "PHP List" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 4:34 PM Subject: [PHP] Upgrade help! Hi, I am trying to upgrade to php4.3.0, everything works, but when I try to use any gd image functions I get the following error: libpng warning: Application was compiled with png.h from libpng-1.2.1 libpng warning: Application is running with png.c from libpng-1.0.12 gd-png: fatal libpng error: Incompatible libpng version in application and library [Tue Jan 7 16:30:21 2003] [notice] child pid 14014 exit signal Segmentation fault (11) I downloaded and installed libpng-1.2.1 I configured php with: ./configure' '--with-jpeg-dir=../jpeg-6b' '--with-mysql=/usr/' '--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' '--with-mcrypt=../libmcrypt-2.4.22' '--with-png-dir=../libpng-1.2.1' '--with-zlib-dir=../zlib-1.1.3' '--enable-exif' '--with-freetype-dir=../freetype-2.1.3' Where is is getting the libpng-1.0.12 from? I can't find it anywhere on the server. I am using apache 1.3.27 on redhat 7 Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Terminal text objects (PHP CDK NCURSES)
Hello, I want to share the code (php-extension) I have included into php-4.2.2 to support CDK widgets (http://gd.tuwien.ac.at/hci/cdk/?file=cdk.tar.gz&type=listing) to enable PHP to use text based "GUI" in terminal environment. CDK supports: -Alphalist (list with alphanumeric search) -Calendar dialog box -Dialog -Entry field with type masking -Scale field -2 dimension graphics (text mode) -Histogram display -Item list field -Label -Marque (text box in movement) -Matrix field -Menu -Scroll -Selection field -Slider field -Radio button -Template field CDK is very complete library to handle text based objects with ncurses. What I have included from it to php is: -Entry field -Alphalist -Menu -Label Right now we use it at Agua y Saneamiento de Toluca (a Mexican Government Office) and it has been very usefull. The code is located in ext/cdk directory , it doesn't include all the CDK features, it is like 10% of it right now, but the interface is already there and open to developers who want to extend it: ftp://www.ayst.gob.mx/pub/php-with-cdk-widgets/ Best regards Nikolai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Zend IDE vs. PhpEd
I thought autocompletion would help you _avoid_ silly mistakes. For example, defining $varName then trying to use $varname when you really meant to use $varName. In php I would say it's a tossup because if you reference a variable that doesn't exist it will contain a NULL or FALSE value but php will not warn you. But in something like C I would have to agree that autocompletion can lead to much more difficult problems to track down. Because in C, if you never assign the variable the compiler (depending on the compiler of course) will warn you. If you accidentially assign a subtilly different variable that can be hard to track down, and the compiler will only warn you if it's a different datatype. --Buddy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange file upload problem in php 4.2.3
Hello php-general, I'm trying to figure out why I can't upload any file in php. Form code Use this form to upload your new photographs. Note: only JPEG (.jpg) and PNG (.png) files allowed. Maximimum allowed file size is 40KB. Photograph: Description: PHP code === 0) { $storename = $uniqueid = md5 (uniqid (rand)); if ($filetype == "image/jpeg" || $filetype == "image/pjpeg") $storename .= ".jpg"; if ($filename == "image/png" || $filetype == "image/x-png") $storename .= ".png"; $desc = $_POST["photodesc"]; // Store the file in the photos folder and add record to database if (is_uploaded_file ($_FILES['photo']['tmp_name'])) { if (!@move_uploaded_file ($_FILES['photo']['tmp_name'], $photospath.$storename)) { $errormsg .= " Problem uploading the file. Please try again. If the problem persists please email [EMAIL PROTECTED] to report the error."; } else { @chmod ($photospath.$storename, 0644); $sql = "INSERT INTO hcs_photos (clientID,photoName,photoTitle,uploadTimeStamp) VALUES ('". $_SESSION["clientID"] ."','$storename','$desc','$timestamp')"; $db->Query ($sql, $conn); } } else { $errormsg .= "Possible file upload attack. Filename: ". $_FILES['photo']['name']; } } else { $errormsg .= "Invalid file size. Maximum of 40KB allowed"; } } else { $errormsg .= "Invalid file type. Only JPEG and PNG files allowed"; } if (strlen ($errormsg) < 5) { header ("Location: ". $baseurl ."photos.php"); } } ?> When I upload a file I get $filesize equal to 0. In my php.ini i got the following section: ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = "/tmp" ; Maximum allowed size for uploaded files. upload_max_filesize = 2M Please help. PHP even does not create a temp file in a temp directory. /tmp got permission 777 I'm running Apache 2.0.43 and RedHat Linux -- Best regards, Submission.org.ru mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.0 with Oracle
Hy Guys, I´m a newby here. I´am trying to compile PHP 4.3.0 with Oracle support. When it compiles oci8.c , it returns an error, like follows: /bin/sh libtool --silent --mode=compile gcc -Iext/oci8/ -I/usr/src/php-4.3.0/ext/oci8/ -DPHP_ATOM_INC -I/usr/src/ph p-4.3.0/include -I/usr/src/php-4.3.0/main -I/usr/src/php-4.3.0 -I/usr/src/ph p-4.3.0/Zend -I/usr/include/imap -I/opt/oracle/product/8.1.5/rdbms/demo -I/o pt/oracle/product/8.1.5/network/public -I/opt/oracle/product/8.1.5/plsql/pub lic -I/usr/src/php-4.3.0/ext/xml/expat -DLINUX=22 -DMOD_SSL=208111 -DUSE_HS REGEX -DEAPI -DUSE_EXPAT -I/usr/src/php-4.3.0/TSRM -g -O2 -prefer-pic -c /usr/src/php-4.3.0/ext/oci8/oci8.c -o ext/oci8/oci8.lo /usr/src/php-4.3.0/ext/oci8/oci8.c: In function `zif_ocierror': /usr/src/php-4.3.0/ext/oci8/oci8.c:4271: `OCI_ATTR_STATEMENT' undeclared (first use in this function) /usr/src/php-4.3.0/ext/oci8/oci8.c:4271: (Each undeclared identifier is reported only once /usr/src/php-4.3.0/ext/oci8/oci8.c:4271: for each function it appears in.) make: *** [ext/oci8/oci8.lo] Error 1 With PHP 4.2.3 and belower, it worked fine. Anyone has any ideas? Thanks very much, José Manuel Valente -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp_put: permission denied
Hi, I am running a really simple php script to upload files on my server via ftp. But it always return this warning: ftp_put(): Permission denied I can't have to do anything with CHMOD can it? I mean it's ftp!! I don't know what else it is but I guess it's a pretty common problem. Thx for any help, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put: permission denied
I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 4:53 AM > To: [EMAIL PROTECTED] > Subject: [PHP] ftp_put: permission denied > > > Hi, > I am running a really simple php script to upload files on my > server via ftp. But it always return this warning: ftp_put(): > Permission denied I can't have to do anything with CHMOD can > it? I mean it's ftp!! I don't know what else it is but I > guess it's a pretty common problem. Thx for any help, Olli > > > -- > 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
Re: [PHP] Rookie mail() q's .. can't find answer after RTFM...
Hi Sean Burlington, et al ... Sorry for the slow response, been really sick lately ... Just wanted to thank y'all for offering h & s. Ended up doing it with hidden fields ... also made it a bit easier to make the validation script put the info back into the form ... After testing things out I actually got the answer to all my questions ... just had to change some of the fields so that my mailserver would actually delier the mail... thx Rene On Mon, 30 Dec 2002 00:40:53 +, you wrote about "Re: [PHP] Rookie mail() q's .. can't find answer after RTFM..." something that looked like this: >> Q 1: >> >> Well, building the form and making the page preview the message is the >> easy part. But how do I make the page retain the message so that I can 1. >> actually send the thing after the second submit, and 2. make it fill out >> the form when user wish to alter message (or there's an error) ??? > >either put the fields you want as hidden fields in the preview page > >or > >store them as session variables > >> Q 2: >> >> The manual doesn't really say it that clearly, but do I need to have the >> content-type field when the message is plain text already? > >plain text is the default > >> And should I be adding a Date: field, or does the mail() function figure >> that out itself? > >I'm not sure - have you tried it ? > >> My incoming mail server does not accept messages without a date field, so >> if I need to add it, I'd really like to know. It also doesn't like >> messages with more than 1 of each field...(except received-by). >> > >just look at an email in your inbox and copy the format of the date field. > >-- > >Sean :) -- Rene Brehmer This message was written on 100% recycled spam. Come see! My brand new site is now online! http://www.metalbunny.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fletcher's checksum
Does anybody know how to implement the 8 and 16 bit versions of Fletcher's checksum using PHP? I hit google and came up dry. It's easy enough to find how to do it in C, but PHP if a different story. I know there are plenty of perfectly good checksum options that are standard in PHP, but I'm forced to used Fletcher's for work. If anybody can point me to a URL or give a code example, it would be greatly apreciated. Best Regards, David Gervais -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apache + mod_php question
Hello, I have searched the archives and not been able to find the solution to the following problem. I would be very grateful if someone here could help or provide some pointers. The basic problem is this: Our apache server will not start if there are system processes running that were spawned from apache's last invocation (ie. spawned from cgi's, mod_php system() calls, etc.). It dies with "cannot bind to ip_address_here port 80", etc. Example: We restart our servers every so often via crontab in order to reload modified conf files, etc. However it appears that if a user has spawned a process from mod_php, cgi, etc. that the server will not restart until those processes are killed off manually. The worst cases are when badly wrote user scripts allow an attacker to upload scripts that bind to a port and attempt to make network access, etc. (I would love to disallow users from having uploads to the server but that is not currently an option). Does anyone have any suggestion on how to automagically kill these processes? Does anyone have their own favorite recipe for stopping/starting apache in an automated fashion. Right now these situations result in downtime for users and a pager in the middle of the night to me! I would very much like to stop this :) Thanks much! __ 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
RE: [PHP] apache + mod_php question
use: apachectl graceful It will reload the config's and allow operation to continue!! See apachectl (help) start - start httpd stop - stop httpd restart- restart httpd if running by sending a SIGHUP or start if not running fullstatus - dump a full status screen; requires lynx and mod_status enabled status - dump a short status screen; requires lynx and mod_status enabled graceful - do a graceful restart by sending a SIGUSR1 or start if not running configtest - do a configuration syntax test help - this screen Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Hugh Beaumont [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:14 AM > To: [EMAIL PROTECTED] > Subject: [PHP] apache + mod_php question > > > Hello, > > I have searched the archives and not been able to find the > solution to > the following problem. I would be very grateful if someone > here could help or provide some pointers. > > The basic problem is this: > > Our apache server will not start if there are system > processes running that were spawned from apache's last > invocation (ie. spawned from cgi's, mod_php system() calls, > etc.). It dies with "cannot bind to ip_address_here port 80", etc. > > > Example: > > We restart our servers every so often via crontab in order to > reload modified conf files, etc. However it appears that if > a user has spawned a process from mod_php, cgi, etc. that the > server will not restart until those processes are killed off > manually. > > The worst cases are when badly wrote user scripts allow an > attacker to upload scripts that bind to a port and attempt to > make network access, etc. (I would love to disallow users > from having uploads to the server but > that is not currently an option). > > Does anyone have any suggestion on how to automagically kill > these processes? > > Does anyone have their own favorite recipe for > stopping/starting apache in an automated fashion. > > Right now these situations result in downtime for users and a > pager in the middle of the night to me! I would very much > like to stop this :) > > Thanks much! > > > __ > 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] anyway to do a 'whos online' from session variable?
ok - let me take that a step further - if I store the SID in the table also are the files in the /tmp directory stored with the SID? if they are this may be a way I can delete out inactive session, but be able to allow extended inactive sessions for users who may be pulling lengthy reports... "Timothy Hitchens )" <[EMAIL PROTECTED]> wrote in message 007e01c2b6c4$4612d600$0500a8c0@bambino">news:007e01c2b6c4$4612d600$0500a8c0@bambino... > Arr the garbage collection is based on a probability > (session.gc_probability) and therefore it will clean > up if you get enough hits to the server. Check the documentation for > config of sessions. > > I use db for sessions with a check to ensure db is available. (you can > then cleanup whatever you want) > > > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: [EMAIL PROTECTED] > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 8 January 2003 1:11 PM > > To: Timothy Hitchens (HiTCHO) > > Cc: 'Jeff Bluemel'; [EMAIL PROTECTED] > > Subject: RE: [PHP] anyway to do a 'whos online' from session variable? > > > > > > > > > > On Wed, 8 Jan 2003, Timothy Hitchens (HiTCHO) wrote: > > > > > Hmm... yes you could create an array of the files then > > check the last > > > mod stamp using stat (remember to reset stat). > > > > > > Sessions are also cleaned up via the garbage collection system > > > controlled via php.ini > > > > How do you force garbage collection? I've written an > > application using sessions for storage and there's been a > > session sitting in my /tmp directory for 2 days now, well > > over the 1440 seconds expiration. > > > > Ed > > > > > > > > -- > > 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
RE: [PHP] anyway to do a 'whos online' from session variable?
If you use a database for session management you have total control over when and what is garbage collected and therefore extend / delete whatever anytime you want. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jeff Bluemel [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:24 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] anyway to do a 'whos online' from session variable? > > > ok - let me take that a step further - if I store the SID in > the table also are the files in the /tmp directory stored > with the SID? if they are this may be a way I can delete out > inactive session, but be able to allow extended inactive > sessions for users who may be pulling lengthy reports... > > > "Timothy Hitchens )" <[EMAIL PROTECTED]> wrote in > message 007e01c2b6c4$4612d600$0500a8c0@bambino">news:007e01c2b6c4$4612d600$0500a8c0@bambino... > > Arr the garbage collection is based on a probability > > (session.gc_probability) and therefore it will clean > > up if you get enough hits to the server. Check the > documentation for > > config of sessions. > > > > I use db for sessions with a check to ensure db is > available. (you can > > then cleanup whatever you want) > > > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: [EMAIL PROTECTED] > > > > > -Original Message- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, 8 January 2003 1:11 PM > > > To: Timothy Hitchens (HiTCHO) > > > Cc: 'Jeff Bluemel'; [EMAIL PROTECTED] > > > Subject: RE: [PHP] anyway to do a 'whos online' from session > > > variable? > > > > > > > > > > > > > > > On Wed, 8 Jan 2003, Timothy Hitchens (HiTCHO) wrote: > > > > > > > Hmm... yes you could create an array of the files then > > > check the last > > > > mod stamp using stat (remember to reset stat). > > > > > > > > Sessions are also cleaned up via the garbage collection system > > > > controlled via php.ini > > > > > > How do you force garbage collection? I've written an application > > > using sessions for storage and there's been a session > sitting in my > > > /tmp directory for 2 days now, well over the 1440 seconds > > > expiration. > > > > > > Ed > > > > > > > > > > > > -- > > > 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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put: permission denied
"Timothy Hitchens )" schrieb: > I am assuming you have testing from a desktop client. > > Are you sure that the PHP script has been logged in?? > > Can you see via a log file of the successful authentication?? > I logged in using the same information as I used to upload that script. if ((!$conn_id) || (!$login_result)) { echo "Not logged in"; die; } else { echo "Logged in"; } That script returned Logged in. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put: permission denied
Using ftp_login() ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:30 AM > To: [EMAIL PROTECTED]; Timothy Hitchens ) > Subject: Re: [PHP] ftp_put: permission denied > > > "Timothy Hitchens )" schrieb: > > > I am assuming you have testing from a desktop client. > > > > Are you sure that the PHP script has been logged in?? > > > > Can you see via a log file of the successful authentication?? > > > > I logged in using the same information as I used to upload > that script. > > if ((!$conn_id) || (!$login_result)) { > echo "Not logged in"; > die; > } else { > echo "Logged in"; > } > > That script returned Logged in. > Olli > > > > -- > 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
RE: [PHP] Re: Need a suggestion on developing a php-related system
HI, Thanks for all the suggestions. I guess I should have given a more detail description. My employer have just provided me with some background information of the setup: Our data come in mostly automatically by FTP on to our Vax, then eventually moved on to our R30 (RS6000/AIX) and then H80 (RS6000/AIX). The databases are running on the 2 RS6000's. Although we have numerous scripts processing the data along the route, my employer would prefer to have this system checking independently the situation/condition of the upload. Besides, if the original data processing script crashes before any error message can be sent, we might still don't know if there is a problem. There are files on various machines to look for that indicate the status of the update. So this program may go to look for these signs in order to collect the update status. For making the information available to our staff, the most convenient way for them is via a web page. Although the information is not as confidential as such, it would be nice to be able to password protect the contents. There is also a need for selected staff to manually update certain fields of a record (publication), e.g. Reason for Delay. So the web page should be able to capture manual text input from authorized staff and updated to the status information. Anyways thanks a lot for all your suggestions. All your kind suggestions would help me to have a head start on this project. Kelvin From: "Larry Brown" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Subject: RE: [PHP] Re: Need a suggestion on developing a php-related system Date: Wed, 8 Jan 2003 02:52:11 -0500 From the remark about the arrival and departure time scenario, it sounds like you want to show whether the updates occurred and when they began/ended. If this is accurate, you should find out whether the scripts used to populate those databases record that information for the database it is updating. If so you need to create a script that opens each database and queries that data. If they do not record these things you could either modify them to do so or you could have them also connect to a central db that you create to store this collection of data to show beginning and ending of the scripts. I think either way you should store this in your own db. Is this along the lines of what you had in mind? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 On 01/08/2003 03:40 AM, Kelvin Poon wrote: > HI, I am new to PHP and I am just wondering if anyone could give me some > help. > > I am currently working for infomart.ca, it is basically a company that > sells articles (news/business). MY employer require me to develop a > system using Perl and PHP, and the assignment is as follow: > > To develop a system that collects, stores, processes and disseminates > internally the updating status of our databases. > > We currently have over 200 databases from various daily newspapers, > magazines, TV transcripts and other periodicals. Most of them are > updated every weekday between 4a.m. and 7a.m.. Others are updated on a > weekly or monthly basis. THe update schedule Tv. the actual status need > to be captured and made available to internal staff. This is similar to > the flight departure/arrival information in an airport. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8: advanced junk mail protection and 2 months FREE*. http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put: permission denied
I uploaded that script with a common ftp program on my server in the internet. FOr the host, user and pw, I use the same data as I use to log in with my ftp program. So the mistake can't be there. This is how that script basically works: It didn't work";} else { echo "It did work";} ftp_quit($connection_id);} ?> "Timothy Hitchens )" schrieb: > Using ftp_login() ?? > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: [EMAIL PROTECTED] > > > -Original Message- > > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, 9 January 2003 5:30 AM > > To: [EMAIL PROTECTED]; Timothy Hitchens ) > > Subject: Re: [PHP] ftp_put: permission denied > > > > > > "Timothy Hitchens )" schrieb: > > > > > I am assuming you have testing from a desktop client. > > > > > > Are you sure that the PHP script has been logged in?? > > > > > > Can you see via a log file of the successful authentication?? > > > > > > > I logged in using the same information as I used to upload > > that script. > > > > if ((!$conn_id) || (!$login_result)) { > > echo "Not logged in"; > > die; > > } else { > > echo "Logged in"; > > } > > > > That script returned Logged in. > > Olli > > > > > > > > -- > > 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
RE: [PHP] Adding HTTP URL Code
OK, so I've gotten NO responses to my query below so I thought I'd ask for something slightly different and see what I get. If I have a bunch of plain text data, how can I pull out the strings containing "http". I've tried several different things but what I end up with is more or less than what I want. Once I have this, I can add the URL code and replace the string but I haven't figured out how to do this. For example, what would I do if my text looks like this (not including the astrices): ** This is a test. It is only a test. What happens when I include a URL in my results text? http://not.a.real.url/programs This is only a test ** Anyone? Anyone? Thanks, Katherine -Original Message- From: ELLIOTT,KATHERINE A (HP-FtCollins,ex1) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 2:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Adding HTTP URL Code Hello, I have a string of data that can be anywhere from one line (a single URL) to many, many lines. The data is in plain text but, as I alluded, may contain one or more URLs (or none). I then take this data and put it on a web page so I would like to make any URLs in the data live. Has anyone on the list done this? If so, can you tell me how? I'm stumped. Thanks, Katherine -- 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
[PHP] How can I redirect to another php page
Hi All! I would like to redirect the user to another php page accordingly to his/her chosen options, example: if ($Color == "Yellow") { go to page else if ($Color == "Green") go to page } Does anyone knows how to achieve the goal?? Thanks Teo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Img src
Ezequiel Sapoznik wrote: I am having a parse error in the following sentence: print ""; it would help if you posted the actual error message ! but try this ... print ''; or print ""; -- Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Img src
Hello Sean, or try to use this: print ""; or just print ""; ^ ^^ ^ - use \ before " ^^- no need to use both \ and " remove those two characters or try this your php ?> " width=104 height=137> http://www.corwin.sk PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri." by Douglas Adams Wednesday, January 8, 2003, 8:55:08 PM, you wrote: SB> Ezequiel Sapoznik wrote: >> I am having a parse error in the following sentence: >> >> print ""; >> SB> it would help if you posted the actual error message ! SB> but try this ... SB> print ''; SB> or SB> print ""; SB> -- SB> Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Img src CORRECTION
Hello Sean, oh i must correct myself ;)) . or try to use this: print ""; or just print ""; looks like u have error here: print ""; ^ ^^ ^ - use \ before " ^^- no need to use both \ and " remove those two characters or try this your php ?> " width=104 height=137> http://www.corwin.sk PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri." by Douglas Adams Wednesday, January 8, 2003, 8:55:08 PM, you wrote: SB> Ezequiel Sapoznik wrote: >> I am having a parse error in the following sentence: >> >> print ""; >> SB> it would help if you posted the actual error message ! SB> but try this ... SB> print ''; SB> or SB> print ""; SB> -- SB> Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I redirect to another php page
http://groups.google.com/groups?num=30&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&; q=url+redirect+php -Kevin - Original Message - From: "Teo Petralia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 1:46 PM Subject: [PHP] How can I redirect to another php page > Hi All! > I would like to redirect the user to another php page accordingly to > his/her chosen options, example: > if ($Color == "Yellow") { > go to page > else if ($Color == "Green") > go to page > } > > Does anyone knows how to achieve the goal?? > > Thanks > > Teo > > -- > 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
Re: [PHP] How can I redirect to another php page
You could use an include statement in one of two ways. 1) you can just include the page that you want to show, however the url doesn't change it will still be select.php 2) if you want to sent them to yellow.php or green.php you could include an html page that had a meta-refresh in it set for 0 seconds to move them to the seperate pages. -Original Message- From: Teo Petralia <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Thu, 9 Jan 2003 09:46:30 +1300 Subject: [PHP] How can I redirect to another php page > Hi All! > I would like to redirect the user to another php page accordingly to > his/her chosen options, example: > if ($Color == "Yellow") { > go to page > else if ($Color == "Green") > go to page > } > > Does anyone knows how to achieve the goal?? > > Thanks > > Teo > > -- > 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
Re: [PHP] unlink ($files);
That will usually work on Unix but will not work on Windows. Rather than executing an external program you can use PHP itself to do a recursive delete. There are examples at http://www.php.net/manual/en/function.rmdir.php if you read the user notes you will see several posts about doing this. Jason 2003-01-08 at 07:24, Adam Voigt wrote: > Can't do wildcards like * because thats something that as I found out a > few > days ago, is expanded by the shell into a full command, so because your > not > running a shell, it can't be expanded and the raw unlink call to *.* > fails because > the unlink function doesn't understand wildcards. If you really want to > do a > recursive deletion (i.e., remove both a directory and everything under > it) you > could use: > > exec("/bin/rm -rf path/$name-of-dir-to-be-erased"); > > Just be very sure about what your doing (multiple checks on the > variable's > value to make sure your not erasing anything you don't want to) cause > this > command, when executed with the proper permissions, will kill any > directory > and everything under it. > > On Wed, 2003-01-08 at 00:29, [EMAIL PROTECTED] wrote: > > Ok, Jason, here's another one! > > I think I've read how to delete a file. > I need to delete 25 files, then do a rmdir(blah); > > Line 16: $directory = "path/*.*"; > Warning: Unlink failed (No such file or directory) in > /mnt/ls6/17/169//htdocs/2003/_admin/del_listing_action.php > on line 16 > > Warning: RmDir failed (File exists) in > /mnt/ls6/17/169//htdocs/2003/_admin/del_listing_action.php > on line 17 > > Thanks > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > Adam Voigt ([EMAIL PROTECTED]) > The Cryptocomm Group > My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I redirect to another php page
header("location: nextpage.php"); the above must be sent before any other text is output - Original Message - From: "Teo Petralia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 2:46 PM Subject: [PHP] How can I redirect to another php page Hi All! I would like to redirect the user to another php page accordingly to his/her chosen options, example: if ($Color == "Yellow") { go to page else if ($Color == "Green") go to page } Does anyone knows how to achieve the goal?? Thanks Teo -- 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
Re: [PHP] ftp_put: permission denied
it may be, that destiny is wrong. the error-message tells that you don't have access to where you are trying to upload the file to. Thomas On Wed, 08 Jan 2003 20:59:02 +0100 [EMAIL PROTECTED] (Oliver Witt) wrote: > I uploaded that script with a common ftp program on my server in the > internet. > FOr the host, user and pw, I use the same data as I use to log in with > my ftp program. So the mistake can't be there. > This is how that script basically works: > > if(isset($destiny)){ > $ftp_server = "host"; > $benutzername = "user"; > $passwort = "pw"; > $connection_id = ftp_connect("$ftp_server"); > $login_result = ftp_login($connection_id, "$benutzername", "$passwort"); > > $upload = ftp_put($connection_id, $destiny, $local_file, FTP_ASCII); > if (!$upload) { > echo "It didn't work";} > else { > echo "It did work";} > ftp_quit($connection_id);} > ?> > > > > > > > > > > > > > > > > > > > "Timothy Hitchens )" schrieb: > > > Using ftp_login() ?? > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, 9 January 2003 5:30 AM > > > To: [EMAIL PROTECTED]; Timothy Hitchens ) > > > Subject: Re: [PHP] ftp_put: permission denied > > > > > > > > > "Timothy Hitchens )" schrieb: > > > > > > > I am assuming you have testing from a desktop client. > > > > > > > > Are you sure that the PHP script has been logged in?? > > > > > > > > Can you see via a log file of the successful authentication?? > > > > > > > > > > I logged in using the same information as I used to upload > > > that script. > > > > > > if ((!$conn_id) || (!$login_result)) { > > > echo "Not logged in"; > > > die; > > > } else { > > > echo "Logged in"; > > > } > > > > > > That script returned Logged in. > > > Olli > > > > > > > > > > > > -- > > > 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
Re: [PHP] Adding HTTP URL Code
On Thursday 09 January 2003 04:07, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) wrote: > OK, so I've gotten NO responses to my query below so I > thought I'd ask for something slightly different and see what > I get. With regards to your original query, the answer is in the archives. Try searching for something like "regex url" or "regex hyperlink" etc. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* NOTICE: alloc: /dev/null: filesystem full */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fast template over xsl
hi i am considering the move from fast template to xslt , is there any benifits for this ? also is there a way to intergrate xsl like fast template ie parse rows in the php script -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML email that generates "!"s - any ideas?
Hi everyone, I am new to this list, so this is my first post. I am trying to sen dan HTML email, and so far I got everything running, except for one very odd problem. 1.) I am setting up all my variables within the .php Script. 2.) I generate my HTML email 3.) I am outputting the email to the browser and send it to myself --> Now here comes the problem: In the browseroutput the text looks like I want it to be. In the email however, there are several EXCLAMATION MARKS ("!") added to the code (and therefore the body). How can this happen?? Is there some trick I have missed? The exclamation marks are positioned within the email according to the amaount of characters I submit with the email. I have set up a simple page where you can view the .php file, the output and the email. http://www.gsdh.org/pleasehelp/index.html If anyone of you could spare the time, I would be really gratefull as I have to finish this but am stuck! :( Thans again, Philipp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Adding HTTP URL Code
On Wed, 8 Jan 2003, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) wrote: > OK, so I've gotten NO responses to my query below so I > thought I'd ask for something slightly different and see what > I get. The follow-up inquery makes much more sense than the original ;) > If I have a bunch of plain text data, how can I pull out the > strings containing "http". I've tried several different things > but what I end up with is more or less than what I want. > Once I have this, I can add the URL code and replace the > string but I haven't figured out how to do this. Say that the paragraph you gave is a string in a variable, $TEXT ... $allowedChars = "/:@\w.#~?%+=&!-"; preg_match_all( "{\bhttp:[$allowedChars]+?(?=[$.:?\-]*[^$allowedChars]|$)}x", $TEXT, $URLS ); foreach( $URLS[0] as $link ){ print( "${link}\n" ); } That should get ya started. Read up on regular expressions, and the regexp functions in PHP to make heads & tails out of the code, other than "it works." (So far it works well for my intentionally limited purposes ... I wouldn't be surprised that someone finds a case where my code breaks, or someone can/does easily extend the regexp to grok more stuff.) http://www.oreilly.com/catalog/regex2/ http://www.php.net/manual/en/ref.pcre.php http://www.php.net/manual/en/ref.regex.php g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Double entry into MySQL..
Is this a php.ini or apache setting? "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You should be able to get around it also by checking > if $_SERVER[REQUEST_METHOD]=='HEAD' > > Timothy Hitchens (HiTCHO) wrote: > > >When they first click on the file their browser will make a request for > >type, size etc > >then when it display's the dialog box on the screen of the client it > >will make another > >request to start the download. > > > >I get around this by putting the session id into the database and if it > >is double requested within > >5 seconds to discard. So you will need to do a select, num_rows then if > >below 1 insert. > > > > > >Timothy Hitchens (HiTCHO) > >Open Platform Consulting > >e-mail: [EMAIL PROTECTED] > > > > > > > >>-Original Message- > >>From: Altug Sahin [mailto:[EMAIL PROTECTED]] > >>Sent: Wednesday, 8 January 2003 2:07 PM > >>To: [EMAIL PROTECTED] > >>Subject: [PHP] Re: Double entry into MySQL.. > >> > >> > >>Another strange behaviour... When I send the name of the file > >>to be downloaded to this script, it works (still makes a > >>double entry into MySQL > >>though) with GET method but it doesn't work if the file's > >>name is sent with the POST method. > >> > >>Why? I am pulling my hair out here!!! > >> > >>Please help... > >> > >>Thanks again > >> > >>"Altug Sahin" <[EMAIL PROTECTED]> wrote in message > >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> > >> > >>>Hi here, > >>> > >>> > >>> > >>> > >>I am sending a file to user's browser and logging the downloaded file > >> > >> > >>>into MySQL but everytime this script works, I see double > >>> > >>> > >>entry in the > >> > >> > >>>MySQL table... Why is this happening? > >>> > >>>Any ideas? > >>> > >>>Thanks > >>> > >>> >>> $today = date("Y-m-d"); > >>> > >>> $conn = db_connect(); > >>> > >>> if(!$conn) > >>> echo "Can't connect to database..."; > >>> > >>> $query = "INSERT INTO track_dl (dldate, email, file) > >>>VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')"; > >>> > >>> $result = mysql_query($query); > >>> > >>> if(!$result) > >>> echo "Can't execute query: " . mysql_error(); > >>> > >>>header("Content-type: application/pdf"); readfile("file.pdf"); > >>>exit(); > >>>?> > >>> > >>> > >>> > >>> > >> > >>-- > >>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
[PHP] Submit Form
Hello, I have a question. First of all, I want to save the data a user has typed in a form into a MySQL database so they can load it up for later use but, I need to first submit all the form vars on the current page from a link. This may be _javascript_, but either way, I'm not sure how to do it. Any ideas? Here's a graph kinda... -User enters form and submits the first page --User taken to second form ---User fills out the first two fields User clicks a "Save Progress" link and all form fields submitted (I can do beyond this part but just so you get the idea of what I mean) -PHP saves current form vars to a MySQL database --User told information saved and he leaves ---User comes back next day, clicks load User select his current project -User taken to the last form he was on, fields filled in Thanks,Stephen Cratonhttp://www.melchior.us "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How Do I Return Values Across Servers
This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance. Bill
[PHP] read javascript variable php?????
example: location.href="$destination"; or location.href=""; or echo "location.href='", $destino, "';"; PLEASE GIVE A IDEA Ysrael Guzmán Meza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem (user poll)
Can anyone see a problem in this? When i run the script i am getting this error "Notice: Undefined variable: action in C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" Could not insert poll\n"; } else { print "Poll added\n"; } mysql_close($link); } ?> please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Do I Return Values Across Servers
If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] How Do I Return Values Across Servers > > > This may be a no-brainer for everyone but me but ... I have > several php scripts residing on a web site on Server A. In a > library file on Server A are misc. functions, some of which > query an underlying database and return a text string as the > result. On another web site on Server B I would like to call > these functions to get the result without reinventing the > wheel so to speak. So my question is ... How can I call a > function that returns a text string from Server A in a script > requiring that text during the processing of a web page on > Server B ... all in php? Thanks in advance. > > Bill > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange problem (user poll)
Hello Paul, well problem is this: you don't have defined variable $actionmaybe you are not posting it correctly from form...what is on first 12 lines? try to add $action="value"; on line 12...just define any suitable value... -- Best regards, Martin mail [EMAIL PROTECTED] mobile +421.907.303.393 icq34358414 wwwhttp://www.corwin.sk PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri." by Douglas Adams Wednesday, January 8, 2003, 11:43:12 PM, you wrote: PF> Can anyone see a problem in this? When i run the script i am getting this PF> error "Notice: Undefined variable: action in PF> C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" PF> // addpoll.php PF> // Case Study 1: User Poll - Foundation PHP for Flash PF> // If the form has been submitted... PF> (line 13) if ($action == "add") { PF> // Include config file PF> include('common.php'); PF> // Connect to database PF> $link = dbConnect(); PF> // Get date for new poll PF> $posted = time(); PF> // Build query to insert new poll PF> $query = "INSERT INTO polls (question, option1, option2, option3, PF> posted) PF> VALUES('$question', '$option1', '$option2', '$option3', PF> $posted)"; PF> // Execute query PF> $result = @mysql_query($query); PF> // If query failed... PF> if (!$result) { PF> // Display error PF> print "Could not insert poll\n"; PF> } else { PF> print "Poll added\n"; PF> } PF> mysql_close($link); PF> } ?>> PF> please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] strange problem (user poll)
You need to check like this: if (isset($action) && $action == 'add') AND if it is 4.1 + and global vars are turned off?? if (isset($_GET['action']) && $_GET['action'] == 'add') ** The above will need to changed if it is POST in the above example!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: - [ Paul Ferrie ] - [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:43 AM > To: [EMAIL PROTECTED] > Subject: [PHP] strange problem (user poll) > > > Can anyone see a problem in this? When i run the script i am > getting this error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', > '$option3', $posted)"; > > // Execute query > $result = @mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "Could not insert > poll\n"; > } else { > print "Poll added\n"; > } > > mysql_close($link); > } > ?> > please anyone > > > > -- > 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
RE: [PHP] read javascript variable php?????
location.href="" should work ... hth ... Bill -Original Message- From: Ysrael Guzmán [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:30 PM To: [EMAIL PROTECTED] Subject: [PHP] read javascript variable php? example: location.href="$destination"; or location.href=""; or echo "location.href='", $destino, "';"; PLEASE GIVE A IDEA Ysrael Guzmán Meza -- 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
[PHP] Re: strange problem (user poll)
Sorry guys ingore the post, i have narrowed the problem down to a problem with posting the vairables from flash. cheers "- -" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Can anyone see a problem in this? When i run the script i am getting this > error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', '$option3', > $posted)"; > > // Execute query > $result = @mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "Could not insert poll\n"; > } else { > print "Poll added\n"; > } > > mysql_close($link); > } > ?> > please anyone > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] strange problem (user poll)
[EMAIL PROTECTED] It would help to know where $action is being defined. - Original Message - From: "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 3:43 PM Subject: [PHP] strange problem (user poll) > Can anyone see a problem in this? When i run the script i am getting this > error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', '$option3', > $posted)"; > > // Execute query > $result = @mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "Could not insert poll\n"; > } else { > print "Poll added\n"; > } > > mysql_close($link); > } > ?> > please anyone > > > > -- > 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
Re: [PHP] strange problem (user poll)
I have no idea what I did but this email was not supposed to go to the list.. my apologies. *LOL* -Kevin - Original Message - From: "Kevin Stone" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 08, 2003 4:18 PM Subject: Fw: [PHP] strange problem (user poll) > [EMAIL PROTECTED] > > > > It would help to know where $action is being defined. > - Original Message - > From: "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, January 08, 2003 3:43 PM > Subject: [PHP] strange problem (user poll) > > > > Can anyone see a problem in this? When i run the script i am getting this > > error "Notice: Undefined variable: action in > > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > > > > // addpoll.php > > // Case Study 1: User Poll - Foundation PHP for Flash > > > > // If the form has been submitted... > > (line 13) if ($action == "add") { > > // Include config file > > include('common.php'); > > > > // Connect to database > > $link = dbConnect(); > > > > // Get date for new poll > > $posted = time(); > > > > // Build query to insert new poll > > $query = "INSERT INTO polls (question, option1, option2, option3, > > posted) > > VALUES('$question', '$option1', '$option2', '$option3', > > $posted)"; > > > > // Execute query > > $result = @mysql_query($query); > > > > // If query failed... > > if (!$result) { > > // Display error > > print "Could not insert > poll\n"; > > } else { > > print "Poll added\n"; > > } > > > > mysql_close($link); > > } > > ?> > > please anyone > > > > > > > > -- > > 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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Do I Return Values Across Servers
Yes, I want to get a value from a script on Server A that runs against a database on Server A, returning that value to a script variable on Server B. I read the manual but must have missed something. This is what *seemed* as if it should work: Server A (containing functions and database) qotd.php ** qotd()is a f(x) in miscfuncs.php = Server B test.php ... HTML stuff http://www.servera.com/qotd.php'; echo $qotd . "\n\n"; ?> ... More HTML stuff With this setup I get the following error: Warning: Failed opening 'http://www.servera.com/qotd.php' for inclusion (include_path='.;c:\php4\pear') in c:\webdev\kids\homebody.inc on line 27 Any ideas? I know that I am missing something here. Thanks, Bill -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:45 PM To: 'Bill Arbuckle, Jr.'; [EMAIL PROTECTED] Subject: RE: [PHP] How Do I Return Values Across Servers If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] How Do I Return Values Across Servers > > > This may be a no-brainer for everyone but me but ... I have > several php scripts residing on a web site on Server A. In a > library file on Server A are misc. functions, some of which > query an underlying database and return a text string as the > result. On another web site on Server B I would like to call > these functions to get the result without reinventing the > wheel so to speak. So my question is ... How can I call a > function that returns a text string from Server A in a script > requiring that text during the processing of a web page on > Server B ... all in php? Thanks in advance. > > Bill > -- 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
Re: [PHP] HTML email that generates "!"s - any ideas?
Hi, Thursday, January 9, 2003, 7:31:35 AM, you wrote: PH> Hi everyone, I am new to this list, so this is my first post. PH> I am trying to sen dan HTML email, and so far I got everything running, PH> except for one very odd problem. PH> 1.) I am setting up all my variables within the .php Script. PH> 2.) I generate my HTML email PH> 3.) I am outputting the email to the browser and send it to myself -->> Now here comes the problem: PH> In the browseroutput the text looks like I want it to be. In the email PH> however, PH> there are several EXCLAMATION MARKS ("!") added to the code (and therefore PH> the body). PH> How can this happen?? Is there some trick I have missed? The exclamation PH> marks are PH> positioned within the email according to the amaount of characters I submit PH> with the PH> email. PH> I have set up a simple page where you can view the .php file, the output and PH> the email. PH> http://www.gsdh.org/pleasehelp/index.html PH> If anyone of you could spare the time, I would be really gratefull as I have PH> to finish this but am PH> stuck! :( PH> Thans again, PH> Philipp What happens if you paste the php output directly into your mailer ? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Do I Return Values Across Servers
Issue you have is that if it is on another server you must you a http etc transport to get it!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 9:38 AM > To: Timothy Hitchens (HiTCHO); [EMAIL PROTECTED] > Subject: RE: [PHP] How Do I Return Values Across Servers > > > Yes, I want to get a value from a script on Server A that > runs against a database on Server A, returning that value to > a script variable on Server B. > > I read the manual but must have missed something. This is > what *seemed* as if it should work: > > Server A (containing functions and database) > qotd.php > > requireonce('miscfuncs.php'); > $qotd= qotd(); > ?> > > ** qotd()is a f(x) in miscfuncs.php > > = > Server B > test.php > > ... HTML stuff > > include 'http://www.servera.com/qotd.php'; > echo $qotd . "\n\n"; > ?> > > ... More HTML stuff > > With this setup I get the following error: Warning: Failed > opening 'http://www.servera.com/qotd.php' for inclusion > (include_path='.;c:\php4\pear') in > c:\webdev\kids\homebody.inc on line 27 > > Any ideas? I know that I am missing something here. > > Thanks, > > Bill > > > > -Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 4:45 PM > To: 'Bill Arbuckle, Jr.'; [EMAIL PROTECTED] > Subject: RE: [PHP] How Do I Return Values Across Servers > > > If I understand you want to be able to get a value from a > script on another server. > > Well I would suggest a really each way would be to do have > the calling server call a script on the supplying server > using include(); which is supported but please see this page > regarding URL fopen wrappers: > http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] How Do I Return Values Across Servers > > > This may be a no-brainer for everyone but me but ... I have several > php scripts residing on a web site on Server A. In a library file on > Server A are misc. functions, some of which query an underlying > database and return a text string as the result. On another web site > on Server B I would like to call these functions to get the result > without reinventing the wheel so to speak. So my question is ... How > can I call a function that returns a text string from Server A in a > script requiring that text during the processing of a web page on > Server B ... all in php? Thanks in advance. > > Bill > -- 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