Jump to content

Nina555

New Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Nina555

  1. Thank you, your question inspired me and i have fixed the problem
  2. $vi=mysql_query("SELECT * FROM videos WHERE id='$getid' LIMIT 1"); $v = mysql_fetch_object($vi);
  3. It should get information from form, and as you can see $my_array_of_vars is not defined too and that part add video works fine
  4. If you mean where is defined it's not defined neither $my_array_of_vars and that part works. P.S I am newbie in php -.-
  5. No there are no errors it just doesn't insert 'title' into database
  6. I am having similar issue with this code. I want to add "title". This script does not have write title option and I would like to add it to script, but it already has the add video option. That's why I tried to do something like this and I just can't get the script to insert title in the database, if you could help me with this one I would be very thankful. Here is the srcipt <? session_start(); include("../func/db_info".".php"); include("logincheck".".php"); logincheck(); $surl = $_SERVER['HTTP_HOST'] ; if (strip_tags($_POST['add'])){ $vidid=mysql_real_escape_string(strip_tags($_POST['vidid'])); $url = "$vidid"; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars); $t1=mysql_real_escape_string(strip_tags($_POST['tit1'])); $title="$t1"; parse_str( $title, $my_vars ); mysql_query("INSERT INTO `videos` (`id`, `videoid`, `views`, `title`) VALUES ('', '".$my_array_of_vars['v']."', '0', '".$my_vars['v']."');") or die (mysql_error()); $message="<img src=\"../img/tick-icon.jpg\">"; } if (strip_tags($_POST['rem'])){ $vidid2=mysql_real_escape_string(strip_tags($_POST['vidid2'])); $url = "$vidid2"; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); mysql_query("DELETE FROM videos WHERE id=".$my_array_of_vars['v'].""); $message2="<img src=\"../img/tick-icon.jpg\">"; } ?><head> <html xmlns:fb="http://ogp.me/ns/fb#"> <title>Admin Panel</title> <META name="robots" content="NOINDEX,NOFOLLOW" /> <link type="text/css" rel="stylesheet" href="../css/admin.css" /> <link href="../img/favicon.ico" rel="icon" type="image/x-icon" /> <body> <a href="index.php"><img src="../img/logo.png" border="0"></a> <div class="banner"><a href="index.php">Delete</a> - <a href="add.php">Add & Remove</a> - <a href="logout.php">Logout</a></div> <div align="center"><form id="form1" method="post" action=""> Youtube URL: <input type="text" name="vidid" id="vidid"> Title: <input type="text" name="tit1" id="tit1"> <input name='add' type='submit' id='add' value='Add Video' /> <? echo"$message";?><br><br> Website URL: <input type="text" name="vidid2" id="vidid2"> <input name='rem' type='submit' id='rem' value='Remove Video' /> <? echo"$message2";?><br><br> Example: <strong>http://<? echo"$surl"; ?>/watch.php?v=25</strong> </div> </form> </body>
  7. Hi, I am newbie in PHP and I got some script which I just can't get to insert title in database. I would be very thankful if you could help me with this. Here is the code. I hope that trg86 doesn't mind I got in his topic. $surl = $_SERVER['HTTP_HOST'] ; if (strip_tags($_POST['add'])){ $vidid=mysql_real_escape_string(strip_tags($_POST['vidid'])); $url = "$vidid"; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars); $t1=mysql_real_escape_string(strip_tags($_POST['tit1'])); $title="$t1"; parse_str( $title, $my_vars ); mysql_query("INSERT INTO `videos` (`id`, `videoid`, `views`, `title`) VALUES ('', '".$my_array_of_vars['v']."', '0', '".$my_vars['v']."');") or die (mysql_error()); $message="<img src=\"../img/tick-icon.jpg\">"; } if (strip_tags($_POST['rem'])){ $vidid2=mysql_real_escape_string(strip_tags($_POST['vidid2'])); $url = "$vidid2"; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); mysql_query("DELETE FROM videos WHERE id=".$my_array_of_vars['v'].""); $message2="<img src=\"../img/tick-icon.jpg\">"; } ?><head> <html xmlns:fb="http://ogp.me/ns/fb#"> <title>Admin Panel</title> <META name="robots" content="NOINDEX,NOFOLLOW" /> <link type="text/css" rel="stylesheet" href="../css/admin.css" /> <link href="../img/favicon.ico" rel="icon" type="image/x-icon" /> <body> <a href="index.php"><img src="../img/logo.png" border="0"></a> <div class="banner"><a href="index.php">Delete</a> - <a href="add.php">Add & Remove</a> - <a href="logout.php">Logout</a></div> <div align="center"><form id="form1" method="post" action=""> Youtube URL: <input type="text" name="vidid" id="vidid"> Title: <input type="text" name="tit1" id="tit1"> <input name='add' type='submit' id='add' value='Add Video' /> <? echo"$message";?><br><br> Website URL: <input type="text" name="vidid2" id="vidid2"> <input name='rem' type='submit' id='rem' value='Remove Video' /> <? echo"$message2";?><br><br> Example: <strong>http://<? echo"$surl"; ?>/watch.php?v=25</strong> </div> </form> </body>
×
×
  • 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.