SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old February 12th, 2004, 02:36 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Exclamation MAJOR Problem with function in PHP

Hello everyone!
I've created a function which replaces some input into images. A function to parse smilies in a weblog:
PHP Code:
<?php
function setsmile($messsge){

    
$message htmlspecialchars(trim(stripslashes($message)));

    
$message str_replace(":)""<img src='images/smiles/bigsmile.gif'>"$message);
    
$message str_replace(":@""<img src='images/smiles/angry.gif'>"$message);
    
$message str_replace(":|""<img src='images/smiles/dunno.gif'>"$message);
    
$message str_replace(":!""<img src='images/smiles/expla.gif'>"$message);
    
$message str_replace(":~""<img src='images/smiles/grrr.gif'>"$message);
    
$message str_replace("\-/""<img src='images/smiles/hypno.gif'>"$message);
    
$message str_replace("*lol*""<img src='images/smiles/lol.gif'>"$message);
    
$message str_replace(":p""<img src='images/smiles/luna.gif'>"$message);
    
$message str_replace(":--""<img src='images/smiles/lyer.gif'>"$message);
    
$message str_replace(":-|""<img src='images/smiles/maybe.gif'>"$message);
    
$message str_replace("*mmm*""<img src='images/smiles/mmm.gif'>"$message);
    
$message str_replace(":pp""<img src='images/smiles/phatluna.gif'>"$message);
    
$message str_replace(":?""<img src='images/smiles/question.gif'>"$message);
    
$message str_replace(":(""<img src='images/smiles/unhappy.gif'>"$message);

    
$message nl2br($message);

    return(
$message);
}
?>

This function is located in a seperate file so I can use it on my guestbook too. The problem is that when I call the function in my script, there is no output at all!!
PHP Code:
include("function.php");
$string setsmile($string);
print 
$string

Can you people help me?

Reply With Quote
  #2  
Old February 12th, 2004, 07:07 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
In your function, you've misspelled the parameter in parentheses ($messsge). Took me a few minutes of puzzling over the code to spot it.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old February 12th, 2004, 10:09 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Thumbs up

Quote:
Originally Posted by dhouston
In your function, you've misspelled the parameter in parentheses ($messsge).

Ahh!!! Sorry I've wasted your time... But thank you for seeing this!!!

Reply With Quote
  #4  
Old February 12th, 2004, 01:27 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Not a problem.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Problem with function in PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway