Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
comment in the same page
Old 09-13-2010, 12:30 AM comment in the same page
gongpex's Avatar
Experienced Talker

Posts: 36
Name: gong
Trades: 0
hi everyone,

I am a beginner in php, I want to ask how do I make that comment can be displayed on the same page, I've tried using the "http_post_vars" but, it's always displayed on different pages, I hope someone can help me

for example:http://www.theeldergeek.com/change_t...art_button.htm

and give "smiles" like post thread of this forum

thank you very much
gongpex is offline
Reply With Quote
View Public Profile Visit gongpex's homepage!
 
 
Register now for full access!
Old 09-13-2010, 07:10 AM Re: comment in the same page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
POST to the same page and have the code receive the input in that page.

"smilies" are a little bit more complicated, you have to parse the text and replace the bbcode with an image element.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-17-2010, 11:04 PM Re: comment in the same page
gongpex's Avatar
Experienced Talker

Posts: 36
Name: gong
Trades: 0
Can you explain with write the html code and php script for me? please

thank you for your attention
gongpex is offline
Reply With Quote
View Public Profile Visit gongpex's homepage!
 
Old 09-18-2010, 07:02 PM Re: comment in the same page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The smiley replacement code will be something like:
PHP Code:
$text 'Smile Please :)';
$filepath "/images/smilies/"

$codes= array(":D",":)",":(",";)");
$smiley= array("grin.gif","smile.gif","sulk.gif","wink.gif");

$outtext = (str_replace($codes,'<img src="$filepath . $smiley" alt="smiley" />',$text)); 
Obviously a quick and simple example (and not actually tested )
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-18-2010, 07:43 PM Re: comment in the same page
dreamconception's Avatar
Average Talker

Posts: 26
Name: Dan
Trades: 0
Yes chrishirst it looks about right (though I'm unsure if you can just put the replace like that.

You can POST the form to the same page by putting ? in the action variable (action="?").
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
dreamconception is offline
Reply With Quote
View Public Profile Visit dreamconception's homepage!
 
Reply     « Reply to comment in the same page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49161 seconds with 12 queries