Re: [PHP] dynamic -> static
The problem is actually that search engines poorly indexes dynamic content sites, so I looking for solution to produce static pages with static links from all dynamic content being formed on the fly. - Original Message - From: "Ryan Thompson" <[EMAIL PROTECTED]> To: "Veniamin Goldin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, October 08, 2003 7:46 AM Subject: Re: [PHP] dynamic -> static Do you mean something like taking a snapshot of the CMS every 24 hours or so?? If I understand you right you might want to look at a different language like perl or shell scripting. I would think they'd be more useful for that sort of thing. On Wednesday 08 October 2003 03:56, Veniamin Goldin wrote: > Dear All, > > Does anybody have any solutions, which makes possible to produce static > pages of all dynamic cms once a day and can be easily integrated into > already made site? > > > Thank you. -- Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net == "A computer scientist is someone who fixes things that aren't broken" --Unknown -- 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] excuting a shell command in linux as root
Hi, Is there any way to execute a shell command line in PHP as root? I want to execute it using a web browser, i'm using apache and it runs as nobody. Any idea/help/suggestions? Thanks in advance mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] excuting a shell command in linux as root
First off a warning repeated many times over I'm sure. You sure you want to do that? It's very insecure Now that my butts covered you might want to take a look at sudo On Wednesday 08 October 2003 03:14, Michael P. Carel wrote: > Hi, > > Is there any way to execute a shell command line in PHP as root? I want to > execute it using a web browser, i'm using apache and it runs as nobody. > > Any idea/help/suggestions? Thanks in advance > > > mike -- Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net == "A computer scientist is someone who fixes things that aren't broken" --Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] convert "\" to "/"
I am receiving some data in which the sender has mistakenly sent urls with "\" instead of "/" to separate directories. e.g. http://www.anysite.com\page.htm I need to convert this string to http://www.anysite.com/page.htm but str replace ("\","/",$var) doesnt work. any ideas as to how to convert it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert "\" to "/"
"\" - is an escape symbol, so you should write it twice in order to escape it self. str_replace ("\\","/",$var) "Diana Castillo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am receiving some data in which the sender has mistakenly sent urls with > "\" instead of "/" to separate directories. e.g. > http://www.anysite.com\page.htm > > I need to convert this string to > http://www.anysite.com/page.htm but str replace ("\","/",$var) doesnt work. > any ideas as to how to convert it. > > -- > 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] smtp mail sending on unix
Hi, I am running apache in a chrooted enviorment on solaris and trying to get mail() to work over smtp rather than sendmail, but unsuccessfully. php.ini states that this is for win32 only. Is there any solution to that? It seems quite awkward to have the code for smtp but no option to run it. thanks, Jaanus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] smtp mail sending on unix
Try a class to send emails by smtps, like phpmailer: http://phpmailer.sourceforge.net/ -Mensaje original- De: Jaanus Torp [mailto:[EMAIL PROTECTED] Enviado el: miƩrcoles, 08 de octubre de 2003 11:29 Para: [EMAIL PROTECTED] Asunto: [PHP] smtp mail sending on unix Importancia: Baja Hi, I am running apache in a chrooted enviorment on solaris and trying to get mail() to work over smtp rather than sendmail, but unsuccessfully. php.ini states that this is for win32 only. Is there any solution to that? It seems quite awkward to have the code for smtp but no option to run it. thanks, Jaanus -- 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] or return problem
On 07 October 2003 18:15, Pat Carmody contributed these pearls of wisdom: > So far everyone is telling me that it won't work, but no one > is telling me > why. (btw I did search extensively for the answer to this > question but so > far have found nothing). Robert, could you be more specific > in your reference to the http://www.php.net documentation? I > see > nothing on the > basic syntax page that addresses this. > > Pat Carmody > > On Tue, 7 Oct 2003, Robert Cummings wrote: > >> On Tue, 2003-10-07 at 13:02, Pat Carmody wrote: >>> >>> >>> Calling the following retor_test() function causes a "Parse >>> error: parse error, unexpected T_RETURN" message when the >>> script is run: >>> >>> function istrue() { >>> return true; >>> } >>> function retor_test() { >>> istrue() or return( "False" ); >>> return "True"; >>> } >>> >>> The problem is with the "or return" part. Any ideas why? I >>> realize that I could use an if statement instead, but I'm a >>> lazy, lazy man and I don't want to. Well, let's see if I can contribute something useful here. Firstly, "or", as a Boolean operator requires two operands, both of which must have an actual value. Now, according to the manual (at http://www.php.net/manual/en/functions.returning-values.php), "Values are returned [from a function] by using the optional return statement" -- so "return" is a statement, and statements don't have a value (and can't even be coerced to have one), so "return" can't be valid as one of the operands to "or". On the other hand, "exit" (and its alias "die") are function-like language constructs which do have a value, even if it's only NULL produced by coercing a void return, so they are valid as an operand to "or". (Of course, you can never make use of the NULL return from "exit" or "die", because your script will already have exited or died before it gets the opportunity to do so -- but the very fact that they are language constructs with a potential return value means they can be used in a context which demands a value, where "return", which doesn't have a value, can't!) Hope that's all a bit clearer than mud ;) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] excuting a shell command in linux as root
It is questionable if it is really insecure. sudo allows great control over what commands it can run with what parameters. If you combine it with php input checks it gets pretty secure. But that means you HAVE TO know what you are doing. Ryan Thompson wrote: First off a warning repeated many times over I'm sure. You sure you want to do that? It's very insecure Now that my butts covered you might want to take a look at sudo On Wednesday 08 October 2003 03:14, Michael P. Carel wrote: Hi, Is there any way to execute a shell command line in PHP as root? I want to execute it using a web browser, i'm using apache and it runs as nobody. Any idea/help/suggestions? Thanks in advance mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session expire
Start here: www.php.net/session You should read it from the main heading to the last line of the last comment. redips wrote: I know that if I set a session, by default it will expire when the browser closes. Can I also set a timeout? For example, if the session is idle for 30 minutes it will expire or if the user closes the browser, it will also expire. I know I can do one or the other, but what about both? Thanks. Redsip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic -> static
Quick way to do it would be to spider your site with an offline browser and then put that site up in a subdirectory, change your index file to redirect to your site via javascript and place the static html page hidden from browsers, but not from spiders. Completely legal as long as you follow the search engines guidelines. I think it is legal if you do it like a framed page. Also place javascript redirects to their cooresponding dynamic pages. The javascript redirects are invisible to spiders. From: "Veniamin Goldin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: Re: [PHP] dynamic -> static Date: Wed, 8 Oct 2003 10:09:11 +0100 The problem is actually that search engines poorly indexes dynamic content sites, so I looking for solution to produce static pages with static links from all dynamic content being formed on the fly. - Original Message - From: "Ryan Thompson" <[EMAIL PROTECTED]> To: "Veniamin Goldin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, October 08, 2003 7:46 AM Subject: Re: [PHP] dynamic -> static Do you mean something like taking a snapshot of the CMS every 24 hours or so?? If I understand you right you might want to look at a different language like perl or shell scripting. I would think they'd be more useful for that sort of thing. On Wednesday 08 October 2003 03:56, Veniamin Goldin wrote: > Dear All, > > Does anybody have any solutions, which makes possible to produce static > pages of all dynamic cms once a day and can be easily integrated into > already made site? > > > Thank you. -- Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net == "A computer scientist is someone who fixes things that aren't broken" --Unknown -- 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 _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trailing carriage return in file
hello guys, I don't know how can I eliminate from a file the trailing ? "\n" I have a file that ends-up with one ore more it looks like this: BeginOfFile data here [] end of data EndOfFile after data I have one or more (the file don't ends immediately) i don't know how to match, using preg_replace() the '\n' character... it's something like "/n/" ? thanks, Have a nice day ! (And I'm sure that tomorrow will be better than today!) Alex Ciurea Greets You www.netonwave.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec question
Greetings learned PHP(eople); I`m using a shell_exec to get a list of files from a specified directory. When I run it locally on my machine i works. When I run it on the other machine I get = Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /var/www/html/search.php on line 9 = In /etc/php.ini Safe Mode is offI read some postings in the archives and on the advice given checked that the owner of the script has the relevant permissions on the directory/files trying to be accessed, and they are the same i.e. root Any ideas ? -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za What does education often do? It makes a straight cut ditch of a free meandering brook. -- Henry David Thoreau 13:10:21 up 21 days, 4:40, 3 users, load average: 0.48, 0.33, 0.28 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SESSION & SSL : Missing $_SESSION value
Hello everyone, I'm having the following errors and hope that someone can help. Please advise. I have an authentication script that uses session to authenticate and track the user. Every was working fine under HTTP, but when I move the application to a secure server (HTTPS), my session variables no longer hold their values. They all return BLANK. Am I missing something? Please asdvise. //Sample Code //login.html [html Form code goes here ... with action='https://www.site.com/login.php?option=login' ] //authentication //login.php if(username and password match) { session_save_path('/tmp'); session_name('sName'); session_start(); [** get user id, user type, and name from db...] //set session vars $_SESSION['userid'] = $database->userid; $_SESSION['type'] = $databe->type; $_SESSION['ACCESS'] = 'PASS'; }else{ echo '...invalid username/password...'; } ... //access restricted subpage // otherpage.php //check access. This code is actually in a function called Authenticate() that return TRUE on a successfull match. if(isset($_SESSION['ACCESS']) and $_SESSION['ACCESS']=='PASS'){ echo 'This is a valid user...'; }else{ echo 'Authentication failed...Access denied...'; } Now, the authentication failed (on the last page (otherpage.php), because the $_SESSION variable is empty. a quick print_r($_SESSION) statement returns an empty array. Basically, the $_SESSION content is not being preserved. Any idea what is causing that? Please advise. _john =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity Web Developement. Database. Hosting. Multimedia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trailing carriage return in file
trim() Alex Ciurea wrote: hello guys, I don't know how can I eliminate from a file the trailing ? "\n" I have a file that ends-up with one ore more it looks like this: BeginOfFile data here [] end of data EndOfFile after data I have one or more (the file don't ends immediately) i don't know how to match, using preg_replace() the '\n' character... it's something like "/n/" ? thanks, Have a nice day ! (And I'm sure that tomorrow will be better than today!) Alex Ciurea Greets You www.netonwave.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
safe mode is on, turn it off and restart webserver. Then you can check directory permissions. Chris Blake wrote: Greetings learned PHP(eople); I`m using a shell_exec to get a list of files from a specified directory. When I run it locally on my machine i works. When I run it on the other machine I get = Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /var/www/html/search.php on line 9 = In /etc/php.ini Safe Mode is offI read some postings in the archives and on the advice given checked that the owner of the script has the relevant permissions on the directory/files trying to be accessed, and they are the same i.e. root Any ideas ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic -> static
On Wed, 2003-10-08 at 08:56, Veniamin Goldin wrote: > Dear All, > > Does anybody have any solutions, which makes possible to produce static pages of all > dynamic cms once a day and can be easily integrated into already made site? > > > Thank you. I have been thinking of doing such thing for a while and have two possible solutions. One is to have a master object and have a variable to set the mode of operation (i.e. Dynamic, Static) You would then abstract all your output (echo etc.) functions. This new echo function would either output in the normal way or to a file handler depending on the $static_dynamic variable. You would then have a master function which crawls your site calling all the pages. The other solution involved using a function which captures all browser i/o into a variable rather than sending it to the screen (cant remember its name). Not as sure how to implement this. Basically if you have not written your CMS using objects it will be a lot harder. One of the reasons I am not generating static snapshots it the CMS I wrote was not originally written without objects. I am slowly rewriting it and when finished I will revisit this issue. Ben -- * Ben Edwards Tel +44 (0)1179 553 551 ICQ 42000477 * * Homepage - nothing of interest here http://gurtlush.org.uk * * Webhosting for the masses http://www.serverone.co.uk * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Fun corporate graphics http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On 08 Oct 2003 13:25:51 +0200, you wrote: >I`m using a shell_exec to get a list of files from a specified >directory. > >When I run it locally on my machine i works. When I run it on the other >machine I get What Marek said. However, is there any reason you're not using readdir()? http://uk.php.net/manual/en/function.readdir.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 13:56, David Otton wrote: > However, is there any reason you're not using readdir()? > > http://uk.php.net/manual/en/function.readdir.php I`ve got a whole bunch of other stuff happening using shell_exec, eg file searches etc I changed php.ini entry for safemode=on , restarted Apache, but that didn`t help.opendir() returns the following : = Warning: opendir() [function.opendir]: SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home owned by uid 0 in /var/www/html/backups.php on line 8 Warning: opendir(/home/chris/PBPCBackup/) [function.opendir]: failed to open dir: No such file or directory in /var/www/html/backups.php on line 8 = I got this error as well prior to changing the safe mode parameter... Still lost, but searching :( -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za Women want their men to be cops. They want you to punish them and tell them what the limits are. The only thing that women hate worse from a man than being slapped is when you get on your knees and say you're sorry. -- Mort Sahl 14:40:40 up 21 days, 6:10, 3 users, load average: 0.32, 0.14, 0.25 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
Did you edit the right php.ini? Check out phpinfo() output for "Configuration File (php.ini) Path" Chris Blake wrote: On Wed, 2003-10-08 at 13:56, David Otton wrote: However, is there any reason you're not using readdir()? http://uk.php.net/manual/en/function.readdir.php I`ve got a whole bunch of other stuff happening using shell_exec, eg file searches etc I changed php.ini entry for safemode=on , restarted Apache, but that didn`t help.opendir() returns the following : = Warning: opendir() [function.opendir]: SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home owned by uid 0 in /var/www/html/backups.php on line 8 Warning: opendir(/home/chris/PBPCBackup/) [function.opendir]: failed to open dir: No such file or directory in /var/www/html/backups.php on line 8 = I got this error as well prior to changing the safe mode parameter... Still lost, but searching :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
On Wed, 2003-10-08 at 14:51, Marek Kilimajer wrote: > Did you edit the right php.ini? Check out phpinfo() output for > "Configuration File (php.ini) Path" > Yep, tried that...it states /etc/php.ini, and lists other location of /etc/php/, but that directory doesn`t contain a php.ini file -- Chris Blake Support Consultant Office : (011) 782-0840 Fax: (011) 782-0841 Mobile : 083 985 0379 Website: http://www.pbpc.co.za Campus sidewalks never exist as the straightest line between two points. -- M. M. Johnston 14:56:07 up 21 days, 6:26, 3 users, load average: 0.48, 0.25, 0.21 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec question
I think that ALL files in other location are parsed, it does not need to be named php.ini Chris Blake wrote: On Wed, 2003-10-08 at 14:51, Marek Kilimajer wrote: Did you edit the right php.ini? Check out phpinfo() output for "Configuration File (php.ini) Path" Yep, tried that...it states /etc/php.ini, and lists other location of /etc/php/, but that directory doesn`t contain a php.ini file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: HTML Printing problem.
If you are using PHP on a Windows server then this might be an option: http://us4.php.net/manual/en/ref.printer.php -Rob -Original Message- From: php coder [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 4:13 PM To: [EMAIL PROTECTED] Subject: HTML Printing problem. Issue: HTML files are to large to print from the browser. We are creating reports that are ++5 mg in size. This is a real problem for the browser. We are on a network and can print directly from the server but this means we must convert the html to some printer friendly format. We are using many new standards such as http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] killing server process online
for that u need to connect to your server as the owner of that server process or 'root'. to do this you may want to look at the idea of sudo. but remember, it's only as secure as you make it. you need to know, what exactly are you doing with sudo. Enjoy Nitin - Original Message - From: "Michael P. Carel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 08, 2003 10:13 AM Subject: Re: [PHP] killing server process online > yes i'm running this in a web server, is there any thing i can for this. I > want to kill a server process in a web browser. > > > > I'm guessing you're attempting to run this from the web server (hence > > the tags). Probably the web server doesn't own the process your > > attempting to kill. > > > > Cheers, > > Rob. > > > > On Tue, 2003-10-07 at 23:09, Michael P. Carel wrote: > > > Hi to all, > > > > > > I'm trying to create a script that will kill a server process via PID, > but > > > as i run the script it doesnt kill the process . And yet I want to add > some > > > error mesage. > > > > > > Here's my sample script: > > > > > > function killprocess($id){ > > > system('kill'. escapeshellarg($id), $killret); > > > if ($killret=="0"){ > > >//echo success message > > >?>