PHP - Movie Player Script Problem
I confess I am not a php coder but have managed to build a youtube player which plays from a list which is generated by a flat file data base.
http://www.d-sine.com/DEV/CHW/movies/index.php I have also (nearly) built an admin backend where users can edit the database and add, delete and update their movie player list. http://www.d-sine.com/DEV/CHW/movies/admin/ pass = password the problem I have is that when the list is edited it throws in a return (a blank line) into the database resulting in an error when the player is refreshed after the change. When this blank line is taken out all is fine, I have got so close its frustrating arrrgghh Can anyone help??? The code in full is attatched Open Source, so if it is any use to anyone, be my guest ;-) Similar Tutorialswell.. i have vbulletin 4 forum i try to put video player so if i upload mp4 file so i can play video but sad part is its working only at firefox browser can you help me out .. video code looks like this
<vb:if condition="$attachment[attachmentextension] == mp4"> pls i really want that put to work in every browser sadly it works only in firefox somehow.. i am making a website where i can submit films but i am confuse to understand the structure of that where people can also submit their views and i can diferent link of diffrent companiess for example i have some example http://tv.desitvforum.net/index.php?option=com_content&task=view&id=77865&Itemid=86 http://www.funbolo.com/more.asp?itemCode=1916 this type of page that i can easily insert links and their title and images on that page there is also one problem every time become different links of different sites in different counting so that's why m more confuse ho to set data base structure for that and how add these all details from panel and people can also post comment on that well thats simple but my bug problem is structure for this aNy Body in structure Hi there here is what I am trying to do. I have a site A poster can ask a question about a movie that he/she is unsure of Then people can answer If anyone's post is selected as the right answer then I want the poster image to show up in their comment box for the movie. When you answer a question about a movie You can enter The movie name IMDB link IMDB ID So what I want to know is, well I know that there is some javascript onlick function that takes the "select as right answer" clicking action by the Question asker and calls a script which outputs or echos the right answer message. Or this answer is correct message. I want to also summon the IMDB poster image for that commenter if he / she is selected Any ideas? Omar I'm in the process of writing an online movie trivia game in PHP, Ajax and jQuery, I have completed about 65 percent in what I want to achieve. I have it where users can add their own movie questions and once they are approved by me they will appear in the game. I eventually want to make the game play better and have where a person can log on via social media (Facebook, Google+, etc). Here's the link to the website: https://www.pepster.com/
Everything is original or have permission to use, I converted an old Flash trivia game that I developed in college and I have been spending the last month or two developing this website (along with my main website). I know haven't critique other websites, but I have notice there isn't much activity going on here lately, but I promise I will in the future. I'm look for input on game play, new features that you might like to see and over website design.
Best Regards,
John
can anyone tell me whats this player and the settings for playing mp3 files with this player thanks http://img146.imageshack.us/i/84129977.jpg hey back again, I need help finding something like the audio player found at www.soundowl.com. I need it to be similar in the sense that the URL of the file cannot be found in the source code and this is exactly what I need for my website, any help will be appreciated, thank you in advance the below works in firefox but doesn't work in internet explorer is there something wrong with it <?php $file = $_GET["Watch"]; echo "<OBJECT ID='MediaPlayer' WIDTH='450' HEIGHT='310' CLASSID='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'> <PARAM NAME=".$file." VALUE='../audio/audio_files/".$file.".wmv'> <PARAM NAME='autostart' VALUE='false'> <PARAM NAME='ShowControls' VALUE='true'> <PARAM NAME='ShowStatusBar' VALUE='true'> <PARAM NAME='ShowDisplay' VALUE='false'> <EMBED TYPE='application/x-mplayer2' SRC='../dvds/dvd_files/".$file.".wmv' NAME=".$file." WIDTH='450' HEIGHT='310' ShowControls='1' ShowStatusBar='1' ShowDisplay='0' autostart='0'></EMBED> </OBJECT>"; ?> if ($action == "discussion") { if ($_POST['comment'] == "") { echo "<p align=center>Sorry your comment was not posted due to the comment being blank. You will be redirected in a few seconds so please try again</p> <p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=15;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; include("bottom.php"); exit; } if (isset($_POST) && !empty($_POST)) { if (isset($_SESSION['posttimer'])) { if ( (time() - $_SESSION['posttimer']) <= 10) { echo "<p align=center><b>Bit of a problem here, Double Post attempt has been found. Don't worry we stopped it.</b></p>"; echo "<p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=15;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; } else { $sumscore = $row[score] + 2; $sumcomments = $row[comments] + 1; $con=mysqli_connect("DETAILS FOR SQL STUFF IN HERE BUT DELETED FOR PURPOSES OF THE FORUM"); if (mysqli_connect_errno()) { echo "<p align=center>Failed to connect to MySQL: </p>" . mysqli_connect_error(); } $sql="INSERT INTO comments (userid, topicid, category, topicname, comment, date, name, address, avatar) VALUES ('$row[id]','$content[id]','blogs','$content[topic]','$_POST[comment]','$today','$row[name]','http://www.sentuamessage.com/blog.php?who=$content[id]', '$row[cavatar]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } mysql_query("INSERT INTO notifications (userid, username, nuser, message, address, date, time) VALUES ('$row[id]','$row[name]','$content[postedid]','$row[name] has commented on your Blog','http://www.sentuamessage.com/blog.php?who=$who','$today', '$time')") or die(mysql_error()); mysql_query("UPDATE userdb SET comments='$sumcomments', score='$sumscore' WHERE username='$_SESSION[username]'") or die(mysql_error()); echo "<p align=center>Your comment has been submitted. You should be redirected back to your page in a few seconds</p> <p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=2;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; mysqli_close($con); } } $_SESSION['posttimer'] = time(); } include("bottom.php"); exit; }I am rattling my brain here. I had added a code into my script to get rid of double posts, it has a timer which stops people double posting within 10 seconds. Though since inserting the code you have an error where you will have to double post the same post because instead of inserting the post content into the database the submit button comes back with a blank result. Why is this happening? (blank result instead of saying "post successfully posted etc." or "post not posted" it just comes up blank with no entry going into the database. This results in you having to re type your comment and re submit it hoping second time lucky) This is my code once the submit has been hit. Previously, the PHP codebase I was using was that written by others, and I used their code to tinker with so I could get an understanding how PHP works. Now that I am comfortable using PHP, I have written my own short PHP script from scratch with the aim of it seeing my newsletter system functioning at minimal, for the first time. The newsletters system is made with HTML/PHP/MySQL. I am having a problem with the PHP side of things where I am getting an error: Quote PHP Parse error: syntax error, unexpected T_IF on line 50 ... which is: Code: [Select] if $_POST['action'] == 'Register' { I am hoping someone that knows allot about PHP could take a look at my code and see whats wrong with it? PHP code within confirm.html: Code: [Select] <?php $link = mysql_connect('localhost', 'testusr', 'testpw'); mysql_select_db('testdb', $link); $email = $_POST['e-mail']; $query = if $_POST['action'] == 'Register' { if $_POST['newsletter'] == 'Mens' { "INSERT INTO newsletters(mens) VALUES('$email')"; } elseif $_POST['newsletter'] == 'Mens & Womens' { "INSERT INTO newsletters(mensandwomens) VALUES('$email')"; } elseif $_POST['newsletter'] == 'Womens' { "INSERT INTO newsletters(womens) VALUES('$email')"; } ;} mysql_query ($link, $query); mysql_close($link); ?> HTML FORM code within index.html: Code: [Select] <FORM action="confirm.html" method="post"> <DIV> <SPAN class="input"> Action: <SELECT name="action"> <OPTION>Register</OPTION> <OPTION>Unregister</OPTION> </SELECT>    E-mail: <INPUT name="e-mail" type="text"></INPUT>    Newsletter: <SELECT name="newsletter"> <OPTION>Mens</OPTION> <OPTION>Mens & Womans</OPTION> <OPTION>Womens</OPTION> </SELECT>    <INPUT class="submit" type="submit" value="Submit"> </SPAN> </DIV> </FORM> Well this problem has occurred a lot. I try to put ". $_GET['site'] ." or ". $_POST['site'] ." in my script and i get a server errror when trying t access my page ( error connecting the page basically) Here is the part of the script which that is occuring to: Quote if($_GET['step'] == 2) { echo 'Just adding INCLUDE files'; exec('xcopy /X/ / ". $_GET['site'] ." / /e/i', $a, $a1); <---- This line echo '<form action="install.php?step=3&guid='. $my_guid .'" method="post">'; echo '<input type="submit" value="Continue">'; echo '</form>'; } When i try using the $_GET function or $_POST functions in alot of stuff it just shows an server error(error connecting the page on my browser) Someone please help! here is the basic script . i use this script for edit html or text file. <?php $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.txt"; } // where to go back to after the edit ... $return="page.php?p=$page"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location: edit.php?p=$page"); } else{ echo" <html> <head><title>Simple Text Editor</title> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> <body> <div id='content'> "; $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } ?> __________________ the script is running fine. but when i intregate tinymce with the script.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>abeer cms</title> <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> </head> <body> <?php $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.html"; } // where to go back to after the edit ... $return="edit.php?p=$edit"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location: edit.php?p=$page"); } else{ echo" <html> <head><title>Simple Text Editor</title> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> <body> <div id='content'> "; $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } ?> __________________ </body> </html> the script show error message after clicking the save button. the error message is Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\edit.php:6) in c:\wamp\www\edit.php on line 78 can any one help regarding this issue? Hi I'm building a site that contains access to some mp3 files of people speaking English. I would like a media player that is able to handle a variable that results from a database search. I can use <a href etc> to link to the relevant file but would like to use a server-side player to stream the file, rather than the client's browser. Something like Dewplayer would be perfect but it seems only to take a static file (maybe I'm wrong there). The player appears within <object> tags, like this <code> echo '<object type="application/x-shockwave-flash" data="/player/dewplayer.swf" width="200" height="30" id="dewplayer" name="dewplayer">'; echo '<param name="movie" value="/player/dewplayer.swf" />'; echo '<param name="flashvars" value="mp3=file.mp3" />'; echo '<param name="wmode" value="transparent" />'; echo '</object>'; </code> (the code is freely downloadable so hope I'm not breaking any rules posting someone else's code here). Is there a way I can specify a variable in value? If not, does anyone know of a player that I can use that does allow that? Grateful for any help. Thanks in advance. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=314887.0 So I'm working on a website for an airline (not real) and on one of my pages you can request the cost of a flight by putting in the depart and arrival locations, like this: And if they put in a selection that isn't in the database they get this: The problem is that when they load the page initially, instead of just the selection bars and sumbit button showing up, it all does and i get an error like this: When you sumbit it, it all looks like it should, it's just that when they load it things seem to go wrong, any idea how i can fix this? Heres the code i use: Code: [Select] <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p>Depart: <select name="depart"> <option selected="selected">Bristol</option> <option>Newcastle</option> <option>Manchester</option> <option>Dublin</option> <option>Glasgow</option> </select> Arrive: <select name="arrive"> <option>Bristol</option> <option selected="selected">Newcastle</option> <option>Manchester</option> <option>Dublin</option> <option>Glasgow</option> </select> <input type="submit" /> </p> </form> <?php $depart = $_POST['depart']; $arrive = $_POST['arrive']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $result = mysql_query("SELECT price FROM flights WHERE depart = '$depart' AND arrive = '$arrive'"); if ($row = mysql_fetch_assoc($result)) { echo 'This flight shall cost you £'; echo $row["price"]; } else include('includes/price.php'); ?> </div> My if-else statement doesn't seem to be doing it's job Thanks in advance So, I'm trying to make a script that will send emails from apparently anyone. Code: [Select] <?php $email = $_REQUEST['email'] $target = $_REQUEST['target'] $message = $_REQUEST['message'] $subject = $_REQUEST['subject'] mail( $target, $subject, $message, "From: $email" ); echo "Mail sent." ; ?> Here's the HTML, if it matters. Code: [Select] <html> <head> <title>EMAIL SPOOFER</title> </head> <body> <p>This program can make emails appear as if they came from any email address, real or fake!</p> <form method="post" action="mailspoof.php"> Apparent sender: <input name="email" type="text" /><br /> Subject: <input name="subject" type="text" /><br /> Recipient: <input name="target" type="text" /><br /> Message:<br /> <textarea name="message" rows="15" cols="40"> </textarea><br /> <input type="submit" /> </form> </body> </html> Here's the error I'm getting from my webhost: Parse error: syntax error, unexpected T_VARIABLE in /home/a5938041/public_html/mailspoof.php on line 3 If I know me, it's probably the most stupid mistake in the universe, so please point it out. ::) I'm having trouble with my script. I'm getting pictures from the database and showing it in 3 columns and putting some information in each table location with the picture. But I made a change and now the table still works but I get a full blank page and have to scroll down to see the pictures. Can anybody see where my problem exists, it was working fine but now it doesn't. Any help would be appreciated. Thanks in advance. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <title></title> <head> <link rel="stylesheet" href="./stylesheet/stylesheet1.css" media="screen"> <style type="text/css" media="screen">@import url("./stylesheet/stylesheet2.css");</style> </head> <body> <center><table cellspacing="5" cellpadding="5" width="800" border="1"> <?php include "connect.php"; $query = "SELECT * FROM promo_vet ORDER BY year"; $result = mysql_query($query) or die("There was a problem with the SQL query: " . mysql_error()); if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 3; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; // make sure we have a valid product ALIGN='CENTER' if($year != "" && $year != null) echo "<td align='center'><a><img src=\"$picture\"></a><br>$testshot<FONT COLOR='red'><b>$year</b></FONT><br>$description <br> $boxno<br>$convertible<br>$coupe </td><BR>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; } ?> </tr> </table></center> </body> </html> Hi all, Im coding a simple script for my website which just changes the users rank. Code: [Select] <?php session_start(); include "../includes/db_connect.php"; include "../includes/functions.php"; logincheck(); ini_set ('display_errors', 1); error_reporting (E_ALL); $username=$_SESSION['username']; $get = mysql_query ("SELECT * FROM users WHERE username = '$username'"); $fetch = mysql_fetch_object($get); if ($fetch->userlevel >= "2"){ $newrank = $_POST['newrank']; $user1 = $_POST['user']; if (strip_tags($_POST['update'])){ mysql_query("UPDATE users SET `rank` = '$newrank' WHERE username='$user1'") or die (mysql_error()); echo ("You have updated $user1's rank to $newrank !"); } } else{ echo ("Your userlevel isnt high enouth to be here!"); } ?> <html> <head> <title>Change Rank</title> <link rel="stylesheet" href="../includes/in.css" type="text/css"> <style type="text/css"> .infobg { font-family: Arial; font-weight:normal; font-size:12px; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; background: URL(textbg1.png); font-weight:300; } .button { font-size: 12px; background:url(button.png); vertical-align: middle; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; color: #FFFFCC; height:23px; font-weight:300; border-radius: 10px; padding-bottom:2px; } </style> </head> <body> <form action='' method='post' name='form1'> <table width='30%' cellpadding='0' align='center' cellspacing='0' border='1' bordercolor='#000000' bgcolor='#808080' style='border-collapse: collapse'> <tr> <td background='../header.jpg' colspan='2' align='center'>Change Rank</td> <tr> <td>Username:</td><td><input type='text' name='user'></td> </tr> <tr> <td>Rank:</td><td><input type='text' name='newrank'></td> </tr> <tr> <td> </td><td><input type="submit" name="update" value="Update Rank"></td> </tr> </form> </table> </body> </html> But there seems to be something wrong with that code, which I carnt see or work out. When I click Update submit button it does nothing, but can anyone see why it does nothing? Thanks. Hey, so this is my register script
<?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', 1); require 'connect.php'; echo "<title> Register </title>"; if(isset($_POST['register'])) { $username = trim($_POST['username']); $username = mysqli_real_escape_string($con, $_POST['username']); $password = mysqli_real_escape_string($con, $_POST['password']); $password = hash('sha512', $_POST['password']); if(!$_POST['username'] OR !$_POST['password']) { die("You must enter a username and password!"); } $stmt = $con->prepare("INSERT INTO usrs_usr (username, password) VALUES (?, ?)"); $stmt->bind_param("ss", $username, $password); $stmt->get_result(); var_dump($stmt); $stmt->execute(); echo "New user has been created successfully"; $stmt->close(); $conn->close(); } ?>Now the problem is i have done a variable dump which outputs nothing, and the only error i am getting is Fatal error: Call to a member function bind_param() on a non-object |