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
Old 01-30-2012, 02:22 PM upload script
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
Hello,

I am trying to write an upload script but this is my first time and i'm a bit confused. i have read online that i need to use enctype="multipart/form-data" in the form? so now my question is i also have two more fields one is txt and the other one is to store html, would that work to store all 3 fields with the same form or do i need a separate form one for the picture and another one for the text fields?

thanks
stivens is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-30-2012, 02:39 PM Re: upload script
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
No, it's perfectly fine to combine any form elements in the same form.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 01-30-2012, 02:41 PM Re: upload script
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
Thanks for the info i will try that
stivens is offline
Reply With Quote
View Public Profile
 
Old 01-30-2012, 09:35 PM Re: upload script
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
Hello,

One of the fields is a textarea where i plan to store html in the db and then display it on the page as html but im having trouble with this. This is the html code on the page

Si usted es ABOGADO o esta buscando UNO, aprenda en forma <span class="Estilo7">GRATUITA</span> como utilizar esta Herramienta!

so i added that on the db in phpmyadmin when i display it is fine this is what i do

<p align="center" class="Estilo3"><?php echo $row['first_line']; ?><br />

in another page i have a textarea where the user would be able to update that line,

<textarea name="fline" id="fline" cols="95" rows="6" value="<?php echo $fline; ?>"></textarea>

this line only displays this part of the data in that row. GRATUITA</span> como utilizar esta Herramienta"!

im not very familiar how to store this html in the db and display it back on the page, i read online suggestions about using htmlspecialchars() i tried it but no success :/ any help would be greatly appreciate it thanks...
stivens is offline
Reply With Quote
View Public Profile
 
Old 01-31-2012, 08:01 AM Re: upload script
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I think your most immediate problem is that you're using a "value" attribute on your textarea. The textarea tag does not have any value attribute, it's content should be put in between the opening and closing tags, as in
HTML Code:
<textarea name="fline" id="fline" cols="95" rows="6"><?php echo $fline; ?></textarea>
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 01-31-2012, 08:48 PM Re: upload script
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Also if you want to populate a form element with any text you should convert it into html entites.

PHP Code:
<textarea name="fline" id="fline" cols="95" rows="6"><?php echo htmlentities($fline); ?></textarea>
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to upload script
 

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