Re: [PHP] Re: Search a flat file.
If the file is of a reasonable size (not hundreds of kilobytes), then you can just slurp it all into an array and foreach through it: $matched = 0; $myfile = file('/usr/home/crud/myfile'); foreach ($myfile as $line) { $split_line = explode(':', $line); if ($split_line[1] == 'bob') { echo 'pGot a match!/p'; $matched = 1; break; } } if (!$matched) echo 'pUsername not found./p'; If it's larger, you're doing it an awful lot, or your server is resource-cramped, you'd probably want to fopen() it and loop over fgets() so you don't have to read in any more than necessary. miguel On Fri, 7 Jun 2002, Tom Ray wrote: ok I believe I follow you on that, I will give that a try. But the question I have now is how do I loop that request? Gaylen Fraley wrote: Use the explode() function based on the colon. Then parse the 2nd array element for the username that you want. If matched, display all elements in that array row. Conversely you could use the implode() to reassemble the array row. (Assume $file_row is the row name that you have assigned) /* your code to loop through the file goes here */ $your_array = explode(:,$file_row); /* remember that arrays start with element 0 */ if ($your_array[1]) == some name { /* routine to display entire row */ } /* continue processing loop */ -- Gaylen PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Tom Ray [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I want to be able to search a flat file line by line looking for data such as a username then display all the information in that line. Is there some way to search the following format: record1:username:info:info:info record2:username:info:info:info record3:username:info:info:info So if someone submits the username in record two for the search I want it to stop at record two and then display that information... any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions and Forms
What is the best/recommended method of saving form data into session variables? Currently only have to deal with regular text input, checkboxes and radio buttons (no multiple selects for now). Any sample code someone could throw up on the list? I've only recently begun working with sessions, but I'm interested to see what I can do with them. Any sort of direction on this would be appreciated. Thanks! - Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Forms
On Saturday 08 June 2002 14:39, Greg Macek wrote: What is the best/recommended method of saving form data into session variables? Currently only have to deal with regular text input, checkboxes and radio buttons (no multiple selects for now). Any sample code someone could throw up on the list? I've only recently begun working with sessions, but I'm interested to see what I can do with them. Any sort of direction on this would be appreciated. Thanks! What I do is try to put all the form elements into a single array. That way you'll only have a single variable to worry about. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Future looks spotty. You will spill soup in late evening. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Forms
Ok, I'll have to try that on my next project. Unfortunately these forms were written by another developer and there too many variables to rename to make an array and not enough time on the project :-) But for next time. I've seen many examples of assigning values to session variables w/o forms on the list and online. Now should I look to set those values on the next page in the sequence of forms that the user is entering? page1.php ?php session_start(); *** session_register(test_var);*** // Is this ok? ? form action=page2.php input type=text name=test_var/input input type=submit /form page2.php ?php session_start(); *** $_SESSION[test_var] = $test_var; *** // Or is this ok? // or $HTTP_SESSION_VARS[test_var] = $test_var on =4.0.6 ? ... (rest of page here) Which of the two lines is more failsafe in terms of working every time? Jason Wong wrote: On Saturday 08 June 2002 14:39, Greg Macek wrote: What is the best/recommended method of saving form data into session variables? Currently only have to deal with regular text input, checkboxes and radio buttons (no multiple selects for now). Any sample code someone could throw up on the list? I've only recently begun working with sessions, but I'm interested to see what I can do with them. Any sort of direction on this would be appreciated. Thanks! What I do is try to put all the form elements into a single array. That way you'll only have a single variable to worry about. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting files
When you say serve the files through a script, I assume you mean download.php force-feeds an MP3 (or whatever) to the browser. Is this correct? I read people have lots of problems with this... Justin on 08/06/02 4:08 PM, Jason Wong ([EMAIL PROTECTED]) wrote: On Saturday 08 June 2002 13:46, Justin French wrote: MP3 and quick time -- otherwise the solution would be easy :) Thanks, Justin on 08/06/02 3:42 PM, Jason Wong ([EMAIL PROTECTED]) wrote: On Saturday 08 June 2002 09:19, Justin French wrote: Hi, I wish to restrict access to a dir of files, depending on if the user is a logged in and validated member. What kind of files are they? html? php? or others? The quick answer is, store the files outside of the website's DOCUMENTROOT, then serve the files through a script (which naturally checks whether the user is logged in). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] disabled cookies and sessions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Chris Sechiatano declared You have to code the PHPSESSID into your URL if your browser has cookies disabled or else it won't work. No. As I said, i have php compiled with --enable-trans-sid - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9AbANHpvrrTa6L5oRAr7xAKCygTDnlygZpepWQf1iwojVzld2LgCcCllO QGC9nkE6Gb7NLL6V9IzzcTg= =U8TD -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Forms
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Greg Macek declared Ok, I'll have to try that on my next project. Unfortunately these forms were written by another developer and there too many variables to rename How about something like this: foreach($HTTP_POST_VARS as $key = $val) { $myFormData['$key']=$val; } Then you just register the $myFormData and it will be available to you whenever you need it. - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9AbEvHpvrrTa6L5oRAirPAJ9HylqSk9NBsNsTjjRZZ2fBHN3K3QCdGzdS t6yXIWhWu76VxfGkpQp6JdI= =uZMW -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Forms
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Nick Wilson declared How about something like this: foreach($HTTP_POST_VARS as $key = $val) { $myFormData['$key']=$val; } Actually that may be a little redundent. You may well get away with: $myFormData=$HTTP_POST_VARS; - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9AbHmHpvrrTa6L5oRAnYDAJ97cMzKPwdp42y+G7KiixEAavdFYACdEOlP bBSkoamAv10hHnDAmrVfiBk= =NHHQ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting files
On Sat, 8 Jun 2002, Justin French wrote: When you say serve the files through a script, I assume you mean download.php force-feeds an MP3 (or whatever) to the browser. Is this correct? I read people have lots of problems with this... Only until they get it working (I should hope). We use it for many, many sites and I can't think of any problems it's caused. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] e-commerce example
I'm looking for e-commerce example (PHP+MySQL) so I don't start from zero and save some time. Does somebody knows something about? Thanks Makis Savaidis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] e-commerce example
www.google.com / www.freshmeat.net Kind Regards, Chris Knipe MegaLAN Corporate Networking Services Tel: +27 21 854 7064 Cell: +27 72 434 7582 - Original Message - From: savaidis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 08, 2002 5:59 AM Subject: [PHP] e-commerce example I'm looking for e-commerce example (PHP+MySQL) so I don't start from zero and save some time. Does somebody knows something about? Thanks Makis Savaidis -- 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] e-commerce example
try this link http://www.devshed.com/Server_Side/PHP/Commerce -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: June 7, 2002 11:59 PM To: [EMAIL PROTECTED] Subject: [PHP] e-commerce example I'm looking for e-commerce example (PHP+MySQL) so I don't start from zero and save some time. Does somebody knows something about? Thanks Makis Savaidis -- 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] ssl security question
I have made a file wich start a session and set a session variable if user and pass are verifyed. Than I use the session variable to protect all other userfiles. To run the file I enter: http://myserver.com/start.php3?user=xpass=yy What is the differans using SSL and enter the same url? If a hacker sniff the ssl-string can he send that string and start the file anyway? -- Regards, Jan Grafström Sweden -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: Too many connections in xxx on line xx
Is there anyway to get rid of this message: Warning: Too many connections in xxx on line xx line xx is a connection to a mysql database. In PHP.ini I have: [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. mysql.max_links = -1 Can anyone suggest what I can do to get rid of this error? I am running on a Dell PowerEdge 350 with the max of 1GB of memory running RH7.2, php 4.1.1, and mysql 3.23.49a. Thanks. Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Too many connections in xxx on line xx
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Dan Morris declared Is there anyway to get rid of this message: Warning: Too many connections in xxx on line xx Can you show the code that connects? - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9AdECHpvrrTa6L5oRAmUkAJ0S/N7E8ifYqP4bm6mb38wWoZqJ+gCfRPVp dxNJezvEs5aav5Yw814axIE= =QH6x -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Not php related - php.net logo in Netscape 7?
Timothy J. Luoma wrote: Oh, I forgot to mention that it is a different way of indicating that a favicon to be used, which is found in the HEAD of the HTML document. link rel=shortcut icon href=/favicon.ico / This works in browsers other than IE, but I don't think that IE supports this See http://www.favicon.com/ for some good information on favicons. -- Mark Gallagher http://cyberfuddle.com/infinitebabble/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sablotron broken in 4.2.1 ?
Thank you for the feedback. Sablotron is running fine now. Just had to do some modifications with my *.xsl file. Here is what I have going now with the implementation: http://213.84.71.105/ On Tue, Jun 04, 2002 at 10:57:45AM +1000, Tom Rogers wrote: hi I am using 4.2.1 and it works fine, I can't see your source code as web servers don't show it by design :) But from the error message it can't find your class file. I used the code below to test it. Tom $xsltproc = xslt_create(); $html = xslt_process($xsltproc, 'news.xml', 'news.xsl'); if (!$html) die('XSLT processing error: '.xslt_error($xsltproc)); xslt_free($xsltproc); echo $html; snip -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] invalid path
My OS is XP Pro. I installed my web folders in c:\web instead of c:\apache\htdocs My php folder is: c:/php In the httpd.conf: DocumentRoot /web/myweb ScriptAlias /php/ c:/php/ AddType application/x-httpd-php .php Action application/x-httpd-php /php/php.exe In my Php.ini: include_path = c:/web/myweb/ezp/ My ez Publish folder is c:/web/myweb/ezp Error text in browser is: Warning: fopen(c:/web/myweb/php/php.exe/ezp/error.log,a) - No such file or directory in classes/ezfile.php on line 282 Log file could not be opened. Error: /php/php.exe is inserted unexpectly.. What's wrong with my php?
[PHP] not so
[0] would match the whole ip, I was hoping [1] and[2] would echo the next 2 found, but it doesn't Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Storing mysql result into a pointer (or something)
I am trying to store several results from an mysql_query into an int I want to produce several lines into $result, so i can include $result Into my email, or is there a better way to do this ? $query = mysql_query(select * from $table); $number = mysql_numrows($query) ; $i = 0; while ($i $number) { $id = mysql_result($query,$i,id); $Name = mysql_result($query,$i,Name); ## WHAT MUST I DO HERE ??? ## $i++; } Echo $result; I will use the result to send an email $FromName = $Name; $FromAddress = $Email; $ToAdress = $ToAdress; $message = 'bbr $result '; mail($ToAdress. .$ToAdress., $Subject, $message, From: .$FromName. .$FromAddress.\nContent-Type: text/html; charset=iso-8859-1); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Storing mysql result into a pointer (or something)
I am trying to store several results from an mysql_query into an int I want to produce several lines into $result, so i can include $result Into my email, or is there a better way to do this ? $query = mysql_query(select * from $table); $number = mysql_numrows($query) ; $i = 0; while ($i $number) { $id = mysql_result($query,$i,id); $Name = mysql_result($query,$i,Name); ## WHAT MUST I DO HERE ??? ## $i++; } Echo $result; I will use the result to send an email $FromName = $Name; $FromAddress = $Email; $ToAdress = $ToAdress; $message = 'bbr $result '; mail($ToAdress. .$ToAdress., $Subject, $message, From: .$FromName. .$FromAddress.\nContent-Type: text/html; charset=iso-8859-1); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] not so
On Saturday 08 June 2002 22:36, Rob Packer wrote: [0] would match the whole ip, I was hoping [1] and[2] would echo the next 2 found, but it doesn't 1) Could you not start a new thread each time? It makes it difficult for people to help because your responses and their repsonses are all over the place. And a subject which matches the discussion in hand would be appreciated. When people search through the archives and come across a thread named not so, what on earth are they supposed to make of that? 2) I asked you to show the format of your input file. Without knowing what it looks like there's not much anyone can do to help you. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Memory fault -- core...uh...um...core... Oh dammit, I forget! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] disabled cookies and sessions
Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Chris Sechiatano declared You have to code the PHPSESSID into your URL if your browser has cookies disabled or else it won't work. No. As I said, i have php compiled with --enable-trans-sid Php session work differently from PHPLIB. PHPLIB will generate a session, if no cookie and no SID in URL is found, then append it to the URL and redirect you there. In this situation, phplib used to accept and adopt any SID in the url, if there was one. Now no more: phplib will accept a session in the url only if it exists. PHP session don't quite work the same. if no cookie nor SID in url, you have to provide it in the URL, and it will be the session. In fact, if you provide it in the url, it will adopt it and create it even if you have cookies enabled! Great feature for spies. Gian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Storing mysql result into a pointer (or something)
On Saturday 08 June 2002 19:42, Bård Tommy Nilsen wrote: I am trying to store several results from an mysql_query into an int I want to produce several lines into $result, so i can include $result Into my email, or is there a better way to do this ? $query = mysql_query(select * from $table); $number = mysql_numrows($query) ; $i = 0; while ($i $number) { $id = mysql_result($query,$i,id); $Name = mysql_result($query,$i,Name); ## WHAT MUST I DO HERE ??? ## $i++; } The above can be rewritten as: $query = mysql_query(select * from $table); while ($row = mysql_fetch_array($query)) { $id = $row('id'); $Name = $row('Name'); $result .= $id $Namebr; } Salt and pepper to taste. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If you see an onion ring -- answer it! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] not so
oops, no coffee yet Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Saturday 08 June 2002 22:36, Rob Packer wrote: [0] would match the whole ip, I was hoping [1] and[2] would echo the next 2 found, but it doesn't 1) Could you not start a new thread each time? It makes it difficult for people to help because your responses and their repsonses are all over the place. And a subject which matches the discussion in hand would be appreciated. When people search through the archives and come across a thread named not so, what on earth are they supposed to make of that? 2) I asked you to show the format of your input file. Without knowing what it looks like there's not much anyone can do to help you. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Memory fault -- core...uh...um...core... Oh dammit, I forget! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suggestions for getting started with poll app.
I want to build my own poll(The ones availble from sites such as hotscripts.com are not quite what I need) Could any one tell me of a *good* tutorial? Particularly the number of questions would be different between each poll not a fixed number. JJ Harrison[EMAIL PROTECTED]www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Javascript PHP cookies
Is it possible to read cookies from javascript written by PHP and vice-versa? Just out of curiousity JJ Harrison[EMAIL PROTECTED]www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] NOTICE MOZILLA BEHAVIOUR 2 PHPMYSQLADMIN?
Did u notice and problems when you are accessing the mysql server using mozilla ?? I am in a 1.53Mhz amd and the CPU usage goes to the max when use phpmyadmin.. ?? while in IE everything is fine.. Did I missed any previews post ? -- Sapilas/dev/pinkeye -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 8 Jun 2002 14:10:08 -0000 Issue 1393
php-general Digest 8 Jun 2002 14:10:08 - Issue 1393 Topics (messages 101231 through 101273): Re: Form Variables 101231 by: Beeman Not php related - php.net logo in Netscape 7? 101232 by: Leif K-Brooks 101233 by: Timothy J. Luoma 101234 by: Stuart Dallas 101239 by: Timothy J. Luoma 101261 by: Mark Gallagher Search a flat file. 101235 by: Tom Ray 101236 by: Gaylen Fraley 101237 by: Tom Ray 101246 by: Miguel Cruz CONVERT 101238 by: sonjaya 101241 by: Justin French Re: PHP 4.0.6 file upload problems? 101240 by: Edward Marczak Re: eregi not working 101242 by: Jason Wong Re: restricting files 101243 by: Jason Wong 101244 by: Justin French 101245 by: Jason Wong 101250 by: Justin French 101254 by: Miguel Cruz Sessions and Forms 101247 by: Greg Macek 101248 by: Jason Wong 101249 by: Greg Macek 101252 by: Nick Wilson 101253 by: Nick Wilson Re: disabled cookies and sessions 101251 by: Nick Wilson 101268 by: Giancarlo Pinerolo e-commerce example 101255 by: savaidis 101256 by: Chris Knipe 101257 by: SP ssl security question 101258 by: Jan Grafström Warning: Too many connections in xxx on line xx 101259 by: Dan Morris 101260 by: Nick Wilson Re: Sablotron broken in 4.2.1 ? 101262 by: William S. invalid path 101263 by: Webmaster not so 101264 by: Rob Packer 101267 by: Jason Wong 101270 by: Rob Packer Storing mysql result into a pointer (or something) 101265 by: Bård Tommy Nilsen 101266 by: Bård Tommy Nilsen 101269 by: Jason Wong Suggestions for getting started with poll app. 101271 by: webmaster.tececo.com Javascript PHP cookies 101272 by: webmaster.tececo.com NOTICE MOZILLA BEHAVIOUR 2 PHPMYSQLADMIN? 101273 by: Septic Flesh Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- You are correct. My web server is Running 4.2.1 and all of the sites are still working.. That is why I assumed that it was a problem locally, but after looking at the web server the globals is turned on. Thanks.. I can go forward now. I appreciate your help On 6/7/02 9:33 PM, Philip Olson [EMAIL PROTECTED] wrote: Actually, they are. You are assuming the PHP directive register_globals = on when using $phrase from the form below. register_globals = on is what creates $phrase. As of PHP 4.2.0 the default value for register_globals has become off. Regardless, there are other options: Try either: // Worked since PHP 3 (forever) print $HTTP_GET_VARS['phrase']; // Worked since PHP 4.1.0 print $_GET['phrase']; print $_REQUEST['phrase']; // Worked since PHP 4.1.0 too // See docs for details (see also extract()) import_request_variables('gpc', 'r_'); print $r_phrase; Those are some options. See also: http://www.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson On Fri, 7 Jun 2002, Beeman wrote: I just read the release notes and do not believe they are referring to my dilemma. Here is the code I am using. Just a basic form Form.php body form action=form_act.php method=get enctype=multipart/form-data pPhrase: input name=phrase type=text id=phrase /p input name=Submit type=submit value=Submit /form /body Form_act.php ? if ($phrase){ echo Phrase-- $phrase;} Else{ echo No Variables;} ? On 6/7/02 9:08 PM, Stuart Dallas [EMAIL PROTECTED] wrote: On Saturday, June 8, 2002 at 1:56:35 AM, you wrote: I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running Apache 1.3.2. I have verified that php is running and apache is running. When I access a page locally http://127.0.0.1/simple_form.php, fill in the only text box and submit the form to form_act.php. The variable doesn't exist (as far as PHP is concerned. I have tested for its existance using an IF ELSE). This happens with POST as well as GET, but when using GET I can obviously see the variable name and value in the URL. Do I need to change the default config for apache?? Or PHP? Can anyone please help before I go completely crazy. Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you are trying to use the latter, I suggest you read the release note for the software you just installed: http://www.php.net/release_4_2_1.php (specifically the 'External Variables' section). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- I am using Netscape 7
[PHP] Reading from a dir.
Is there another way to read the files from a directory? I tried the following: foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } but get an error whether safe mode is on or off. I'm just learning as you might guess. -- Steve Mallett http://OSDir.com - Stable, Open Source Apps [EMAIL PROTECTED] | [EMAIL PROTECTED] http://open5ource.net personal | With new, all powerful, blogging action! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading from a dir.
Try... ? //$dirname should contain the directory name including it's full path... $handle=opendir($dirname); while ($file = readdir($handle)){ echo($file is located in the $dirname directory); } ? HTH, Dw. Sqlcoders.com Dynamic data driven web solutions - Original Message - From: Steven Mallett [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: June 08 2002 07:23 AM Subject: [PHP] Reading from a dir. Is there another way to read the files from a directory? I tried the following: foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } but get an error whether safe mode is on or off. I'm just learning as you might guess. -- Steve Mallett http://OSDir.com - Stable, Open Source Apps [EMAIL PROTECTED] | [EMAIL PROTECTED] http://open5ource.net personal | With new, all powerful, blogging action! -- 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] Reading from a dir.
On Saturday, June 8, 2002 at 3:23:01 PM, you wrote: Is there another way to read the files from a directory? http://www.php.net/readdir -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What are pros and cons of the Apache module verses cgi version?
I notice that some webhosts offer the apache module and some the cgi. On the surface, the cgi version appears to be a lot of extra hassle. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing ^M
I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing ^M
You could replace if by ASCII code (^M is actually a representation of ASCII 013, the CR character, thanks to http://www.mindspring.com/~jc1/serial/Resources/ASCII.html for the ASCII lookup table.). This should fix it (untested) ? $chrnumber = 13; //this is the ascii code for ^M $nicestring = str_replace(chr($chrnumber),(removed M was here),$badstring); echo($nicestring); ? where $nicestring is the output, $chrnumber contains the ascii code for ^M, and the input (original) string is $badstring. Sqlcoders.com Dynamic data driven web solutions - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: June 08 2002 05:40 PM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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] Include + $Variables Help
Here's my problem: I'm trying to make a simple publication of 30+ articles, using PHP but not MySQL. There are basically three components: - a table of contents (contents.html) - an article template (article.php) - and then 30+ text files. The idea I was going for was to make dynamic links in contents.html that would pass a variable to article.php. The article page then uses that variable in an include( ). Does this make sense? I.e.- ## contents.html a href=article.php?auth=nameText Link/a ## article.php # The link above would then pass the $auth variable as 'name', right? # Is that enough? ?php include($auth.txt); ? # I then assume this would result in it trying to include 'name.txt', # but instead there is always a nasty error about the .txt part. # I should probably ask, is passing variables inside an include allowed? If I'm wrong, or I'm just missing something that needs to be added, please let me know. I'm sooo new at this that I know I'm doing something wrong and it is probably very simple. Any help would be greatly appreciated! Thanks in advance. SB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.0.6 file upload problems?
Thanks for taking the time to answer. As I said, there is no problem with the code in either OPT or in phpMyAdmin - there is a problem with PHP and I was hoping someone on this list bounced into the same kind of problem. Bogdan Edward Marczak wrote: On 6/7/02 11:43 AM, Bogdan Stancescu [EMAIL PROTECTED] wrote: One of the users of OPT has major problems uploading files to the system and I have absolutely no clue why that is. His PHP version is 4.0.6 on Linux. Quoting his description of the problem: In fact, now it doesn't even report an error. It just takes some time (about 30 seconds) trying to upload, I guess. The progress bar in the bottom of MSIE 6.0 shows it doing something, but then it 'finishes', while still showing the page with the 'Add a new document' form. I know, your first thought is that OPT has a problem - but here's another report from the same user when I directed him to alter some stuff in a MySQL database: By pasting it into the 'query' window in phpMyAdmin, but I was surprised by the result. Instead of an error or successful result from phpMyAdmin, I got a browser error from MSIE: 'This page cannot be displayed' I have absolutely no idea why this happens - when he sent the first report, I started thinking it may have been some php.ini setting regarding uploads, but I was completely confused by the second report. Did anyone encounter this? Is it a PHP bug? Is it a setting? Well, you could post the code you're tryingbut as I found out recently while learning this, if a file is bigger than max file size, $_FILES['name'] will have 'none' and $_FILES['size'] will be 0. (I thinks that's $HTTP_POST_FILES under 4.0.6). Check thatOtherwise, we need more info about what 'is not working'. (Not sure what query you're checking in phpMyAdmin...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include + $Variables Help
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Steven declared # Is that enough? ?php include($auth.txt); ? # I then assume this would result in it trying to include 'name.txt', # but instead there is always a nasty error about the .txt part. # I should probably ask, is passing variables inside an include allowed? If I'm wrong, or I'm just missing something that needs to be added, please let me know. I'm sooo new at this that I know I'm doing something wrong and it is probably very simple. Any help would be greatly appreciated! Can you show an example of name.txt and the error you get? I'm guessing but I reckon name.txt should be re written as name.php and work like this: ? // name.php $text=EOF p some nice aritcles text marked up here/p EOF; ? and then in articles.php you should just print $text to where you want it. - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9Ah/3HpvrrTa6L5oRAk+iAKCx1lmVO6ZTuzyvyKDYxROcwzK9IgCfaTPS qtvhmbP4oWg85jueAtfMOIM= =Bdlq -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include + $Variables Help
Hello Steven, Saturday, June 08, 2002, 5:40:40 PM, you wrote: S Here's my problem: S I'm trying to make a simple publication of 30+ articles, using PHP but not S MySQL. S There are basically three components: S - a table of contents (contents.html) S - an article template (article.php) S - and then 30+ text files. S The idea I was going for was to make dynamic links in contents.html that S would pass a variable to article.php. The article page then uses that S variable in an include( ). Does this make sense? I.e.- S ## contents.html S a href=article.php?auth=nameText Link/a S ## article.php S # The link above would then pass the $auth variable as 'name', right? S # Is that enough? S ?php include($auth.txt); ? S # I then assume this would result in it trying to include 'name.txt', S # but instead there is always a nasty error about the .txt part. S # I should probably ask, is passing variables inside an include allowed? S If I'm wrong, or I'm just missing something that needs to be added, please S let me know. I'm sooo new at this that I know I'm doing something wrong and S it is probably very simple. Any help would be greatly appreciated! What a nasty error? And did you try the following ?php include($_GET['auth']..txt);? ? -- Best regards, Olexandrmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Making code execute on fatal error?
I want to make all fatal errors trigger an error file to be include, the file to exit, and the error never t be displayed. Is there any way to do this without access to php.ini? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Too many connections in xxx on line xx
It's nothing to do with PHP. Raise your max_connections in your MySQL configuration file... ---John Holmes... -Original Message- From: Dan Morris [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 08, 2002 4:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Warning: Too many connections in xxx on line xx Is there anyway to get rid of this message: Warning: Too many connections in xxx on line xx line xx is a connection to a mysql database. In PHP.ini I have: [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. mysql.max_links = -1 Can anyone suggest what I can do to get rid of this error? I am running on a Dell PowerEdge 350 with the max of 1GB of memory running RH7.2, php 4.1.1, and mysql 3.23.49a. Thanks. Dan -- 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] Making code execute on fatal error?
I want to make all fatal errors trigger an error file to be include, the file to exit, and the error never t be displayed. Is there any way to do this without access to php.ini? Implement your own error handler. There is a load of documentation in the manual. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ssl security question
Jan grafström [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have made a file wich start a session and set a session variable if user and pass are verifyed. Than I use the session variable to protect all other userfiles. To run the file I enter: http://myserver.com/start.php3?user=xpass=yy What is the differans using SSL and enter the same url? If a hacker sniff the ssl-string can he send that string and start the file anyway? SSL connections are inherently encrypted. The encryption is done in such a manner that makes a 'record/playback' attack impossible, as the key used to encrypt things with changes. I don't recall the exact specifics right off-hand but any good resource on SSL will explain it. SSL is completely encrypted, right down to everything sent over the wire. If someone was sniffing they'd just see a bunch of random garbage that would do them very little use. However, displaying the username and password as part of the URL (GET method) is a security risk in the sense that many browsers will keep it in their history and thus someone with access to the history can determine their username/password. POST would really be a better method to use here in this case. -- Daniel Grace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Search a flat file.
Be warned that explode won't work as expected if any of your fields contain colons, though it doesn't look like it'll be an issue in this sort of case. Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Use the explode() function based on the colon. Then parse the 2nd array element for the username that you want. If matched, display all elements in that array row. Conversely you could use the implode() to reassemble the array row. [...] Tom Ray [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I want to be able to search a flat file line by line looking for data such as a username then display all the information in that line. Is there some way to search the following format: record1:username:info:info:info record2:username:info:info:info record3:username:info:info:info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Making code execute on fatal error?
Thanks. I am trying, but it refuses to work. Can you help? My code is: function error_handler ($code, $str) { if(($errno == FATAL) (error_reporting() != 0)){ //include the error file exit; } } set_error_handler(error_handler); //set_error_handler returns false. When I test it, the default error is displayed. Dan Hardiker wrote: I want to make all fatal errors trigger an error file to be include, the file to exit, and the error never t be displayed. Is there any way to do this without access to php.ini? Implement your own error handler. There is a load of documentation in the manual.
Re: [PHP] Removing ^M
On Sun, 9 Jun 2002, Michael Hall wrote: I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? $str = str_replace(\r, '', $str); miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What are pros and cons of the Apache module verses cgiversion?
On Sat, 8 Jun 2002, Al wrote: I notice that some webhosts offer the apache module and some the cgi. On the surface, the cgi version appears to be a lot of extra hassle. The Apache module runs faster and has smoother integration with the web server. The CGI version allows you to run in different uid contexts, so that users on a shared/multiuser system can be prevented from seeing and messing with each other's files. There are scads of differences, but these seem to be the most salient for most people. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing ^M
Perl apparently also works very nice for this open (FILE, filename): open (NEWFILE, filename); WHILE (FILE) { chomp; print NEWFILE $_ } close (FILE); close(NEWFILE); this should take care of ^M Kind Regards, Chris Knipe MegaLAN Corporate Networking Services Tel: +27 21 854 7064 Cell: +27 72 434 7582 - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, June 09, 2002 2:40 AM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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] Warning: Too many connections in xxx on line xx
The error message is coming from the connect line in: function MOpen() { global $db_address, $db_username, $db_password, $link; $link = mysql_connect($db_address,$db_username,$db_password); } Nick Wilson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Dan Morris declared Is there anyway to get rid of this message: Warning: Too many connections in xxx on line xx Can you show the code that connects? - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9AdECHpvrrTa6L5oRAmUkAJ0S/N7E8ifYqP4bm6mb38wWoZqJ+gCfRPVp dxNJezvEs5aav5Yw814axIE= =QH6x -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing ^M
'chomp' removes the end-of-line character(s) from its input, which is different from doing an EOL conversion (which is what the OP was after). The result of the below perl would be to concatenate all lines together as one. miguel On Sat, 8 Jun 2002, Chris Knipe wrote: Perl apparently also works very nice for this open (FILE, filename): open (NEWFILE, filename); WHILE (FILE) { chomp; print NEWFILE $_ } close (FILE); close(NEWFILE); this should take care of ^M Kind Regards, Chris Knipe MegaLAN Corporate Networking Services Tel: +27 21 854 7064 Cell: +27 72 434 7582 - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, June 09, 2002 2:40 AM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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] Removing ^M
print NEWFILE $_ . \n; Then :P This isn't a perl list, it's off topic. Just thought it might help if I added this to the pool Let's rather not go into a in depth discussion about it... I'm no perl guru either. Kind Regards, Chris Knipe MegaLAN Corporate Networking Services Tel: +27 21 854 7064 Cell: +27 72 434 7582 - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: Chris Knipe [EMAIL PROTECTED] Cc: PHP List [EMAIL PROTECTED] Sent: Saturday, June 08, 2002 7:51 PM Subject: Re: [PHP] Removing ^M 'chomp' removes the end-of-line character(s) from its input, which is different from doing an EOL conversion (which is what the OP was after). The result of the below perl would be to concatenate all lines together as one. miguel On Sat, 8 Jun 2002, Chris Knipe wrote: Perl apparently also works very nice for this open (FILE, filename): open (NEWFILE, filename); WHILE (FILE) { chomp; print NEWFILE $_ } close (FILE); close(NEWFILE); this should take care of ^M Kind Regards, Chris Knipe MegaLAN Corporate Networking Services Tel: +27 21 854 7064 Cell: +27 72 434 7582 - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, June 09, 2002 2:40 AM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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] e-commerce example
I'm looking for e-commerce example (PHP+MySQL) so I don't start from zero and save some time. You could try searching for php mysql commerce on any of the following: www.google.com www.freshmeat.net www.hotscripts.com Where you'd probably find what you're looking for. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect()
I posted this to the MySQL list as well, but haven't gotten an answer so far. Just wonderin gif it may be a PHP problem I'm looking at. Anyway, this is the text of the message I posted to MySQL, with a few edits: I don't know if this is more of a PHP thing or a MySQL user issue that I'm having trouble with. I have this code: /* Connecting, selecting database */ $link = mysql_connect() or die(Could not connect: . mysql_error()); mysql_select_db(my_database) or die(Could not select database); I've gone through the MySQL manual step-by-step on how to remove the anonymous user (I'm using Win32) and add a password for the root user, then create other users. I also have read the PHP manual concerning the mysql_connect() function and use it accordingly, mysql_connect(host, user, pass) The problem is, when I put anything in the mysql_connect() function, I get: Access denied for user: 'user@host' (Using password: YES) Where user is whatever user I'm trying to connect with (have tried many) and host is my server - I've tried both localhost (which gives me server not found) and the actual hostname of my computer, which gives me the access denied. The weird thing is, this works with -just- mysql_connect(), and the user/pass combos I'm using I use just fine to maintain and update the database, i.e. these are known good user/pass combos. Any idea what's happening? Jason Soza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing ^M
why not just run tr -d \r htmlfile.htm - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, June 09, 2002 2:40 AM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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] mysql_connect()
This is just a MySQL problem. You've got something messed up or set incorrectly in your MySQL.user table. In the MySQL database, look at the user table. SELECT * FROM user. Look at the Host and User columns. If you want to connect as root from the same machine, only, then there should be only one row in there. Host should be localhost, user should be root. Can you send me a cut and paste of the Host and User columns of your MySQL.user table? Just those two columns. It should be easy to figure out without seeing them, though For example, my user table has only these entries: | Host | User| +--+--+ | localhost | root| | localhost | 447sig | | localhost | user| | localhost | geeklog | If you're trying to eliminate anonymous access, then there shouldn't be any blank user entries. If you're trying to limit access to the same machine, then there shouldn't be any % signs in the host column. Have you read over the GRANT command in the MySQL manual? How did you set up these users? ---John Holmes... -Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 08, 2002 5:04 PM To: PHP-General Mailing List Subject: [PHP] mysql_connect() I posted this to the MySQL list as well, but haven't gotten an answer so far. Just wonderin gif it may be a PHP problem I'm looking at. Anyway, this is the text of the message I posted to MySQL, with a few edits: I don't know if this is more of a PHP thing or a MySQL user issue that I'm having trouble with. I have this code: /* Connecting, selecting database */ $link = mysql_connect() or die(Could not connect: . mysql_error()); mysql_select_db(my_database) or die(Could not select database); I've gone through the MySQL manual step-by-step on how to remove the anonymous user (I'm using Win32) and add a password for the root user, then create other users. I also have read the PHP manual concerning the mysql_connect() function and use it accordingly, mysql_connect(host, user, pass) The problem is, when I put anything in the mysql_connect() function, I get: Access denied for user: 'user@host' (Using password: YES) Where user is whatever user I'm trying to connect with (have tried many) and host is my server - I've tried both localhost (which gives me server not found) and the actual hostname of my computer, which gives me the access denied. The weird thing is, this works with -just- mysql_connect(), and the user/pass combos I'm using I use just fine to maintain and update the database, i.e. these are known good user/pass combos. Any idea what's happening? Jason Soza -- 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] PEAR Benchmark other benchmark techniques??
Im looking for ways to benchmark my script. I read on O'Reilly that I could use PEAR, and I tried it a few weeks ago when I was running php 4.1.2. Today I upgraded to php 4.2.1 and when I try to include the benchmark the script is unable to find the PEAR benchmark class.| include_once(Benchmark/Timer.php);| Warning: Failed opening 'Benchmark/Timer.php' for inclusion (include_path='.:/usr/local/lib/php') Also on a side note, I dont know much about benchmarking utilities, but what else is out there for windows/bsd?? Thanks -- 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] Removing ^M
I get this when running that command: tr: only one string may be given when deleting without squeezing repeats I looked at the tr man pages and it didn't help much. I also tried using '\r' and `\r` and just \r , but always get the same result. Steve At 11:07 PM 6/8/2002 +0200, you wrote: why not just run tr -d \r htmlfile.htm - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, June 09, 2002 2:40 AM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Include + $Variables Help
Problem resolved! I replaced ?php include($auth=name); ? with ?php include($_GET['auth']..txt); ? in article.php Worked exactly as I was trying for. Thanks for the help! Best regards, Steven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Include + $Variables Help
Oops, typo: ?php include($auth=name); ? ... is suppose to read ?php include($auth.txt); ? Also for reference, the error was: Warning: Failed opening '.txt' for inclusion (include_path='.;c:\php4\pear') in c:\server\www\article.php on line 9 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to test if rewrite rule is working
I have created the following htaccess file using rewrite rules for the purpose of having search engine friendly files created from my dynamic files. RewriteEngine On RewriteRule ^index-(.*),(.*)\.html$ index.php?section=$1page=$2 RewriteRule ^nav-(.*),(.*)\.html$ nav.php?section=$1page=$2 How do I test to see if this is working from a search engine robot standpoint? I don't see anything in my log files and I don't see that the URI in the address bar has changed. Am I doing something wrong? TIA, Nicole -- Nicole Lallande [EMAIL PROTECTED] 760.753.6766 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestions for getting started with poll app.
- Original Message -From: "Nick Wilson" [EMAIL PROTECTED]To: [EMAIL PROTECTED]Sent: Sunday, June 09, 2002 12:15 AMSubject: Re: [PHP] Suggestions for getting started with poll app.* and then [EMAIL PROTECTED] declared I want to build my own poll(The ones availble from sites such ashotscripts.com are not quite what I need)I did one recently for a client. You could have a look at it and see ifit fits your needs... I've commented it for someone else so it should bequite easy to modify (see attached)--Nick Wilson // www.explodingnet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 9 Jun 2002 02:12:14 -0000 Issue 1394
php-general Digest 9 Jun 2002 02:12:14 - Issue 1394 Topics (messages 101274 through 101305): Reading from a dir. 101274 by: Steven Mallett 101275 by: Sqlcoders.com Programming Dept 101276 by: Stuart Dallas What are pros and cons of the Apache module verses cgi version? 101277 by: Al 101291 by: Miguel Cruz Removing ^M 101278 by: Michael Hall 101279 by: Sqlcoders.com Programming Dept 101290 by: Miguel Cruz 101292 by: Chris Knipe 101294 by: Miguel Cruz 101295 by: Chris Knipe 101298 by: Dave Raven 101301 by: Steve Buehler Include + $Variables Help 101280 by: Steven 101282 by: Nick Wilson 101283 by: Olexandr Vynnychenko 101302 by: Steven 101303 by: Steven Re: PHP 4.0.6 file upload problems? 101281 by: Bogdan Stancescu Making code execute on fatal error? 101284 by: Leif K-Brooks 101286 by: Dan Hardiker 101289 by: Leif K-Brooks Re: Warning: Too many connections in xxx on line xx 101285 by: John Holmes 101293 by: Dan Morris Re: ssl security question 101287 by: Daniel Grace Re: Search a flat file. 101288 by: Daniel Grace Re: e-commerce example 101296 by: David Freeman mysql_connect() 101297 by: Jason Soza 101299 by: John Holmes PEAR Benchmark other benchmark techniques?? 101300 by: Gerard Samuel how to test if rewrite rule is working 101304 by: Nicole Lallande Re: Suggestions for getting started with poll app. 101305 by: webmaster.tececo.com Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Is there another way to read the files from a directory? I tried the following: foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } but get an error whether safe mode is on or off. I'm just learning as you might guess. -- Steve Mallett http://OSDir.com - Stable, Open Source Apps [EMAIL PROTECTED] | [EMAIL PROTECTED] http://open5ource.net personal | With new, all powerful, blogging action! ---End Message--- ---BeginMessage--- Try... ? //$dirname should contain the directory name including it's full path... $handle=opendir($dirname); while ($file = readdir($handle)){ echo($file is located in the $dirname directory); } ? HTH, Dw. Sqlcoders.com Dynamic data driven web solutions - Original Message - From: Steven Mallett [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: June 08 2002 07:23 AM Subject: [PHP] Reading from a dir. Is there another way to read the files from a directory? I tried the following: foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } but get an error whether safe mode is on or off. I'm just learning as you might guess. -- Steve Mallett http://OSDir.com - Stable, Open Source Apps [EMAIL PROTECTED] | [EMAIL PROTECTED] http://open5ource.net personal | With new, all powerful, blogging action! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- On Saturday, June 8, 2002 at 3:23:01 PM, you wrote: Is there another way to read the files from a directory? http://www.php.net/readdir -- Stuart ---End Message--- ---BeginMessage--- I notice that some webhosts offer the apache module and some the cgi. On the surface, the cgi version appears to be a lot of extra hassle. Thanks ---End Message--- ---BeginMessage--- On Sat, 8 Jun 2002, Al wrote: I notice that some webhosts offer the apache module and some the cgi. On the surface, the cgi version appears to be a lot of extra hassle. The Apache module runs faster and has smoother integration with the web server. The CGI version allows you to run in different uid contexts, so that users on a shared/multiuser system can be prevented from seeing and messing with each other's files. There are scads of differences, but these seem to be the most salient for most people. miguel ---End Message--- ---BeginMessage--- I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick ---End Message--- ---BeginMessage--- You could replace if by ASCII code (^M is actually a representation of ASCII 013, the CR character, thanks to http://www.mindspring.com/~jc1/serial/Resources/ASCII.html for the ASCII lookup table.). This should fix it (untested) ? $chrnumber = 13; //this is the ascii code for ^M $nicestring =
Re: [PHP] Removing ^M
I don't think tr expects to receive a filename on the command line. Try: tr -d \r oldfile.html newfile.html miguel On Sat, 8 Jun 2002, Steve Buehler wrote: I get this when running that command: tr: only one string may be given when deleting without squeezing repeats I looked at the tr man pages and it didn't help much. I also tried using '\r' and `\r` and just \r , but always get the same result. Steve At 11:07 PM 6/8/2002 +0200, you wrote: why not just run tr -d \r htmlfile.htm - Original Message - From: Michael Hall [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, June 09, 2002 2:40 AM Subject: [PHP] Removing ^M I am trying remove ^M characters (some kind of newline character) from an HTML file. I've tried all sorts of ereg_replace and sed possibilities but the things just won't go away. Does anyone have a way of removing such characters? TIA Mick -- 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 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to test if rewrite rule is working
On Sat, 8 Jun 2002, Nicole Lallande wrote: I have created the following htaccess file using rewrite rules for the purpose of having search engine friendly files created from my dynamic files. RewriteEngine On RewriteRule ^index-(.*),(.*)\.html$ index.php?section=$1page=$2 RewriteRule ^nav-(.*),(.*)\.html$ nav.php?section=$1page=$2 How do I test to see if this is working from a search engine robot standpoint? I don't see anything in my log files and I don't see that the URI in the address bar has changed. Am I doing something wrong? This isn't a PHP question. If you don't have the rule do a redirect [R] then you won't see a change in the address bar. The obvious way to test it in any case is to supply a URL like index-1,2.html or whatever and see if you get to the right place. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function needed
I am in need of a function/script that will take a directory and search all filenames, recursively down, for a given file. Can anyone point me to a source? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHPMyAdmin Alternative?
Are there alternatives to PHPMyAdmin available? www.mysql.com/ is supposed to have one, no? -- John Taylor-Johnston - - Université de Sherbrooke: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date?
Hello, I am having nothing but trouble with the date function. I want it to print out a date like this: Saturday June 8, 2002 but as soon as I put spaces or comma's in the string I get parse errors. I can get it to print SaturdayJune082002 with ? echo date (lFdY); ? I have tried escaping with \ but it seems to make no difference. Any ideas? Thanks, Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date?
? echo date (l., .F. .d., .Y); ? Sunday, June 09, 2002 But I would use: ?php echo date (l., .F. .d., .Y); ? Don't know why, but someone told me once it had something to do with versions. John Jeremy Bowen wrote: I am having nothing but trouble with the date function. I want it to print out a date like this: Saturday June 8, 2002 but as soon as I put spaces or comma's in the string I get parse errors. I can get it to print SaturdayJune082002 with ? echo date (lFdY); ? I have tried escaping with \ but it seems to make no difference. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Javascript PHP cookies
Absolutely. I've done it. Cookies are cookies. What I don't like is that the cookie is not saved unitl after a submit. In Javascript, I have JS code that will assign a value and save it to a cookie and then recall the cookie value and document.write(myvalue), over and over if I want, without EVER submitting. It works as the page loads. Need JS code? [EMAIL PROTECTED] www.tececo.com
[PHP] PHP function for listing number of columns in table
Pardon the probably stupid question but, Is there a PHP function for listing number of columns in a mySQL table? Thanks in advance JJ Harrison [EMAIL PROTECTED] www.tececo.com
RE: [PHP] PHPMyAdmin Alternative?
Look in http://www.mysql.com/downloads/gui-mycc.html and download the latest version of MyCC, which helped me to manage the DBs on the server. I found a problem with the current version, but one of it's developers told me to wait 'till next week when the new release is available. The problem is that you can't issue multiple SQL queries, but that will be solved. César Aracena IS / MCSE+I Neuquén, NQN (0299) 156-356688 (0299) 446-6621 -Mensaje original- De: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] Enviado el: Domingo, 09 de Junio de 2002 01:33 a.m. Para: [EMAIL PROTECTED] Asunto: [PHP] PHPMyAdmin Alternative? Are there alternatives to PHPMyAdmin available? www.mysql.com/ is supposed to have one, no? -- John Taylor-Johnston -- --- - Université de Sherbrooke: -- 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 Compile with sun 5.7
Any News ?? Moussa Dahadha wrote: Hi, i know that this question was asked many times but i still can't find any solution :-( When i try to compile php I alweys recive this error: Making all in . make[1]: Entering directory `/root/php-4.2.1' /bin/sh /root/php-4.2.1/libtool --silent --mode=link gcc -I. -I/root/php-4.2.1/ -I/root/php-4.2.1/main -I/root/php-4.2.1 -I/www/include -I/root/php-4.2.1/Zend -I/root/php-4.2.1/ext/mysql/libmysql -I/root/php-4.2.1/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -DUSE_EXPAT -I/root/php-4.2.1/TSRM -g -O2 -prefer-pic -o libphp4.la -rpath /root/php-4.2.1/libs -avoid-version -L/usr/ucblib -R /usr/ucblib stub.lo Zend/libZend.la sapi/apache/libsapi.la main/libmain.la regex/libregex.la /root/php-4.2.1/ext/ctype/libctype.la /root/php-4.2.1/ext/mysql/libmysql.la /root/php-4.2.1/ext/pcre/libpcre.la /root/php-4.2.1/ext/posix/libposix.la /root/php-4.2.1/ext/session/libsession.la /root/php-4.2.1/ext/standard/libstandard.la /root/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lpam -lcrypt -lresolv -lresolv -lm -ldl -lsocket -lsocket -lcrypt -ldl /usr/local/sparc-sun-solaris2.7/bin/ld: /root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): Relocations in generic ELF (EM: 3) /root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): could not read symbols: File in wrong format make[1]: *** [libphp4.la] Error 1 make[1]: Leaving directory `/root/php-4.2.1' make: *** [all-recursive] Error 1 So maybe anyone know how can i fix it? -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date?
I added a comment to the FAQ: http://www.php.net/manual/en/function.date.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHPMyAdmin Alternative?
This a binary? I was hoping for a web-based (PHP, Perl, ASP, etc.) alternative - like PHPMyAdmin - to analyse. César l . aracena wrote: Look in http://www.mysql.com/downloads/gui-mycc.html and download the The problem is that you can't issue multiple SQL queries, but that will be solved. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP function for listing number of columns in table
try mysql_num_fields() Hugh - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 08, 2002 9:54 PM Subject: [PHP] PHP function for listing number of columns in table Pardon the probably stupid question but, Is there a PHP function for listing number of columns in a mySQL table? Thanks in advance JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php