[PHP] Server Help
I recently realized users are able to access my base document root using opendir() and readdir()... I find this to be a big security risk.. I am wondering if anyone knows of any ways to limit it so that the user can only usephp on his level,and not be able to access any server files. I hope that makes sense, heh.. If you need more info,say say.. Oh,btw,its a unix server. -Andy L -- 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] disable_features
Hello, I am wondering if there is any way to limit the disable_feature command to certain directories, and if so, could I please see an example? Thanks, Andy -- 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] Echo/Print
I am fairly new to PHP Scripting, and I am learning from a book. Throughout the book, print is used as the basic command to output text/variables.. yet I see almost everyone in here uses echo. Might I ask what the differences of the two are, and if there are any benefits of using one over the other? Thanks, Andy -- 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] Re: escaping special charecters upon submit
http://www.php.net/manual/en/function.addslashes.php That should work fine. -Andy <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I have a form that submits data to a database, works great until > someome > > puts in an apostrophe in the comments area...how do i escape this > > charecter upon > > insert? > > > > -- 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]
Re: [PHP] Echo/Print
Thanks! Helped a lot. -Andy Jeff Oien <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You can read the notes lower on the page here to get a good idea: > http://www.php.net/manual/en/function.print.php > Jeff Oien > > > I am fairly new to PHP Scripting, and I am learning from a book. > > Throughout the book, print is used as the basic command to output > > text/variables.. yet I see almost everyone in here uses echo. Might I ask > > what the differences of the two are, and if there are any benefits of using > > one over the other? > > Thanks, > > Andy > > > > > > > > -- > > 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]
[PHP] disable_functions....
Does anyone know if its possible to use disable_functions on only specified directories, and not all? Hopefully its possible.. -- 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]
Re: [PHP] disable_functions....
Thanks.. D'you think you'd be able to give me an example? (Sorry, I am _quite_ new to all of this...) -Andy Rasmus Lerdorf <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Any php.ini directive can be used in your httpd.conf on a per-dir basis. > See the manual.. > > -Rasmus > > On Sat, 25 Aug 2001, Andy Ladouceur wrote: > > > Does anyone know if its possible to use disable_functions on only specified > > directories, and not all? > > Hopefully its possible.. > > > > > > > > > -- 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] Cookieless =(
I love cookies. I hate it when they dont work. I was previously accessing cookies by just using their name (I had global_vars turned on), I recently decided to turn it off(for security reasons) and I can no longer even set cookies? Yes,cookies are enabled and everything..in fact,I never even touched any of the cookie functions.. thats what I dont get... anyone have any ideas on what could be wrong? (And yes, im using $HTTP_Cookie_VARS["cookiename"]; to access (try and access, that is) them now.. Anyone know what might be wrong? Any helps appreciated, thanks. -Andy -- 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] Re: appear in Text file
Hi Jack, The 'black box' you see is a newline, which can be removed by doing this: $string=str_replace("\n","",$string); $string=str_replace("\r","",$string); That will replace \n (The newlines) and \r (The returns) with nothing, getting rid of your problem. Hope this helps, -Andy Jack <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dear all > I'm writing a script which will greb the data from a user input form into a > text file (txt file), but the problem is that when the data had passed to > the txt file, there will be some thing like the and black square appear > inside the file. This is affecting to display the data from that txt file to > the text box in (input box). > Is there anyway that i can do to avoid grebing the from txt file to my > input box's value? or anyway that i can delete the when the data is > greb from input box to txt file?? > > Thanks a lot > > Jack > [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]
[PHP] $HTTP_POST_VARS
Hello all, I am wondering if there is a command or function to get a list of all the current '$HTTP_POST_VARS["variable"]' variables? Or, a user-created way... Any helps appreciated, thanks! -Andy L. -- 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]
Re: [PHP] $HTTP_POST_VARS
Ah, its that simple? -feels likea bit of an idiot- Thanks for the help! Tim <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > while (list($k,$v) = each($HTTP_POST_VARS)) { > echo "$k = $v"; > } > > On Mon, 2001-08-27 at 21:48, Andy Ladouceur wrote: > > Hello all, > > I am wondering if there is a command or function to get a list of all the > > current '$HTTP_POST_VARS["variable"]' variables? Or, a user-created way... > > Any helps appreciated, thanks! > > -Andy L. > > > > > > > > -- 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]
Re: [PHP] $HTTP_POST_VARS
Thanks! -Andy Jason Murray <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am wondering if there is a command or function to get a > > list of all the current '$HTTP_POST_VARS["variable"]' variables? > > Or, a user-created way... Any helps appreciated, thanks! > > You can use var_dump($HTTP_POST_VARS); > > Jason -- 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] Re: Need help on putting variable into
Well,think about it like this: If you did replace $comp name with ABC Company, this is what you'd get: Not quite right, eh? This will solve your problem: print ""; =) -Andy Hugh Danaher <[EMAIL PROTECTED]> wrote in message 001201c12f71$75a45b40$c1fcb3d1@win95">news:001201c12f71$75a45b40$c1fcb3d1@win95... Help. I have a page with a form with lots of text boxes which can be filled with data from a text file. the fopen() and fgets() works, and the text boxes which require numbers have no problems. But, I have text boxes which require several words of text and they refuse to work right. The first word makes it in the box, but the rest of the words are lost. As an example, the data file contains: ABC Company, Inc. in the spot for $comp_name. If I call for this variable elsewhere outside of a text box, it prints in full, but when used by the following, it prints only: ABC print ""; There must be something blindingly obvious that I'm missing. Please help. Thanks, Hugh -- 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]
Re: [PHP] Re: Need help on putting variable into
No problem. With the space in there, it considered Company as something separate... -Andy Hugh Danaher <[EMAIL PROTECTED]> wrote in message 000801c12f74$62b93020$3907f4d8@win95">news:000801c12f74$62b93020$3907f4d8@win95... > Andy, > Thank you. It Works! > Hugh > - Original Message ----- > From: Andy Ladouceur <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, August 27, 2001 8:35 PM > Subject: [PHP] Re: Need help on putting variable into > > > > Well,think about it like this: > > If you did replace $comp name with ABC Company, this is what you'd get: > > > > > > > > Not quite right, eh? This will solve your problem: > > print ""; > > > > =) > > -Andy > > Hugh Danaher <[EMAIL PROTECTED]> wrote in message > > 001201c12f71$75a45b40$c1fcb3d1@win95">news:001201c12f71$75a45b40$c1fcb3d1@win95... > > Help. I have a page with a form with lots of text boxes which can be > filled > > with data from a text file. the fopen() and fgets() works, and the text > > boxes which require numbers have no problems. But, I have text boxes > which > > require several words of text and they refuse to work right. The first > word > > makes it in the box, but the rest of the words are lost. > > > > As an example, the data file contains: ABC Company, Inc. in the spot for > > $comp_name. If I call for this variable elsewhere outside of a text box, > it > > prints in full, but when used by the following, it prints only: ABC > > > > print ""; > > > > There must be something blindingly obvious that I'm missing. Please help. > > Thanks, Hugh > > > > > > > > > > > > > > -- > > 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]
[PHP] Re: Formatting Dates in Form before submit
PHP is a processed before the output is sent to the browser, so a dynamic change like what you want with it isn't possible. And unfortunately,I dont know any JScript, or VBScript, so I can't help ya there.. =/ -Andy Traci P Sumpter <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Can anyone tell me how to use the > strtotime function within the on change > event of a text box?? > > I need to format the date before submit > the form because once it submits it > dynamically creates a SQL statement. Is > it best to use vbscript or Jscript and > if so how? > > Thanks in advance. > > -- 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] Disabling certain functions per directory
I'd like to use the disable_functions command from the php.ini file to disable certain functions for certain directories. I know it has to do with the httpd.conf file, but have no clue on how to go about doing it, can someone please post an example for me?With the directory I want things disabled in as '/var/www/htdocs/example/' and the base directory being '/var/ww/htdocs/' I hope someone can help, thanks.. -Andy -- 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] Re: foo? bar? wtf?
Foo, and Bar, dont mean anything. They are simply example $vars for php... I was confused on this for a while, too... -Andy Seb Frost <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Why is it that every example uses foo and bar. In my head I put these > together to get FUBAR, the meaning of which I won't spell out for Kyle's > benefit. > > Is this what foo and bar refer to? And WHY are they used so extensively? > > - seb > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001 > -- 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] Re: Finding value in multi-dimensional array
Verdon Vaillancourt wrote: Hi, being somewhat of a noob, I hope I'm using the right language to phrase this question... In a project I am working with, I have a multi-dimensional array in session when a user logs in. Visually, it looks something like this... OBJ_user username => value isAdmin => value modSettings => contacts => array news => array listings => firstname => value lastname => value active => value phone => value gallery => array anothermod => array userID => value js => value I'm trying to check the value of active for an if() statement and can't seem to figure out the correct syntax to get it to work. I've tried if($_SESSION["OBJ_user"]->modSettings["listings"]->active == "1") { then do something; } else { then do something else; } if($_SESSION["OBJ_user"]["modSettings"]["listings"]["active"]) { then do something; } else { then do something else; } if($_SESSION["OBJ_user"]["modSettings"]["listings"]["active"] == "1") { then do something; } else { then do something else; } and none of them work even though I know the session value is there. Any advice as to what I'm doing wrong? Thanks, verdon The second of your three attempts should work fine, as should the third. Are you certain the actual value of active isn't 0? Try echoing the value of it to the screen, or do a print_r($_SESSION['OBJ_user']) to check the values and structure of the whole multidimensional array. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: timestamp to readabe date and time ?
The second parameter of PHP's date() function takes a timestamp as an argument, this may be what you're looking for? Andy Damian Brown wrote: I need to output a date and time that shows more clearly than just outputting the timestamp what is the correct way to go about it ? I have looked at getdate(), but I haven't fathomed it out yet ! -- www.phpexpert.org/truefaith.htm "True Faith is not just when you believe in God and yourself, it is when others begin to believe in you as well" - Damian John Paul Brown 2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: timestamp to readabe date and time ?
And these are UNIX timestamps? Odd. I can't see date giving the wrong output, could you post the timestamp you're using? Thanks Andy Damian Brown wrote: I have tried that, but it gives a date in the future and all records have the same time the code is and it gives an output of Monday 18th of January 2038 10:14:07 PM I need it to proces the timestamp in the database table so that it shows the different times Thanks in advance for a solution The second parameter of PHP's date() function takes a timestamp as an argument, this may be what you're looking for? Andy Damian Brown wrote: I need to output a date and time that shows more clearly than just outputting the timestamp what is the correct way to go about it ? I have looked at getdate(), but I haven't fathomed it out yet ! -- www.phpexpert.org/truefaith.htm "True Faith is not just when you believe in God and yourself, it is when others begin to believe in you as well" - Damian John Paul Brown 2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: trying to output a hyperlink
When in doubt, view source. :) As John has already mentioned, you need text between the two tags to actually display in the browser. You probably would've seen your mistake a lot sooner if you viewed the page source when you first tried it out. Also, you can save yourself some time using PHP's shorthand concatenation operator. >$link = $link . $row[2] . '">' ; > $link = $link . '' ; > echo $link ; ?> Turns into: '; $link .= 'Click here'; echo $link; ?> Although, it could be shortened even more, to: Click here"; echo $link;?> But I imagine you're doing it with more lines for legibilities' sake. Andy Damian Brown wrote: ' ; $link = $link . '' ; echo $link ; ?> is not working, I want to output $row[2] as a hyperlink as it is the refering URL, but the above is just showing blank in the output, with no link and no text in the output table -- www.phpexpert.org/truefaith.htm "True Faith is not just when you believe in God and yourself, it is when others begin to believe in you as well" - Damian John Paul Brown 2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why doesn't this work ?
It's already been mentioned, but you do need to ensure you are using a .php extension on the file. Also, forgive me if this has already been covered, but are you sure the server even supports PHP? Try creating a new file with: And save it as something.php, check and see if it returns a table full of information or not. Andy Pooya Eslami wrote: I put this in the body of an html file: $file font>"; } } closedir($handle); } echo ""; ?> the output page contains : $file "; } } closedir($handle); } echo " "; ?> I don't understand why. "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Can you post the code and error. I took out the scrip tags and put in at the end, but it returns this: $file "; } } closedir($handle); } echo " "; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why doesn't this work ?
Okay, what you can do is try use an .htaccess file (providing your host allows them) to make the PHP engine parse .html files. Create a file titled ".htaccess" with the following contents: AddType application/x-httpd-php .php .php3 .html .htm Upload it to the same folder that the .html file is in, and see if it works. (Oh, and if you are using WS_FTP LE, be sure to add '-al' in the white box on the right [Remote] vertical line of buttons so that you are able to view the .htaccess file in the folder once uploaded.) Cheers, Andy Pooya Eslami wrote: Yes, the server supports php, and I don't want to make it into a php file because its a big html file and I just need this little script on it. Why cannot I embed php in html files? "Andy Ladouceur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] It's already been mentioned, but you do need to ensure you are using a .php extension on the file. Also, forgive me if this has already been covered, but are you sure the server even supports PHP? Try creating a new file with: And save it as something.php, check and see if it returns a table full of information or not. Andy Pooya Eslami wrote: I put this in the body of an html file: $file font>"; } } closedir($handle); } echo ""; ?> the output page contains : $file "; } } closedir($handle); } echo " "; ?> I don't understand why. "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Can you post the code and error. I took out the scrip tags and put in at the end, but it returns this: $file "; } } closedir($handle); } echo " "; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: weird problem with index page
Try adding a trailing slash to the URL, and seeing if it works. If so, then try adding the apache configuration directive: UseCanonicalName off In either httpd.conf or an .htaccess file, and try accessing without the trailing slash. I had a similar issue and adding that fixed it. Andy Loll wrote: [snip]if I go to www.domain.com/subdir it sya s page not found even though there is a index.php file in that directory. I am at a loss as to what is wrong. index.php is listed inthe directoryindex for apache so I dont understand why it is doing all this. If anyone can help me it would be appreciated. Thanks Loll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forwarding to another PHP page
Ash.. wrote: Hello, Thanks John (Holmes) for the clue on form-param-reading. Simple one, but shows I got a lot of basics to learn yet. Here I have another doubt I cant resist asking help for. What are the various ways of forwarding to another page. I tried header().. based on an example I found it in, but it doesnt work if I have done an include before calling the header. What are the other alternatives of forwarding. (I tried searching the PHP manual, but didnt find any clue. Nor did I come across any learn material which seemed to deal with this.) Thanks for all help, Ash There are no other PHP methods for forwarding to another page. The header function will not work if any text (This includes spaces, linebreaks, etc.) has been output to the page. One way to circumvent this is using PHP's output buffer functions. http://ca2.php.net/ob_start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Looking for a comprehensive PHP tutorial
Ash.. wrote: Hi, I am looking for a comprehensive handholder tutorial, that introduces the various aspects of PHP, step by step and let's u see the big picture. I have come across tons of PHP learnware which is like "how to do this" and "how to do that". But that still doesn't introduce the language to the beginner in an orderly manner. Any suggestions, links, will be greatly appreciated. Or, if someone (experienced in PHP) thinks we must come up with such a comprehensive tutorial, we can perhaps team up ;) Ash http://www.oreillynet.com/pub/ct/29 OnLAMP's PHP Foundations tutorials are a great place to start. It's about as orderly as one could ask for. Start from the bottom. ;) Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php