Jump to content

Recommended Posts

if(isset($_POST['Submit']) && !$errors)
{
echo "<h1>Video uploaded!</h1>";

$sel3=mysql_query("SELECT * FROM `users` WHERE `id`=".$_SESSION['uid']."") OR die(mysql_error());
$rowt3=mysql_fetch_array($sel3);
    	$reply = $_POST['reply'];
            $sql4 = "INSERT INTO `videos` (`path`,`uid`,`vidname`) VALUES ('videos/".$image_name."','".$row['id']."','".$reply."')";
            $res4 = mysql_query($sql4) or die(mysql_error());

}

?>



<!--next comes the form, you must set the enctype to "multipart/frm-data" and use an input type "file" -->
<form name="newad" method="post" enctype="multipart/form-data" action="">
<table>
<tr><td class=\"forum_header\" ><input type="file" name="image"></td></tr>
<tr><td class=\"forum_header\" ><input type="text" name=\"reply\"></td></tr>
<tr><td class=\"forum_header\" ><input name="Submit" type="submit" value="Upload video"></td></tr>
</table>
</form>

 

For some reason, it puts the path and uid into the respective fields, bur $reply won't go into vidname?

Link to comment
https://forums.phpfreaks.com/topic/175601-_post/
Share on other sites

The \ escape characters in -

 

name=\"reply\"

 

cause the POST index name to literally contain the double-quote characters. Why are those \ escape characters in there? You don't have them on any of the other name="..." attributes that do work.

Link to comment
https://forums.phpfreaks.com/topic/175601-_post/#findComment-925317
Share on other sites

$sql4 = "INSERT INTO `videos` (`path`,`uid`,`vidname`)

VALUES ('videos".$image_name."','".$row['id']."','".$reply."')";

 

 

 

  \" .  .\"        -- this is how you can use php variable in between with double quotations

  \'.  .\'          -- with single quotation 

 

wrong;

VALUES ('videos".$image_name."',

 

 

you can concat string with this variable.

$videos = videos . $image_name;

 

and follow the syntax shown above

correct;

VALUES (\" .  $videos  .\"  ,

 

 

Link to comment
https://forums.phpfreaks.com/topic/175601-_post/#findComment-925327
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.