Escape Chatacter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Escape Chatacter

Post by moiseszaragoza »

Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I am using a the define() function in php 

i have it set like :

Code: Select all

define('HEADING_TITLE', 'my title goes here');
but the problem is that i need to add a ' as part of one of my titles and i really fo not want to have to do

Code: Select all

define('HEADING_TITLE', 'my title' . " ' " .'goes here');
any ideas what can i do?

Thanks


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Use double quotes "my title go's here" or use a backslash to escape the quote 'my title go\'s here'
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Post by moiseszaragoza »

thanks

I was trying the / and got errors
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

You can also do it using ' instead of the ' (single quote).
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Rename File

Post by moiseszaragoza »

[QUOTE=moiseszaragoza]I am using

Code: Select all

$uploaddir = "images/photo_contest/";
				//echo($uploaddir);
				$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

				# echo '<pre>';
				if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
				   echo "Thank you $customer_first_name for submittig your image ";
				   mail("MyEmail@domain.com", "$uploadfile was uploaded","$uploadfile was uploaded" );
				} else {
				   echo "<span class='commingSoon'> The File was not Uploaded\n </span>";
				
				}

But I want to rename the file as soon as it gets uploaded i know i should add something here

Code: Select all

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
				   echo "Thank you $customer_first_name for submittig your image ";
                          # Rename code


can any one help me with the rename code[/QUOTE]
Post Reply