NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Strings

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 04-27-2007, 10:48 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



[resolved] Strings


Ok i am trying to add bbcode into one of my pages and here is where im having trouble:
Code:
$string = "text"
I want "Text" to echo the users quote in the database:

Code:
$string = "$fetch->quote"
But i get a Parse Error
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Last edited by Mike_Wiseman; 04-27-2007 at 12:02 PM.
Mike_Wiseman is offline  
Old 04-27-2007, 11:11 AM   #2 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Try This:
PHP Code:
$string $fetch->quote
????: NamePros.com http://www.namepros.com/programming/321510-strings.html
Barrucadu is offline  
Old 04-27-2007, 11:18 AM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



i did that but then i have this error:
Parse error: syntax error, unexpected '=' in /home/mafiamay/public_html/a/profile.php on line 105

line 105:
Code:
	$bb-replace = array('','','','');
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Mike_Wiseman is offline  
Old 04-27-2007, 11:50 AM   #4 (permalink)
Tech Support
Join Date: Mar 2005
Posts: 4,944
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Originally Posted by Mike_Wiseman
i did that but then i have this error:
????: NamePros.com http://www.namepros.com/showthread.php?t=321510
Parse error: syntax error, unexpected '=' in /home/mafiamay/public_html/a/profile.php on line 105

line 105:
Code:
	$bb-replace = array('','','','');
PHP Code:
$bb->replace = array('','','',''); 
Eric is offline  
Old 04-27-2007, 12:02 PM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



nvm problem fixed.
i just had to echo the $string
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Mike_Wiseman is offline  
Old 04-27-2007, 01:04 PM   #6 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Also, if you are going to use a class function inside of double quotation marks, you need to enclose it in brackets.

Example:
PHP Code:
<?php echo "{$fetch->quote}"?>
(Yes, I know it's dumb to do it this way if you are only going to echo the one function/variable. It's an example. )
????: NamePros.com http://www.namepros.com/showthread.php?t=321510



Dan is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:20 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger