CircuitHost
11-07-2005, 07:59 PM
I have created a basic HTML/PHP script that updates the news section of my website. Everything is working well with the exception of this one problem.
My form is below for inserting/updating.
Date: (input=text)
Title: (input=text)
Content: (textarea)
-------------
When submitting, it works great! When I try to update the row of the table, everything updates correctly EXCEPT the title. If the title is one or more words, it cuts off every word but the frist word. Any ideas on how to get it so it will display the whole value in the text field when updating?
-------------
Need this fixed tonight if all possible.
** I will check back at 8:30 EST
--Thank you!
Burhan
11-07-2005, 08:09 PM
Check your quotes around the HTML.
<input type="text" name="text" value="hello "there" I want to talk about "this" thing" />
That will display a field with just hello in it.
Instead, if you were to use this:
<input type="text" name="text" value='hello "there" I want to talk about "this" thing"' /> you would see the expected result.
shoperotic
11-07-2005, 09:13 PM
Or maybe try with textarea instead of text input box.
CircuitHost
11-07-2005, 09:18 PM
Sorry- I forgot to enter my code. This is what isnt working :(
<input type=text name=title size=20 tabindex=2 value=$row[title]>
CircuitHost
11-07-2005, 09:43 PM
Board Closed, Thanks for the help. This is for someone else.
<?
// Upload settings
$folder = "files/"; // Folder in which to store files
$maxlimit = 10000000; // Set maximum file limit (in bits)
$allowed_ext = "doc,xls,pdf,txt"; // Set allowed extensions (split using comma)
$overwrite = "no"; // Allow file overwrite? yes/no
$match = ""; // Clear match variable; for security purposes
$filesize = $_FILES['userfile']['size']; // Get file size (in bits)
$filename = strtolower($_FILES['userfile']['name']); // Get file name; make it all lowercase
if(!$filename || $filename==""){ // File not selected
$error = "- No file selected for upload.<br>";
}elseif(file_exists($folder.$filename) && $overwrite=="no"){ // Check if file exists
$error = "- File already exists: $filename<br>";
}
// Check if file size
if($filesize < 1){ // File is empty
$error .= "- File size is empty.<br>";
}elseif($filesize > $maxlimit){ // File is more than maximum
$error .= "- File size is too big.<br>";
}
$file_ext = preg_split("/\./",$filename); // Split filename at period (name.ext)
$allowed_ext = preg_split("/\,/",$allowed_ext); // Create array of extensions
foreach($allowed_ext as $ext){
if($ext==$file_ext[1]) $match = "1"; // File is allowed
}
// File extension not allowed
if(!$match){
$error .= "- File type isn't allowed: $filename<br>";
}
if($error){
print "Error trying to upload file:<br> $error"; // Display error messages
}else{
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $folder.$filename)){ // Upload file
print "Success! The file has been uploaded: $filename";
}else{
print "Error! File size might exceed upload limit of server. Try again."; // Display error
}
}
?>
JNadolski
11-09-2005, 02:21 AM
You get the problem fixed?
BroadAndElmwood
11-09-2005, 10:57 AM
Sorry- I forgot to enter my code. This is what isnt working :(
Doublequotes are your friend.
:usflag: