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
a question about form input
Old 08-31-2009, 01:24 AM a question about form input
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
hey guys I do basic php stuff but I am no pro

I created a form and php file that lets me ad articles to my site and it works well here is where I am stuck.

when I type or paste in an article I first paste it into notepad and replace " with \"
and that works fine. But would some one tell me the code to use in my php file to replace the " with \" as the input from the form is being processed by my file.

so I can cut out the extra step with notpad.

Thanks in advance.
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
 
Register now for full access!
Old 08-31-2009, 04:47 AM Re: a question about form input
Bertjeuh's Avatar
Average Talker

Posts: 25
Name: Bert Van Leemput
Trades: 0
You mean addslashes() ?

http://be2.php.net/addslashes
__________________
There Are Only 10 Types of People in the World: Those Who Understand Binary, and Those Who Don't.
Bertjeuh is offline
Reply With Quote
View Public Profile
 
Old 08-31-2009, 03:46 PM Re: a question about form input
Extreme Talker

Posts: 181
Name: David Jackson
Trades: 0
then when displaying you can use

stripslashes()

http://uk3.php.net/stripslashes
__________________

Please login or register to view this content. Registration is FREE
davidj is offline
Reply With Quote
View Public Profile
 
Old 08-31-2009, 08:21 PM Re: a question about form input
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
I had a little trouble figuring the syntax but I got it thanks a bunch.

The input from the form is being written to a php file thats why I needed the slashes added. it works perfect now I can skip the notepad step. Now if I can get the string replace right I use the article name as the filename so I need to add _ between each word If I can get that to work the scrip will be nice for a beginner.
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Old 08-31-2009, 08:42 PM Re: a question about form input
NullPointer's Avatar
Will Code for Food

Posts: 2,784
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by bmcoll3278 View Post
Now if I can get the string replace right I use the article name as the filename so I need to add _ between each word If I can get that to work the scrip will be nice for a beginner.
So you just need to replace each space with an underscore?

PHP Code:
str_replace(' ''_'$myStr); 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 09-11-2009, 12:51 AM Re: a question about form input
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
Just wanted to stop and say thanks for the help it was very easy after seeing your posts.
I have just never used adslashes before and did not even think about it, So thanks again for the help
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Reply     « Reply to a question about form input
 

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.42309 seconds with 12 queries