I'm sorry if these questions are pretty simple or have been answered before. I just started teaching myself PHP a week ago.
I'm trying to set up a page for users to input humor/news articles. Here's a very basic run-down of the psuedo-code:
If the user has submitted an article
{
upload article and images into database
}
else
{
If the user is previewing an article
{
Display article with POST variables
}
Display article submission form with values previously entered (if there are any)
Preview button makes the page call itself
Submit button makes the page call itself
}
That's pretty much all there is to it. I have the following problems:
1) some of the input areas on my form are of type TEXTAREA. They are not retaining the information put into them after you hit preview, although the information is showing up in the article preview. Here is a code sample of what I am trying to do:
<TEXTAREA name="paragraph1" rows="10" cols="50" value="<?php echo $paragraph1?>"></TEXTAREA><BR><BR>
2) some of the input areas on my form are of type file (for the locations of images to upload). These are not retaining their values either. Here's a code sample of that:
<INPUT name="pic1" type="file" size="37" value="<?php echo $pic1?>"><BR>
I also tried this with no luck:
<INPUT name="pic1" type="file" size="37" value="<?php echo $pic1_name?>"><BR>
3) I can get the image size of the images uploaded to a temporary location, but they are not displaying in my preview of the article. Can I display them from the temporary location or do I have to move them to a permanent location first? Is there a way I could display them from their original location (i.e. user's hard drive)?
Thanks in advance for any help.
I'm trying to set up a page for users to input humor/news articles. Here's a very basic run-down of the psuedo-code:
If the user has submitted an article
{
upload article and images into database
}
else
{
If the user is previewing an article
{
Display article with POST variables
}
Display article submission form with values previously entered (if there are any)
Preview button makes the page call itself
Submit button makes the page call itself
}
That's pretty much all there is to it. I have the following problems:
1) some of the input areas on my form are of type TEXTAREA. They are not retaining the information put into them after you hit preview, although the information is showing up in the article preview. Here is a code sample of what I am trying to do:
<TEXTAREA name="paragraph1" rows="10" cols="50" value="<?php echo $paragraph1?>"></TEXTAREA><BR><BR>
2) some of the input areas on my form are of type file (for the locations of images to upload). These are not retaining their values either. Here's a code sample of that:
<INPUT name="pic1" type="file" size="37" value="<?php echo $pic1?>"><BR>
I also tried this with no luck:
<INPUT name="pic1" type="file" size="37" value="<?php echo $pic1_name?>"><BR>
3) I can get the image size of the images uploaded to a temporary location, but they are not displaying in my preview of the article. Can I display them from the temporary location or do I have to move them to a permanent location first? Is there a way I could display them from their original location (i.e. user's hard drive)?
Thanks in advance for any help.