[PHP] Creatng a PHP chatroom

2002-06-12 Thread Phil Powell
I am intrested in creating a chatroom entirely in PHP involving streaming text. Where can someone help me to find such a means of doing so? Thanx Phil http://valsignalandet.com

[PHP] Need to read CGI script in TCL, evaluate and display contents in Safe-Mode

2002-04-16 Thread Phil Powell
The server is UNIX-based server for Linux running PHP in safe mode. I have a CGI script I wrote in TCL, menubar.cgi, that I have to include into a PHP file on the docroot, feedback.phtml. How do I include the CGI script and display the evaluated contents (again, it's in TCL, not PHP not even in

[PHP] PHTML - anyone know anything about this?

2002-04-16 Thread Phil Powell
Anyone out there ever work with .phtml files?? Especially in trying to include CGI scripts into .phtml files? Need some help here if possible Thanx Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Screen Scraping using PHP

2002-04-16 Thread Phil Powell
I am having to do a remote URL screen scrape using PHP in safe-mode. What do you recommend I do? Thanx Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Session Variables

2002-04-16 Thread Phil Powell
I understand the concept of session variables, so I want to know the best methodology of approaching this: 1) HTML redirect to PHP page 2) PHP page looks for session a) If found, show some stuff b) If not found, prompt user for username and password 3) If no session, prompt user for username

[PHP] How do I handle file uploading for several files at one time?

2002-04-18 Thread Phil Powell
Consider this block of code: form enctype=multipart/form-data action=... method=post ... input type=file name=photo1 size=50 input type=file name=photo2 size=50 input type=file name=photo3 size=50 input type=file name=photo4 size=50 input type=file name=photo5 size=50 ... /form In my PHP

[PHP] How to create, name and start PHP sessions

2002-04-18 Thread Phil Powell
Will the following lines set up a session by the name of hasLoggedIn with HTTP_SESSION_VARS[username]? $stuff = session_name(hasLoggedIn); $HTTP_SESSION_VARS[username] = $username; session_start(); I am trying to create a page that sets a session variable upon successful login,

[PHP] Re: How to create, name and start PHP sessions

2002-04-18 Thread Phil Powell
ill work: session_name(hasLoggedIn); $stuff = session_name(); session_start(); $HTTP_SESSION_VARS[username] = $username; Regards, Michael Phil Powell [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Will the following lines set up a ses

[PHP] Re: How to create, name and start PHP sessions

2002-04-18 Thread Phil Powell
ion_name()}. that is why you have to call session_name() BEFORE calling session_start(); Regards Michael Phil Powell [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thanx, however, I cannot retain the session_name when I go to the next URL.

[PHP] Re: How to create, name and start PHP sessions

2002-04-18 Thread Phil Powell
ion_name()}. that is why you have to call session_name() BEFORE calling session_start(); Regards Michael Phil Powell [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thanx, however, I cannot retain the session_name when I go to the next URL.

[PHP] Re: How to create, name and start PHP sessions

2002-04-18 Thread Phil Powell
ing line as the first line of PHP script you execute on every page: ob_start(); Check out http://www.php.net/ob_start for details on what that does. -- Uchendu Nwachukwu newsreply AT unndunn DOT com - www.unndunn.com Phil Powell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]"

[PHP] How long does a session last? Need to have it at 20mins

2002-04-19 Thread Phil Powell
I had thought that a session would last only 20 mins if session.gc_maxlifetime is set at 1440. Was I wrong in assuming this? I have pages that have session_start() at the top to persist the session throughout the life-cycle of these pages, however, I want the session to expire after 20 mins or

[PHP] Using function in PHP script n DOCROOT in PHP script in subfolder

2002-05-10 Thread Phil Powell
? // This function is the PHP version of the TCL proc PRODUCE_MENUBAR which // will produce the menubar for all PHP files // // Syntax: echo PRODUCE_MENUBAR() // function PRODUCE_MENUBAR() { global $HTTP_HOST; $tcl = (preg_match(/\bdyndns\b/i, $HTTP_HOST)) ? tclsh83 : tclsh; $path

Re: [PHP] Using function in PHP script n DOCROOT in PHP script in subfolder

2002-05-11 Thread Phil Powell
Found a MUCH MUCH simpler solution that works across the board.. change $HTTP_HOST to $DOCUMENT_ROOT and it works! Phil Analysis Solutions [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Phil: On Fri, May 10, 2002 at 08:01:46PM -0400, Phil Powe

[PHP] PHP can't access txt files (but TCL can..??)

2002-05-11 Thread Phil Powell
TCL 1, PHP 0 Ok, I am frustrated.. here is my code and this portion has to be done in PHP. I have a frame that can only be accessed if 1 of 2 things occur: 1) if $HTTP_REFERER has a specific value 2) if your nickname passed in the query string is found in the existing nicknames.txt file found

Re: [PHP] PHP can't access txt files (but TCL can..??)

2002-05-11 Thread Phil Powell
Swell, I found the error, and it was a STUPID one.. I misconfigured fread()! Thanx though Phil TCL 1, PHP 2 - Original Message - From: Lars Torben Wilson [EMAIL PROTECTED] To: Phil Powell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, May 11, 2002 6:13 PM Subject: Re: [PHP

[PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell
Ok, I am stuck. I am trying to create a folder in the same directory as process.php and then use move_uploaded_file($FILES['myImage]['tmp_name']) and it constantly fails: mkdir() failed (Permission denied) Here is my code: ? $willChangeLayout = 1; $isEmptyLayoutValues = 1; foreach

Re: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell
); // $path = /users/ppowell/web/my/images/; Warning: Unable to access /users/ppowell/web/my/images/ in /users/ppowell/web/my/process.php on line 27 Phil - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, September 28

Re: [PHP] mkdir() failed: Permission denied

2002-09-28 Thread Phil Powell
mkdir and uploading!! Phil - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, September 28, 2002 7:04 PM Subject: RE: [PHP] mkdir() failed: Permission denied _YOU_ don't need write permissions, the web server

[PHP] Need to get last element of 2-dimensional array

2002-09-28 Thread Phil Powell
The following produced a rather nasty parse error: echo ($idArray[0][sizeof($idArray[0])])); I have a 2-dimensional array $idArray that I must obtain the LAST element of that 2-dimensional array.. how do I do it? Thanx Phil

[PHP] Help! Can't set cookie or redirect!!!

2002-09-28 Thread Phil Powell
I am getting the following errors attempting to set a cookie and redirect: Warning: Cannot add header information - headers already sent by (output started at /users/ppowell/web/my/process.php:5) in /users/ppowell/web/my/process.php on line 76 Warning: Cannot add header information - headers

Re: [PHP] Help! Can't set cookie or redirect!!!

2002-09-28 Thread Phil Powell
code so the cookie is set before any output or use output buffering. ---John Holmes... -Original Message- From: Phil Powell [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 9:03 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Help! Can't set cookie or redirect!!!

Re: [PHP] Help! Can't set cookie or redirect!!!

2002-09-28 Thread Phil Powell
Never mind, I found it.. *sigh* I forgot about phpinfo().. Everything works now, cookies, redirection, everything.. thanx! Phil - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Phil Powell' [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, September

[PHP] fopen have a setTimeout feature?

2002-12-08 Thread Phil Powell
Can you set something like a setTimeout feature in fopen? That is, if you use fopen to open a URL for scraping, if that URL's server is down or doesn't respond in x seconds, can you set a feature to show an error message or a friendly error message indicating such? Thanx Phil

Re: [PHP] fopen have a setTimeout feature?

2002-12-08 Thread Phil Powell
PROTECTED] To: Phil Powell [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 3:10 PM Subject: Re: [PHP] fopen have a setTimeout feature? how about something like... $start = time(); $timeout = 60; // number of seconds to try while (!$file = fopen(...) time

[PHP] Fw: PHP script needs to timeout upon FOPEN to URL

2002-12-13 Thread Phil Powell
- Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 13, 2002 5:13 PM Subject: PHP script needs to timeout upon FOPEN to URL I have the following line: while (!($file = @fopen(http://www.myurl.com;, r)) time() $startTime +

[PHP] Sorry, really stupid question...

2002-12-28 Thread Phil Powell
Honestly, what does this do: $fileID = fopen(nicknames.txt, a) or die(Could not open . $path . /nicknames.txt); chmod(nicknames.txt, 0755); fputs($fileID, $nickname . \n); fflush($fileID); fclose($fileID); What does it EXACTLY do? What I'm trying to do is very very simple: I have the

Re: [PHP] Sorry, really stupid question...

2002-12-28 Thread Phil Powell
rst time $nickname = phil second time $nickname = philbob HTH David On Saturday, December 28, 2002, at 02:24 PM, Phil Powell wrote: Honestly, what does this do: $fileID = fopen(nicknames.txt, a) or die(Could not open . $path . /nicknames.txt); chmod(nicknames.txt, 0755);

[PHP] Warning: 1 is not a valid File-Handle resource - HELP!

2002-12-29 Thread Phil Powell
Ok, I am a bad coder. :( I can't figure this out at all: $fileID = fopen(nicknames.txt, 'r'); $stuff = fread($fileID, filesize(nicknames.txt)); fclose($fileID); if (strlen($stuff) 0) $priorNickNewLine = \n; $nicks = explode(\n, $stuff); The last line produces the Warning.. why?

[PHP] I can't code today to save my life! :(

2003-01-04 Thread Phil Powell
I have $REQUEST_URI that will take two values: /event/login.php and /event/register.php What I need to do is so simple it's brainless!!! I need to look into $REQUEST_URI and find if it contains register.php. I tried this and it completely failed, the results were wrong every time: if

[PHP] Second (Bizarre) Question regarding PHP and ASP

2003-01-04 Thread Phil Powell
I don't know how to post this one so I'm sorry for such bizarre cross-posting, but honestly I don't know where to go for help on this one! I have process.php that has to call a remote file called process.asp on another site. Site 1 has the cookie domain I want (that's where process.php is

[PHP] PHP and empty() if form value is 0

2003-01-04 Thread Phil Powell
foreach ($HTTP_GET_VARS as $key = $val) { if (!empty($HTTP_GET_VARS[$key])) ${$key} = $HTTP_GET_VARS[$key]; } foreach ($HTTP_POST_VARS as $key = $val) { if (!empty($HTTP_POST_VARS[$key])) ${$key} = $HTTP_POST_VARS[$key]; } Whenever the form variable is equal to 0, the value is not

Re: [PHP] PHP and empty() if form value is 0

2003-01-04 Thread Phil Powell
I couldn't think of isset, so I winged it: if (strlen($var) 0) {...} Phil Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Sat, 4 Jan 2003 19:26:02 -0500, you wrote: Whenever the form variable is equal to 0, the value is not passed into the

Re: [PHP] Second (Bizarre) Question regarding PHP and ASP

2003-01-04 Thread Phil Powell
** REPLY SEPARATOR *** On 04/01/2003 at 6:43 PM Phil Powell wrote: I don't know how to post this one so I'm sorry for such bizarre cross-posting, but honestly I don't know where to go for help on this one! I have process.php that has to call a remote file called process.asp on anot

[PHP] XML File does not reflect changes upon reopen - HELP

2003-01-08 Thread Phil Powell
if ($isValid) { $cgi = '/cgi-bin'; if (strpos($HTTP_HOST, 'dyndns') === false) $cgi .= '/cgiwrap/ppowell'; $fileID = fopen(http://$SERVER_NAME$cgi/pollinsert.cgi?pollID=$pollIDanswerID=$answerIDvalIdentifier=; . urlencode($valIdentifier) . lastPollResultsID= .

[PHP] mysql_num_rows() error

2003-01-09 Thread Phil Powell
Anyone know why this is happening? I have mySQL on Win2000 Server with IIS and PHP: mysql_num_rows(): supplied argument is not a valid MySQL result resource Here is my code: ? $conn = mysql_connect('localhost', xxx, yyy) or die('Could not connect to db'); $result =

[PHP] fsockopen() to remote URL: what if remote URL times out?

2003-01-10 Thread Phil Powell
I have a question about the usage of fsockopen() to open and scrape the contents of a remote URL: if the contents take a very long time to load on the remote URL either due to server or coding issues, is there a way for the socket on the PHP end to time out, that is, quit trying to scrape

[PHP] Can someone help me with this code please?

2003-01-15 Thread Phil Powell
Following is the code that will do a remote scrape of http://www3.brinkster.com/soa/val/profile/display.asp (which sometimes goes down), however, it should time out and produce an error after 5 seconds; instead, sometimes, the entire page (http://valsignalandet.com) which includes this script

[PHP] Problems with require() and variables

2003-01-15 Thread Phil Powell
Consider this: I have display.php, a script that will do XML parsing into an array and display its contents. I have view.php, a script that will include display.php and have to manipulate the variables within display.php for itself. So in view.php I have: require('/.../.../display.php');

[PHP] Cannot show reuploaded image file on page unless manual refresh

2003-01-20 Thread Phil Powell
I am using the following header() functions to force view.php to not cache: header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified

[PHP] files no longer upload!

2003-01-20 Thread Phil Powell
I'm having a day, gang! I have done nothing to my code and now is_uploaded_file is constantly false, even when uploading a file every time. I dunno what to do, would someone want to look at my code and tell me what I did wrong; I'm out of ideas. Phil

Re: [PHP] Cannot show reuploaded image file on page unless manual refresh

2003-01-20 Thread Phil Powell
entified by the random number it must request it again from the server. Works great where I need it! Ed On Mon, 20 Jan 2003, Chris Shiflett wrote: --- Phil Powell [EMAIL PROTECTED] wrote: I am using the following header() functions to force view.php to not cache: header(Expires: Mon, 26 Jul

[PHP] Re: Cannot show reuploaded image file on page unless manual refresh

2003-01-20 Thread Phil Powell
question with filetime($filename); that way you will be sure to get a unique argurment. Jim - Original Message - From: [EMAIL PROTECTED] To: Chris Shiflett [EMAIL PROTECTED] Cc: Phil Powell [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, January 20, 2003

[PHP] Fw: I need my PHP script to call a TCL proc

2003-01-21 Thread Phil Powell
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 21, 2003 5:36 PM Subject: I need my PHP script to call a TCL proc From: [EMAIL PROTECTED] (Phil Powell) Newsgroups: comp.lang.tcl,comp.lang.php Subject: I need my PHP script to call a TCL proc

[PHP] How do I find email patterns in a query string in a text and urlescape them?

2003-01-21 Thread Phil Powell
If I have a text of string like this: $stuff = Hi my name is Phil, my email is [EMAIL PROTECTED] and you can find me at http://www.xx.yy?[EMAIL PROTECTED];; What I want to do is to validate all patterns resembling an email address EXCEPT those found within the query string of a URL. I would

[PHP] Problem with xml_parse_into_struct

2003-01-29 Thread Phil Powell
I have various XML files that might contain tags inside the element body, for example: news id=1 shortDescription=Stuff Happened TodayToday on b1/29/03/b, stuff happened/news Because of this I can't use xml_parse_into_struct; when I do this happens: array ( ... [attributes] = array (

[PHP] Need an explanation as to what this line does...

2003-02-01 Thread Phil Powell
$stuffArray[$i][value] = strtr($stuffArray[$i][value], array_flip(get_html_translation_table(HTML_ENTITIES))); To be bluntly honest, I don't understand hardly any of it, and the PHP Manual isn't helping this time.. maybe I'm weekend-stupid or something.. *sigh* Phil

[PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread Phil Powell
I have concluded that Bill Gates is Satan! Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on the hour every day for eternity to go and run a series of Java files I wrote that connect remotely to a remote server to do remote cleanup of stray XML files, etc.; things I

[PHP] What did I do wrong to cause a parse error?

2003-07-10 Thread Phil Powell
foreach ($profileArray[$i][attributes] as $key = $val) { $singleProfileHTML .= $key . =\ . str_replace(', '#039;', str_replace('', 'quot;', $val)) . \\n; } The parsing error occurs in the $singleProfileHTML.. line. I'm completely don't get it; I see absolutely nothing wrong with this,

Re: [PHP] What did I do wrong to cause a parse error?

2003-07-11 Thread Phil Powell
;', stripslashes($val))) . \\n; } $singleProfileHTML .= --\n; Beats the heck out of me! Phil - Original Message - From: David Otton [EMAIL PROTECTED] To: Phil Powell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, July 11, 2003 2:48 AM Subject: Re: [PHP] What did I do wrong

[PHP] Mind exploded on this one!

2003-07-11 Thread Phil Powell
$booleanNonFormVars = array('hasSelectedLetter', 'hasEnteredProfile', 'hasSelectedProfile', 'hasEditedProfile', 'hasDeletedProfile', 'willDeleteProfile', 'willDeletePic'); $booleanVars = array('profileID', 'showemail', 'showbirthday',

[PHP] Reading a PHP-as-CGI script into another PHP script

2002-09-30 Thread Phil Powell
I have the following URL: http://valsignalandet.com/cgi-bin/cgiwrap/ppowell/php4.cgi/~ppowell/my/style.php This is a PHP script that is evaluated and compiled by a CGI script, php4.cgi, to allow for file and directory manipulation w/o having to change file and directory permissions to

[PHP] How do you strip Header Info from displaying on your browser?

2002-10-02 Thread Phil Powell
If you go to http://valsignalandet.com/feedback.php you can get a clearer indication of what I am trying to get rid of. Following is my function using to produce the stuff up there, which I don't want, instead, I either want cookie-driven information or nothing (if no cookie is set):

[PHP] chmod - some files can be viewed, others cannot

2002-10-14 Thread Phil Powell
I have a directory $DOCUMENT_ROOT/my/images, permission 0755 I have three images in my folder with the exact same permissions: 0755; same ownership, same everything. The files, viewed on my machine, are fine too. However, two cannot be seen due to permissions errors; one can be seen. All

[PHP] How to setcookie with two domains

2002-10-14 Thread Phil Powell
Is it possible, w/o using sessionid session variables, to use setcookie to set a cookie that will have two domains or more? Just curious. I am having to set a cookie that will go to one domain and then to another domain. Not sure if I can do multiple setcookie commands and be able to

[PHP] File Write Permission Errors - HELP! URGENT!!!

2002-11-25 Thread Phil Powell
Hi I have the following code that breaks: // PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT $fileID = fopen($path . /nicknames.txt, a) or die(Could not open . $path . /nicknames.txt); chmod($path . /nicknames.txt, 0755); fputs($fileID, $nickname . \n); fflush($fileID);

[PHP] Re: File Write Permission Errors - HELP! URGENT!!!

2002-11-25 Thread Phil Powell
other folders with the same permissions as /chat. Phil Craig [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... you must give the same permissions to the folder also. Phil Powell [EMAIL PROTECTED] wrote in message 0ca201c2947e$44690a80$dcbe6444@scandi

[PHP] How to override header info in mail()

2002-11-30 Thread Phil Powell
I am using this line: if (!mail($to, $subject, $body, From: . $from . ; . header(Content-type . $contentType))) {..} to use the mail() function in PHP to send simple text/plain or text/html email. However, upon attempting to send I get a warning message indicating that header information