php-general Digest 23 Apr 2001 09:53:51 -0000 Issue 644 Topics (messages 49766 through 49826): Re: writing to file on server 49766 by: Adam 49767 by: Felix Kronlage Re: Link Color Questions 49768 by: Adam What's wrong with this code? 49769 by: Tyler Longren 49812 by: Alexander Wagner 49814 by: Chris Fry 49815 by: David Bouw 49821 by: Geir Eivind Mork Re: Recursive Childs 49770 by: Joe Conway is there something like get_time_limit() ? 49771 by: almir 49774 by: CC Zona PHP4 for Apache httpd-2_0_16 49772 by: The Doctor Reference to arrays 49773 by: Wayne Parrott Incrementing a String Name 49775 by: Chris Aitken 49776 by: Andreas Landmark 49781 by: Tom Rogers 49782 by: Meir kriheli 49824 by: Patrick Dunford Re: Connecting to a MS Access database 49777 by: Steve Maroney 49817 by: Geir Eivind Mork redirection to another page function 49778 by: Carlos Fernando Scheidecker Antunes 49779 by: Tyler Longren 49780 by: Jason Murray 49783 by: Christian Dechery 49784 by: Jason Murray 49786 by: Christian Dechery 49787 by: Jason Murray 49788 by: Chris Aitken 49790 by: Christian Dechery 49791 by: Jason Murray 49793 by: Chris Aitken 49794 by: Christian Dechery 49795 by: Christian Dechery 49804 by: Adam 49825 by: James Holloway Printing 49785 by: Dmitry 49789 by: Chris Anderson Counting Words In a String 49792 by: Jason Beebe 49801 by: Greg Donald 49820 by: Robert Vetter web page grab 49796 by: Ed Lazor 49797 by: Michael Hall 49798 by: Michael Hall 49799 by: nicuc.ac.jp Re: Linux Suggestion 49800 by: Jason Caldwell 49819 by: Geir Eivind Mork calculate length between date to date 49802 by: Jacky.lilst 49803 by: Jason Murray IMAP Help 49805 by: Nashirak Bosk php powered forums 49806 by: kenny.hibs 49807 by: David Robley 49811 by: Nick Terzich Remove headers and footer from printed pages. 49808 by: Dezider Góra 49809 by: Peter Houchin 49810 by: Peter Houchin Re: Where can I get php_msql.dll? 49813 by: elias crypt() and md5 49816 by: Niklas Neumann 49818 by: Rasmus Lerdorf 49822 by: Niklas Neumann 49823 by: Rasmus Lerdorf 49826 by: Niklas Neumann 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] ----------------------------------------------------------------------
chmod the file to 777, this will allow anyone write permission to the file and thus you will be able to append to the file
On Sun, Apr 22, 2001 at 03:06:04PM -0700, Adam wrote: > chmod the file to 777, this will allow anyone write permission to the file > and thus you will be able to append to the file file-mode 777 is ugo=rwx. You want 'chmod 666', which is ugo=rw. read is 4 write is 2 execute is 1 If you want rw on the file, it's 6 not 7. -fkr -- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkr@IRCnet |
##################################### yes, make a style sheet called "domain.css" and put in this text: ##################################### a.domain1:link { color: #0000FF; } a.domain2:link { color: #FF0000; } a.domain3:link { color: #FF8000; } ##################################### in the head tag, be sure to add the style's location: ##################################### <head> <link rel="stylesheet" href="domain.css" type="text/css"> </head> ##################################### then inset your html on teh page as follows: ##################################### <body> <a href="http//www.domain1.com" class="domain1">www.domain1.com</a> <a href="http//www.domain2.com" class="domain2">www.domain2.com</a> <a href="http//www.domain3.com" class="domain3">www.domain3.com</a> </body> hope this helps some :) -Adam
$file = fopen("includes/about.inc", "r"); $data = fread($file, 24000000); $stripped = stripslashes($data); $formatted_data = nl2br($stripped); echo "$formatted_data"; Any ideas why that doesn't work on one server but it will work on another server? The server it works on is Win2k, IIS5, php4.0.4pl1. The server it doesn't work on is Linux, Apache, php4.0.4pl1. Any ideas why this won't work? Just to be sure, I did a chmod 777 about.inc, so file permissions isn't it. Thanks everyone, Tyler Longren
Tyler Longren wrote: > $file = fopen("includes/about.inc", "r"); > $data = fread($file, 24000000); [..] > Any ideas why that doesn't work on one server but it will work on > another server? The server it works on is Win2k, IIS5, php4.0.4pl1. > The server it doesn't work on is Linux, Apache, php4.0.4pl1. Any > ideas why this won't work? Just to be sure, I did a chmod 777 > about.inc, so file permissions isn't it. I don't know why this wouldn't work on LAMP, but if you want to read a whole file you should do this: $data = implode('',file("includes/about.inc")); regards Wagner -- "In place of infinity we usually put some really big number, like 15." - Anonymous Computer Science professor
I think you need to specify the full path rather than relative when using fopen eg: $file = fopen("/usr/local/apache/htocs/includes/about.inc", "r"); Chris Alexander Wagner wrote: > Tyler Longren wrote: > > $file = fopen("includes/about.inc", "r"); > > $data = fread($file, 24000000); > [..] > > Any ideas why that doesn't work on one server but it will work on > > another server? The server it works on is Win2k, IIS5, php4.0.4pl1. > > The server it doesn't work on is Linux, Apache, php4.0.4pl1. Any > > ideas why this won't work? Just to be sure, I did a chmod 777 > > about.inc, so file permissions isn't it. > > I don't know why this wouldn't work on LAMP, but if you want to read a > whole file you should do this: > $data = implode('',file("includes/about.inc")); > > regards > Wagner > > -- > "In place of infinity we usually put some really big number, like 15." > - Anonymous Computer Science professor > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: [EMAIL PROTECTED] http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ********************************************************************** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed.
I haven't got any experiences with it, but the fread function will probably be your problem.. As far as I can see you try to read 24 Megabyte into a var... This is quite large, and probably your script will be quite because of memory problem, or a OS don't won't allow you to use that much memory for the process.. What solution you will have to use I don't know, problaby read blocks of 500 kilobyte process it and then reuse the variable to read the next 500 kilobyte etc etc till you are finished.. Bye Bye David > $file = fopen("includes/about.inc", "r"); > $data = fread($file, 24000000); > $stripped = stripslashes($data); > $formatted_data = nl2br($stripped); > echo "$formatted_data"; > > Any ideas why that doesn't work on one server but it will work on another > server? The server it works on is Win2k, IIS5, php4.0.4pl1. The server it > doesn't work on is Linux, Apache, php4.0.4pl1. Any ideas why this won't > work? Just to be sure, I did a chmod 777 about.inc, so file permissions > isn't it. > > Thanks everyone, > Tyler Longren > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Monday 23 April 2001 08:59, Alexander Wagner wrote: > Tyler Longren wrote: > > $file = fopen("includes/about.inc", "r"); > > $data = fread($file, 24000000); $file = "includes/about.inc"; if ($fp = fopen($file,"r")) { $data = fread($fp,filesize($file)); fclose($fp); } ought to work. -- php developer / CoreTrek AS | Beware of a tall dark man with a spoon Sandnes / Rogaland / Norway | up his nose. web: http://www.moijk.net/ |
>Subject: Re: [PHP] Recursive Childs > thanks for that, could you just explain how it should start, should i just call the function, how does the level get determined ??? After the function ends, starting at ********************* $conn = pg_connect("dbname=mydb user=postgres"); ********************* is an example of how to call the function. Level starts out as level 0. Each time the function is called, it increments the value of level that was passed to it -- therefore a child of parent = 0 is at level 1, and a child of parent 1 is at level 2, etc. The part that initializes everything is: ********************* $conn = pg_connect("dbname=mydb user=postgres"); $parent = 0; $level = 0; $currentrecord = 0; $rowclr = "#e7e7e7"; ********************* Change $parent to something else to start at a different point in your tree. $level can start with whatever value you want. The next part starts an HTML document and the table, then calls the recursive function, getChildren. getChildren calls itself recursively to build the table. When the function emerges again at the top level, the table and html document are ended. ********************* print("<HTML><BODY>\n"); print("<table cellspacing=\"1\" cellpadding=\"1\" width=\"100%\">\n"); print("<tr bgcolor=\"#BBBBBB\">\n"); print("<th align=\"left\">ID</th>\n"); print("<th align=\"left\">Name</th>\n"); print("<th align=\"center\">Level</th>\n"); print("</tr>\n"); getChildren($conn,$parent,$level,$currentrecord,$rowclr); print("</TABLE>\n"); if ($currentrecord == 0) { print("<H3>No matches found.</H3>\n"); } print("</BODY></HTML>\n"); ********************* That's it -- it's actually pretty simple. - Joe
is it possible to get time limit of script on server ? almir
In article <9bvs8e$g9p$[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("almir") wrote: > is it possible to get time limit of script on server ? Since the "max_execution_time" can be set in php.ini, the current value should be displayable with a call to phpinfo(). I expect you can also check that value with get_cfg_var(). And of course you can also change the setting in a script simply by using set_time_limit(). Cheers! -- CC
Does anyone know how to build a static module for Apache httpd-2_0_16?
Hi, I'm trying to make a reference to an array but it doesn't seem to work, is this supported? am i doing it wrong? Here is the code... $this->level[$this->breaklevel][column] = $col; $this->level[$this->breaklevel][level] = $this->breaklevel; $this->level[$this->breaklevel][breaktype] = 'break'; $this->column[$col] = &$level[$this->breaklevel]; Thanks Wayne
Hi Just a quick puzzle I cant seem to get around at the moment... Im trying to create a loop that increments the string name by a digit. For example, if I had the following 4 strings submitted to a script..... $name1 $name2 $name3 $name4 What I want to do is create a while loop that will print out the above 4 strings, incrementing the number part of string automatically. while($count<4) { $count=$count+1; echo"$increased_string_name\n"; } But I just cant seem to work out how to increment the string name to display it. Any assistance on this would be great. I have a feeling that there is a better method of attacking this but im only new to PHP and dont know it yet. Thanks Chris
On Mon, Apr 23, 2001 at 10:58:20AM +1000, Chris Aitken produced this golden nugget: > Hi > > Just a quick puzzle I cant seem to get around at the moment... > > Im trying to create a loop that increments the string name by a digit. For > example, if I had the following 4 strings submitted to a script..... > > $name1 > $name2 > $name3 > $name4 > > What I want to do is create a while loop that will print out the above 4 > strings, incrementing the number part of string automatically. > > while($count<4) { > $count=$count+1; > echo"$increased_string_name\n"; > } > > But I just cant seem to work out how to increment the string name to > display it. > > Any assistance on this would be great. I have a feeling that there is a > better method of attacking this but im only new to PHP and dont know it yet. > There is a better way... Use an array: $name[0] //your $name1 $name[1] // your $name2 etc. and then do while($count<4) { $count=$count+1; echo $name[$count]; } and there you go... that should work just like your code would've in theory... -- andreas landmark / noXtension
Hi Here is another way $x = 1; while($x < 5): $index = "name".$x; $name = $$index; echo $name."<br>"; endwhile; had troubles with echo and $$variable, thats why the extra step....habit Tom At 10:58 AM 23/04/01 +1000, Chris Aitken wrote: >Hi > >Just a quick puzzle I cant seem to get around at the moment... > >Im trying to create a loop that increments the string name by a digit. For >example, if I had the following 4 strings submitted to a script..... > >$name1 >$name2 >$name3 >$name4 > >What I want to do is create a while loop that will print out the above 4 >strings, incrementing the number part of string automatically. > >while($count<4) { > $count=$count+1; > echo"$increased_string_name\n"; >} > >But I just cant seem to work out how to increment the string name to >display it. > >Any assistance on this would be great. I have a feeling that there is a >better method of attacking this but im only new to PHP and dont know it yet. > > > >Thanks > > >Chris > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Monday 23 April 2001 03:58, Chris Aitken wrote: > Hi > > Just a quick puzzle I cant seem to get around at the moment... > > Im trying to create a loop that increments the string name by a digit. For > example, if I had the following 4 strings submitted to a script..... > > $name1 > $name2 > $name3 > $name4 > > What I want to do is create a while loop that will print out the above 4 > strings, incrementing the number part of string automatically. > > while($count<4) { > $count=$count+1; > echo"$increased_string_name\n"; > } > > But I just cant seem to work out how to increment the string name to > display it. > > Any assistance on this would be great. I have a feeling that there is a > better method of attacking this but im only new to PHP and dont know it > yet. > > > > Thanks > > > Chris while($count<4) { $count++; $strname="name$count"; echo $$strname; } -- Meir Kriheli There's someone in my head, but it's not me - Pink Floyd
On 22 Apr 2001 17:56:23 -0700 AD in php.general, Chris Aitken said: >Hi > >Just a quick puzzle I cant seem to get around at the moment... Why don't you put it in your own thread
This brings up a question that I always wondered. Does Access have server functionality? Where do you configure these settings ? Thanks, Steve On Sat, 21 Apr 2001, Andrew Hill wrote: > The Access native driver IS an ODBC driver. > That is, I believe, your only option. > > Best regards, > Andrew > -------------------------------------------- > Andrew Hill - OpenLink Software > Directory of Technology Evangelism > Internet Data Integration Technology > http://www.openlinksw.com > > On Saturday, April 21, 2001, at 07:00 PM, Søren Soltveit wrote: > > > How can I connect to a Microsoft Access database, whitout using ODBC?? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Sunday 22 April 2001 22:02, Steve Maroney wrote: > This brings up a question that I always wondered. > Does Access have server functionality? Where do you configure these > settings ? If you go over the menuchoice - file, shake your mouse, bite in the cord, slam your head in the monitor fifteen times and then trow a bucket of water over your computer a new option called 'server' comes up. if not, repeat the steps. Or install a database server. when using ex. asp towards an accessbase it's odbc that deals with the communication. it's slow, it's a bottleneck.. but it works :) -- php developer / CoreTrek AS | Thus spake the master programmer: Sandnes / Rogaland / Norway | "After three days without programming, web: http://www.moijk.net/ | life becomes meaningless." -- Geoffrey
Hello all! Is there any PHP native function to redirect to another page or URL? I would like that once the user clicks on home.php4 and a few verifications are done, he/she would be redirected to home.html. Thanks, C.F.
header ("Location: http://www.location.com/home.html"); > -----Original Message----- > From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]] > Sent: Sunday, April 22, 2001 8:19 PM > To: PHP-GENERAL > Subject: [PHP] redirection to another page function > Importance: High > > > Hello all! > > Is there any PHP native function to redirect to another page or URL? > > I would like that once the user clicks on home.php4 and a few > verifications are done, he/she would be redirected to home.html. > > Thanks, > > C.F. >
> Is there any PHP native function to redirect to another page or URL? No, because you can only redirect a browser to another page using the appropriate HTTP command (it is a header) or JavaScript. > I would like that once the user clicks on home.php4 and a few > verifications are done, he/she would be redirected to home.html. You can issue a HTTP redirection command to the web browser by using PHP's Header() function. You'll want to use this kind of code: <? Header("Location: http://this.is.the.destination.com/directory/file.php"); ?> Jason
At 11:22 23/4/2001 +1000, Jason Murray wrote: > > Is there any PHP native function to redirect to another page or URL? > >No, because you can only redirect a browser to another page using the >appropriate HTTP command (it is a header) or JavaScript. > > > I would like that once the user clicks on home.php4 and a few > > verifications are done, he/she would be redirected to home.html. > >You can issue a HTTP redirection command to the web browser by using >PHP's Header() function. You'll want to use this kind of code: > ><? > Header("Location: >http://this.is.the.destination.com/directory/file.php"); >?> I never had any trouble using header() to redirect, but wouldn't something like this work even better (without worring about previous outputs)?? function redirect($dest) { ?> <script language="JavaScript"> parent.location.href='<?=$dest?>'; </script> <? } it would work wouldn't it? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
> I never had any trouble using header() to redirect, but > wouldn't something like this work even better (without > worring about previous outputs)?? > > function redirect($dest) > { > ?> > <script language="JavaScript"> > parent.location.href='<?=$dest?>'; > </script> > <? > } > > it would work wouldn't it? In Netscape: Menu >> Edit >> Preferences >> Advanced >> [ ] Enable Javascript ^ Not ticked Oops. I just broke that redirection. :) Jason
At 11:56 23/4/2001 +1000, you wrote: > > I never had any trouble using header() to redirect, but > > wouldn't something like this work even better (without > > worring about previous outputs)?? > > > > function redirect($dest) > > { > > ?> > > <script language="JavaScript"> > > parent.location.href='<?=$dest?>'; > > </script> > > <? > > } > > > > it would work wouldn't it? > >In Netscape: > > Menu >> Edit >> Preferences >> Advanced >> > [ ] Enable Javascript > ^ > Not ticked > >Oops. I just broke that redirection. :) Yeah... I know that... but, c'mon... a browser that doesn't support Javascript can't surf trough at least 30% of all websites... it's the absolute minority. Netscape itself is a minority. ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
> Yeah... I know that... but, c'mon... a browser that doesn't support > Javascript can't surf trough at least 30% of all websites... it's the > absolute minority. Netscape itself is a minority. That's not the point. You should be writing the code such that you shouldn't need to make this kind of argument, at least for a simple HTTP-related issue anyway. JavaScript syntax / functionality perhaps, HTTP commands no. Why do with JavaScript what you can do without? Jason
At 11:15 PM 22/04/2001, Christian Dechery wrote: >Yeah... I know that... but, c'mon... a browser that doesn't support >Javascript can't surf trough at least 30% of all websites... it's the >absolute minority. Netscape itself is a minority. While its true Netscape is a minority, and browsers not allowing Javascript are an even bigger minority (Bigger Minority..... Military Intelligence.... Microsoft Works ?), I think Jasons point was more to show that its best to use an option which will work on all environments if possible. Sure, the Javascript system will work, but the header() function works better. Surely its better to write your code trying not to exclude any user if at all possible. Chris -- Chris Aitken - Webmaster/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 8888 fax: +61 2 4628 8890 -------------------------------------------- Unix -- because a computer's a terrible thing to waste!
At 12:22 23/4/2001 +1000, Chris Aitken wrote: >At 11:15 PM 22/04/2001, Christian Dechery wrote: > >>Yeah... I know that... but, c'mon... a browser that doesn't support >>Javascript can't surf trough at least 30% of all websites... it's the >>absolute minority. Netscape itself is a minority. > >While its true Netscape is a minority, and browsers not allowing >Javascript are an even bigger minority (Bigger Minority..... Military >Intelligence.... Microsoft Works ?), I think Jasons point was more to show >that its best to use an option which will work on all environments if >possible. Sure, the Javascript system will work, but the header() function >works better. > >Surely its better to write your code trying not to exclude any user if at >all possible. Yeah... I know what you and Jason mean. I justed pointed out that it could work nicely... and I just tought of that... I user header("location: ... ") on all my scripts and struggle to put them before any output (that's not easy)... I work on a e-commerce website (coding in ASP, but what can I do?) with lots of JavaScript calls that in some cases are the heart of the operation, and we never had any trouble or complaints with it. I know that, the best way is to get your script running anywhere regardless of what browser or OS people use, but is important too to use as much of the technology as you can. Like HTML capable clients... in a recent pass, that was a nightmare cuz half the people used the most outdated email clients, but nowadays, almost every spam or corporate email I get, is HTML, people who don't have HTML capable clients, hurry to get them. I won't even get started with "<noframes>Your browser isn't frames capable</noframes>", hehe. Javascipt is almost a standard and it is a great help in many cases where server-side simply won't do the job. I don't know... I'm just thinking here... maybe its all BS! :) ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
> I work on a e-commerce website (coding in ASP, but what can I > do?) with lots of JavaScript calls that in some cases are the heart > of the operation, and we never had any trouble or complaints with it. I want your job. We have people complain every time we set a cookie. Imagine the fuss we'd have if we required JavaScript for something. :) Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "What'll Scorpy use wormhole technology for?" 'Faster pizza delivery.'
At 11:40 PM 22/04/2001, you wrote: >I justed pointed out that it could work nicely... and I just tought of >that... I user header("location: ... ") on all my scripts and struggle to >put them before any output (that's not easy)... >I work on a e-commerce website (coding in ASP, but what can I do?) with >lots of JavaScript calls that in some cases are the heart of the >operation, and we never had any trouble or complaints with it. While I do utilise some javascript niceties in some of my work, I usually only do it either when a) its an internal sytsem here at work and I know everyone has the same system/software/setup or b) where its only an enhancement and it wont affect the usability of the system if its not there. Ill always try and use PHP and server side solutions before resorting to client side solutions Chris. -- Chris Aitken - Webmaster/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 8888 fax: +61 2 4628 8890 -------------------------------------------- Unix -- because a computer's a terrible thing to waste!
At 12:42 23/4/2001 +1000, you wrote: > > I work on a e-commerce website (coding in ASP, but what can I > > do?) with lots of JavaScript calls that in some cases are the heart > > of the operation, and we never had any trouble or complaints with it. > >I want your job. I don't think u do. :) ASP sux. Win2K sux even worse, I was just working at home in huge PHP script that ended up haning the entire system because I remotely restarted WIN2K and crappy-old-IIS didn't get back. Can u imagine my ears tomorrow? :)) hehehehe >We have people complain every time we set a cookie. Imagine the >fuss we'd have if we required JavaScript for something. :) ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
At 12:48 23/4/2001 +1000, Chris Aitken wrote: >At 11:40 PM 22/04/2001, you wrote: > >>I justed pointed out that it could work nicely... and I just tought of >>that... I user header("location: ... ") on all my scripts and struggle to >>put them before any output (that's not easy)... >>I work on a e-commerce website (coding in ASP, but what can I do?) with >>lots of JavaScript calls that in some cases are the heart of the >>operation, and we never had any trouble or complaints with it. > >While I do utilise some javascript niceties in some of my work, I usually >only do it either when a) its an internal sytsem here at work and I know >everyone has the same system/software/setup or b) where its only an >enhancement and it wont affect the usability of the system if its not >there. Ill always try and use PHP and server side solutions before >resorting to client side solutions that's a better way to think about it... Altough... I still think that URL redirection should be something easier to do... as it is something very usefull and very basic, if u think in the concepts of WWW and surfing... going from one page to another is almost a primitive... u know where I'm getting at? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
use the javascript function, but also use as backup plan such as a link at the bottom or even code at the top like this: /////////////////////////////////////////////////// if (conditionals == true) { header("location:home.html"); } ////////////////////////////////////////////////// that way it will get through for most all browsers if not all browsers
One thing that doesn't seem to have been considered is the use of the "refresh" meta tag. Whilst it depends on whether or not the browser is archaic (and let's face it, most people nowadays seem to be running at least version 4 of either IE or Netscape), it's something that can't be turned off (at least to my knowledge, I could be wrong) and workarounds can be supplied for instances when the browser doesn't accept the tag. This doesn't hinder programming too much, as you don't have to worry about sending output after headers, nor whether or not the browser has javascript enabled. Personally, I prefer to use the header() function, and it's ages since I've used this meta tag, though it's worth keeping in mind that old techniques can still be useful ;) <META HTTP-EQUIV="Refresh" CONTENT="1;url=page.php"> James.
Hello, all! Do you know, can I print some page using PHP or JavaScript? Dmitry. [EMAIL PROTECTED]
try the javascript print() command ----- Original Message ----- From: "Dmitry" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 22, 2001 10:11 PM Subject: [PHP] Printing > Hello, all! > > Do you know, can I print some page using PHP or > JavaScript? > > Dmitry. > [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Hi, I want to check a string and return the amount of words present in it. These strings could be quite large, some higher than 100,000 characters. I realize I could explode the string on the whitespace and count the number of values. However, I'm not sure this would be the most optimized way to do this, especially considering there will be some quite large strings passed. Any ideas on the most efficient to count the number of words in a large string? Thanks
> I want to check a string and return the amount of words present > in it. These > strings could be quite large, some higher than 100,000 > characters. I realize > I could explode the string on the whitespace and count the number > of values. > However, I'm not sure this would be the most optimized way to do this, > especially considering there will be some quite large strings passed. Any > ideas on the most efficient to count the number of words in a > large string? $string = "Here is a very long string"; $array = explode(" ", $string); $count = sizeof($array); echo $count; ------------------------------------------------------------------------ destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common internet addict, 3. lover of late 80's heavy metal music, 4. Activist for the terminally un-elite; see also - cool guy, des, mr. php... It's 4:00am, your web site is still up, why are you? http://phplinks.org/ http://destiney.com/ ------------------------------------------------------------------------
Greg Donald wrote: > > > I want to check a string and return the amount of words present > > in it. These > > strings could be quite large, some higher than 100,000 > > characters. I realize > > I could explode the string on the whitespace and count the number > > of values. > > However, I'm not sure this would be the most optimized way to do this, > > especially considering there will be some quite large strings passed. Any > > ideas on the most efficient to count the number of words in a > > large string? > > $string = "Here is a very long string"; > $array = explode(" ", $string); > $count = sizeof($array); > echo $count; Hello, Greg, Jason asked for an _optimized_ solution. Solution: 1. If you're using PHP>=4.02 just take the substr_count() function (see manual). 2. Otherwise you can take this code: $count=0; for($x=0;$x<strlen($string);$x++) if(substr($string,$x,1)==" ") $count++; if($count>0) $count++; Robert
Hi =) I'm trying to grab content from another web page. After having browsed through the mailing list archives and such, it looks like I'll need to use the eregi_replace function, but I'm not sure how to properly format the command. The goal is to get rid of everything from the start of the page up to the word "Wish" and everything after the word "numbers". Or, another way of phrasing it, I'm wanting to get a web page and only use the content between the words "Wish" and "numbers". What would be the best way of going about this? Thanks, -Ed
Something like this: $grab = eregi("Some leading code(.*)Some trailing code"); the (.*) is what you're grabbing. Mick On Sun, 22 Apr 2001, Ed Lazor wrote: > Hi =) > > I'm trying to grab content from another web page. After having browsed > through the mailing list archives and such, it looks like I'll need to use > the eregi_replace function, but I'm not sure how to properly format the > command. The goal is to get rid of everything from the start of the page > up to the word "Wish" and everything after the word "numbers". Or, another > way of phrasing it, I'm wanting to get a web page and only use the content > between the words "Wish" and "numbers". What would be the best way of > going about this? > > Thanks, > > -Ed > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
In other words ... > $grab = eregi("....wish(.*)numbers ........."); > > the (.*) is what you're grabbing. You don't need to include the entire file up to 'wish' and beyond 'numbers', just enough to make a unique portion. Mick > > I'm trying to grab content from another web page. After having browsed > > through the mailing list archives and such, it looks like I'll need to use > > the eregi_replace function, but I'm not sure how to properly format the > > command. The goal is to get rid of everything from the start of the page > > up to the word "Wish" and everything after the word "numbers". Or, another > > way of phrasing it, I'm wanting to get a web page and only use the content > > between the words "Wish" and "numbers". What would be the best way of > > going about this? > > > > Thanks, > > > > -Ed > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I thinks you should use eregi_replace (http://www.php.net/manual/en/function.eregi-replace.php) and then strip_tags (http://www.php.net/manual/function.strip-tags.php) to strip HTML tag from string . so, you will get a plain text of the grab page. -- -Tuna- "Ed Lazor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi =) > > I'm trying to grab content from another web page. After having browsed > through the mailing list archives and such, it looks like I'll need to use > the eregi_replace function, but I'm not sure how to properly format the > command. The goal is to get rid of everything from the start of the page > up to the word "Wish" and everything after the word "numbers". Or, another > way of phrasing it, I'm wanting to get a web page and only use the content > between the words "Wish" and "numbers". What would be the best way of > going about this? > > Thanks, > > -Ed > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
>> Windows XP Beta contains the sum total of what Windows has been up to now Well, kinda... but not really.. XP is a re-write and is an offshoot of 2000 (although, not really 2000 / NT) -- so it is experimental (as its still in B.) I have not experienced your problem... however, I would recommend moving away from XP for at least several months *after* its been officially released. If your looking for a stable solution, go to NT4 (Sp5 or later) or Win2000 -- and run IIS 4.0 or 5.0 (or PSW) Other than that Linux would be your best bet for Apache. I may recommend if u do go with Linux that you create a dual boot system -- Windows for your personal stuff and Linux for your Server stuff -- But -- you could avoid all that mess with just purchasing Win2000... Apache runs fine on 2000. Good luck. Jason ""Padraic Tynan"" <[EMAIL PROTECTED]> wrote in message 004501c0cb76$5a52a900$ba87da18@computer">news:004501c0cb76$5a52a900$ba87da18@computer... > You know, that's a tad rude, just suggestion an OS switch like that. :þ > I mean, my http server isn't the only thing I run -- this is my personal use > computer. Windows XP Beta contains the sum total of what Windows has been up > to now, so I don't think the OS has very much to do with it. > > I just wanted to know of this was an actual documented problem and if there > was a fix for it, or if I was the first person to experience it. > > Not to mention, even though Apache.org says that Windows support is entirely > experimental and recommended only for experienced users, Linux itself (every > flavor) is still experimental, and you have to know beyond a shadow of a > doubt what you're doing to use it. Not to mention, every time I've tried to > set it up (RH6, Mandrake 7.1), nearly immediately following the > installation, it's messed up, without my editing any part of it. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On Sunday 22 April 2001 23:51, Padraic Tynan wrote: > You know, that's a tad rude, just suggestion an OS switch like that. :þ > I mean, my http server isn't the only thing I run -- this is my personal > use computer. I run linux and freebsd on my personal and work computer(s). but that's my personal choice, It does everything I want so why not :) (beside the neighborhood have stopped calling me for help now since I just replies that I haven't touched windows in ages so I can't help them with their tidious problems ;) seriosly, ever considered putting up a old computer for test-purposes? like a pentium 200? goes for nothing on the second hand marked. > Windows XP Beta contains the sum total of what Windows has > been up to now, so I don't think the OS has very much to do with it. total sum? you mean, all bugs and security flaws gathering in one box? Reminds me of the insurance company that charge double if you run windows on the servers cause it's more prone to fail :) > entirely experimental and recommended only for experienced users, Linux > itself (every flavor) is still experimental, and you have to know beyond a > shadow of a doubt what you're doing to use it. Not to mention, every time > I've tried to set it up (RH6, Mandrake 7.1), nearly immediately following > the installation, it's messed up, without my editing any part of it. Try FreeBSD, it's not linux but it beats the crap out of most linux distros in ease to install. ofcourse redhat 7, openlinux and such is real easy but freebsd installs never fails unless your harddrive has the surface of the moon. -- php developer / CoreTrek AS | Jones' Motto: Friends come and go, but Sandnes / Rogaland / Norway | enemies accumulate. web: http://www.moijk.net/ |
Hi all I have 2 variables here that store date start and date end, I want to compare the lenght between the start date and the end date, how would I do that? $dateStart = "$year" . "$mon" . "$date" ; ( for instance, it will return "20010102") $dateEnd = "$yearEnd" . "$monEnd" . "$dateEnd" ; ( for instance, it will return "20010201") How do I calculate the length between those 2 variables? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
> I have 2 variables here that store date start and date end, I > want to compare the lenght between the start date and the end > date, how would I do that? > $dateStart = "$year" . "$mon" . "$date" ; ( for instance, it > will return "20010102") > $dateEnd = "$yearEnd" . "$monEnd" . "$dateEnd" ; ( for > instance, it will return "20010201") > > How do I calculate the length between those 2 variables? <? $startunix = mktime(0, 0, 0, $month, $date, $year); $endunix = mktime(0, 0, 0, $monthEnd, $dateEnd, $yearEnd); $difference = $endunix - $startunix; ?> $difference now holds the number of seconds between those dates, which you can use to find out how far apart they are. Jason
I am experimenting a little with IMAP and was wondering exactly how to send mail to mailboxes that you create with the imap_createmailbox(). I know that it puts a file under an account like INBOX.whatever, but, as I said dont know exactly how to send mail to this mailbox. Now I might totally missunderstand what precisely this function does. From the looks of it it creates an account under (I am running Red HatLinux) a real unix account you have setup... that is only for receiving mail. Is this accurate. If not, I am trying to figure out how people like hotmail and other email websites have it setup where you dont have a unix account but only a mail account, and how that is all created automatically. (I know there is a way to give people a pop only account but it requires you to become root, not something I would want to have done automatically). Anyway, any help on this would be greatly appreciated. Thanx -- ------------------------------- Clayton Bluhm Computer Engineering Student [EMAIL PROTECTED] (School) [EMAIL PROTECTED] (home)
Don't know if this id the place to ask but........ Can anyone recommend a good php powered forum that I could use on my site. kenny
On Mon, 23 Apr 2001 15:34, kenny.hibs wrote: > Don't know if this id the place to ask but........ > Can anyone recommend a good php powered forum that I could use on my > site. > > kenny Phorum - http://www.phorum.org/ -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
http://www.vbulletin.com/ > Can anyone recommend a good php powered forum that > I could use on my > site. ===== -- Nick Terzich Creative Director - PopSmack, LLC Insane Advertising Posse http://www.popsmack.com/studio __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Hi guys, I have created a little "order" system for our company internal needs, and when I want to print the order, I use a special page, that has a jpg picture as a background and all items are positioned absolutely on the picture. This thing makes all the frames and lines look good. Now, when I print the page, I'd like to get rid of the "header" and "footer" that browser adds on the printed page. Does anybody have an idea how to do this? I know, that I can change these settings in IE manually, but I have no intention to go to every computer and change it, and even have no idea how to do that in NS. tia, Dezider.
you have to do it manually in IE & NS as far as i know to do in NS click on file then page set up uncheck all things to do with header and footer click ok Peter -----Original Message----- From: Dezider Góra [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 4:25 PM To: PHP General Subject: [PHP] Remove headers and footer from printed pages. Hi guys, I have created a little "order" system for our company internal needs, and when I want to print the order, I use a special page, that has a jpg picture as a background and all items are positioned absolutely on the picture. This thing makes all the frames and lines look good. Now, when I print the page, I'd like to get rid of the "header" and "footer" that browser adds on the printed page. Does anybody have an idea how to do this? I know, that I can change these settings in IE manually, but I have no intention to go to every computer and change it, and even have no idea how to do that in NS. tia, Dezider. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
I suggest you just send a email around to people with the instructions on how to do it :) -----Original Message----- From: Peter Houchin [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 4:34 PM To: Dezider Góra; PHP General Subject: RE: [PHP] Remove headers and footer from printed pages. you have to do it manually in IE & NS as far as i know to do in NS click on file then page set up uncheck all things to do with header and footer click ok Peter -----Original Message----- From: Dezider Góra [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 4:25 PM To: PHP General Subject: [PHP] Remove headers and footer from printed pages. Hi guys, I have created a little "order" system for our company internal needs, and when I want to print the order, I use a special page, that has a jpg picture as a background and all items are positioned absolutely on the picture. This thing makes all the frames and lines look good. Now, when I print the page, I'd like to get rid of the "header" and "footer" that browser adds on the printed page. Does anybody have an idea how to do this? I know, that I can change these settings in IE manually, but I have no intention to go to every computer and change it, and even have no idea how to do that in NS. tia, Dezider. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
try: www.php4win.de -elias http://eassoft.cjb.net ""Shan GAO"" <[EMAIL PROTECTED]> wrote in message 002501c0ca82$116784d0$579a86cb@shans">news:002501c0ca82$116784d0$579a86cb@shans... Can anybody tell me where I can get extension for MINI sql -- php_msql.dll for NT4.0? Cheers Shan GAO
Hello all, i would like to crypt a password as secure as possible. The documentation says crypt() will use DES unless MD5 is available. But in my case this doesn't seem to work. 'echo CRYPT_STD_DES ;' returns 1 'echo CRYPT_EXT_DES;' returns 0 'echo CRYPT_MD5;' returns 1 'echo CRYPT_BLOWFISH;' returns 0 so i will asume, that MD5 is available on my system. But 'echo CRYPT_SALT_LENGTH;' returns 2 and if i test 'crypt('test')' the string is only encrypted with DES. Anybody had similar expieriences? Is this a bug or an error on my side? Best regards Niklas Neumann -- "Ein Experte ist ein Mann, der hinterher genau sagen kann, warum seine Prognose nicht gestimmt hat." - Winston Churchil
That means that you do have MD5 crypt() support. If you simply provide a salt that starts with $1$ you should get an md5-encrypted password. If you look in a passwd or shadow file that contains md5'ed passwords you will see something like this: $1$rZelmysN$Gj0rbqD76STIotGExxpna1 ^^^^^^^^^^^^ SALT So to generate a password like this you would do: crypt($string,'$1$rZelmysN$'); -Rasmus On Mon, 23 Apr 2001, Niklas Neumann wrote: > Hello all, > > i would like to crypt a password as secure as possible. > The documentation says crypt() will use DES unless MD5 is available. > > But in my case this doesn't seem to work. > > 'echo CRYPT_STD_DES ;' returns 1 > 'echo CRYPT_EXT_DES;' returns 0 > 'echo CRYPT_MD5;' returns 1 > 'echo CRYPT_BLOWFISH;' returns 0 > > so i will asume, that MD5 is available on my system. But > 'echo CRYPT_SALT_LENGTH;' returns 2 > and if i test 'crypt('test')' > the string is only encrypted with DES. > > Anybody had similar expieriences? Is this a bug or an error on my side? > > Best regards > Niklas Neumann >
Hy, > That means that you do have MD5 crypt() support. If you simply provide a > salt that starts with $1$ you should get an md5-encrypted password. I know how to do it manually. But isn't crypt supposed to choose MD5-hashing if it is available on the system php is running on? I use PHP 4.0.4pl1 and md5 support is definitively available. Btw. > $1$rZelmysN$Gj0rbqD76STIotGExxpna1 > ^^^^^^^^^^^^ > SALT Isn't this just a 8 chars SALT (rZelmysN)? Best regards Niklas Neumann
If your system's crypt() function supports standard DES crypt, then that will be the default if you do not supply a salt. PHP will generate a random DES salt for you. If you supply your own random MD5 salt and your system's crypt() function supports MD5, then it will generate an md5-encrypted string. That's just the way it works. If you want PHP to always default to md5 crypt and generate random md5 salts for you then you should undefine PHP_STD_DES_CRYPT in php_config.h and recompile PHP. -Rasmus On Mon, 23 Apr 2001, Niklas Neumann wrote: > Hy, > > > That means that you do have MD5 crypt() support. If you simply provide a > > salt that starts with $1$ you should get an md5-encrypted password. > > I know how to do it manually. But isn't crypt supposed to choose MD5-hashing > if it is available on the system php is running on? > I use PHP 4.0.4pl1 and md5 support is definitively available. > > Btw. > > > $1$rZelmysN$Gj0rbqD76STIotGExxpna1 > > ^^^^^^^^^^^^ > > SALT > > Isn't this just a 8 chars SALT (rZelmysN)? > > > Best regards > Niklas Neumann >
Hello, > If your system's crypt() function supports standard DES crypt, then that > will be the default if you do not supply a salt. PHP will generate a > random DES salt for you. If you supply your own random MD5 salt and your > system's crypt() function supports MD5, then it will generate an > md5-encrypted string. That's just the way it works. Thanks, i reread the english documentation and there it's also explained this way. But my german documentation says 'If no salt is supplied crypt() will use a 2 chars des-salt per default unless md5 exists on your system. PHP will then generate randomly a md5-salt.'. A bit mistakable I think. I'll give the translator a wink. Thanks again and best regards Niklas Neumann