[PHP] Display strings with single quotes
Hi all, Have simple but annoying issue, I want to display a string within an input field. This string contains ' so when it's being display the, anything after the ' is being left out. Here is the code I'm using: $string = str_replace(', '', $string); $string = stripslashes($string); echo input type=text name='value' size=20 value = '$string'; Thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Display strings with single quotes
Thanks everyone! -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: 20 February 2003 13:40 To: [EMAIL PROTECTED] Subject: Re: [PHP] Display strings with single quotes On Thursday 20 February 2003 20:26, Ernest E Vogelsinger wrote: At 13:16 20.02.2003, Tom Rogers said: [snip] Rec Have simple but annoying issue, I want to display a string within an Rec input field. This string contains ' so when it's being display the, Rec anything after the ' is being left out. Here is the code I'm using: Rec $string = str_replace(', '', $string); Rec $string = stripslashes($string); Rec echo input type=text name='value' size=20 value = '$string'; Pass the string through htmlentities(); before you echo it. [snip] htmlentities won't work with single quotes, use addslashes: Addslashes will have no effect. HTML does not recognize the \ character as an escape character. That's a PHP concept. Actually just (only) htmlentities() will do. See manual for options regarding whether to encode single-quotes and double-quotes. input type='text' name='value' size='20' value=' . htmlentities(addslashes($string)) . '; But, you're right that this won't work. htmlentities() by itself will leave single quotes alone. What you want to use is htmlentities($string,ENT_QUOTES); which will convert single and double quotes to entities. ---John Holmes... -- 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] What are the functions to copy a directory structure then rename?
Hi all, I want to copy an already existing directory structure with generic files then rename it while keeping it's permissions, but I was unable to find a suitable function in the manual to carry out this operation. Can anyone help me with this please. Thank you Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can you execute UNIX scripts from PHP
Hi everyone, How can you execute UNIX scripts from PHP. If somebody could let me know it would be great. Thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can you execute UNIX scripts from PHP
Hi Kevin, Thanks very much for your reply, but I'm having no luck with it. In the test that I'm doing, I'm using the same code as you provided. It's on a Solaris system the permissions ownership of the shell script is correct. The shell script is also located in the same directory as the php file. All the shell script is doing is creating a file works grand when run from the command line. Have you any ideas/thoughts on this? I'd really appreciate it! Thanks Dave -Original Message- From: Kevin Waterson [mailto:[EMAIL PROTECTED]] Sent: 18 February 2003 13:26 To: [EMAIL PROTECTED] Subject: Re: [PHP] How can you execute UNIX scripts from PHP This one time, at band camp, [EMAIL PROTECTED] wrote: Hi everyone, How can you execute UNIX scripts from PHP. If somebody could let me know it would be great. if you have a shell script called blah.sh $script = 'blah.sh'; exec($script); system($script); // my favourite or if you like you could do `blah.sh` // backticks Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- 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] How can you execute UNIX scripts from PHP
My mistake Kevin, I did not put the full path of the shell script into the $script variable. Thanks very much for your help Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 18 February 2003 14:21 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] How can you execute UNIX scripts from PHP Hi Kevin, Thanks very much for your reply, but I'm having no luck with it. In the test that I'm doing, I'm using the same code as you provided. It's on a Solaris system the permissions ownership of the shell script is correct. The shell script is also located in the same directory as the php file. All the shell script is doing is creating a file works grand when run from the command line. Have you any ideas/thoughts on this? I'd really appreciate it! Thanks Dave -Original Message- From: Kevin Waterson [mailto:[EMAIL PROTECTED]] Sent: 18 February 2003 13:26 To: [EMAIL PROTECTED] Subject: Re: [PHP] How can you execute UNIX scripts from PHP This one time, at band camp, [EMAIL PROTECTED] wrote: Hi everyone, How can you execute UNIX scripts from PHP. If somebody could let me know it would be great. if you have a shell script called blah.sh $script = 'blah.sh'; exec($script); system($script); // my favourite or if you like you could do `blah.sh` // backticks Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding a variable to oracle that contains quotation marks??
Hi All, I'm trying to add a variable to an oracle database but it fails due to the fact that it contains quotation marks. These have to be present for the end user. My Script is as follows: === if ($conn == true) { $query = UPDATE ACTIVITY SET COMMENTS = '$updatecomments' WHERE ACTIVITY_ID = '$actcode'; $cursor = Ora_Open ($conn); $result = Ora_Parse ($cursor, $query); $result = Ora_Exec ($cursor); ora_close($cursor); Ora_Logoff($conn); } === Can anyone tell me what to do! Thank you Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Adding a variable to oracle that contains quotation marks??
Thanks Rick Henry, but I am still unable to add single quotation marks '. When I added the \' to the variable as given below (thanks again Rick) I get the following error when trying to add anything, regardless of ': Warning: Ora_Parse failed (ORA-00911: invalid character -- while processing OCI function OPARSE) in /services/apache_1.3.22/www-dev/isg/isg_tools/activitytracker/admin/selectac tivity.php on line 28 Perhaps I'm missing something very small? I have done a stripslash on the variable also, but with no extra success! Any ideas? Dave P.S. Henry, the double quotation is ok. -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: 21 January 2003 13:12 To: Rick Emery; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Adding a variable to oracle that contains quotation marks?? Once you use double quota mark the character BackSlash doesn't need anymore that's my experience ^_^ - Original Message - From: Rick Emery [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 21, 2003 8:56 PM Subject: Re: [PHP] Adding a variable to oracle that contains quotation marks?? $query = UPDATE ACTIVITY SET COMMENTS = \'$updatecomments\' WHERE ACTIVITY_ID =\'$actcode\'; - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 21, 2003 6:53 AM Subject: [PHP] Adding a variable to oracle that contains quotation marks?? Hi All, I'm trying to add a variable to an oracle database but it fails due to the fact that it contains quotation marks. These have to be present for the end user. My Script is as follows: === if ($conn == true) { $query = UPDATE ACTIVITY SET COMMENTS = '$updatecomments' WHERE ACTIVITY_ID = '$actcode'; $cursor = Ora_Open ($conn); $result = Ora_Parse ($cursor, $query); $result = Ora_Exec ($cursor); ora_close($cursor); Ora_Logoff($conn); } === Can anyone tell me what to do! Thank you Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I remove the last character from a one line file?
Hi all, The problem is nearly solved. I need my if statement to read the last character from the file if it ends with an o, then remove the one character. My current if statement allows the action to take place if there is an o anywhere in the file. Can somebody help me with this. My current if statement looks like this: if (eregi (.*\b,$port)){ $port=substr($port,0,(strlen($port)-1)); } Thanks alot Dave -Original Message- From: Rea, David Sent: 28 May 2002 15:46 To: 'Ed Gorski' Subject: RE: [PHP] How can I remove the last character from a one line file? That worked a dream, Thanks Ed! Dave -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: 28 May 2002 14:41 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] How can I remove the last character from a one line file? Try: $string=Jacko; $string=substr($string,0,(strlen($string)-1)); echo $string; ed At 09:35 AM 5/28/2002 -0400, [EMAIL PROTECTED] wrote: Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Edmund Gorski Programmer / Analyst WWW Coordinator Dept. @ District Office 727-341-3181 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I remove the last character from a one line file?
Hi all, How can I remove the last character from a one line file? i.e. I need to change Jacko to Jack I would really appreciate a response on this! Thank you! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Directory Contents Listing
Here's an example code I use ? // print the current directory in unordered list print(UL\n); // get each entry within the directory return to user with the link $myDirectory = dir(.); while($entryName = $myDirectory-read()) { if ($entryName != . $entryName != .. $entryName != index.php){ print(LIa href=$entryName$entryName \n/a); } } ? Hope it helps! -Original Message- From: Steve Werby [mailto:[EMAIL PROTECTED]] Sent: 28 November 2001 05:39 To: Deependra B. Tandukar; [EMAIL PROTECTED] Subject: Re: [PHP] Directory Contents Listing Deependra B. Tandukar [EMAIL PROTECTED] wrote: How do I display the directory contents using PHP? See readdir() in the online manual. I'm pretty sure it even has example code you could paste in. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- 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]