Jump to content

kney

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Everything posted by kney

  1. kney

    New Video Tag

    Youtube also has an HTML5 video player.. Does that still use the same format? http://www.youtube.com/html5
  2. kney

    New Video Tag

    This is how you use the new HTML5 tag <video>. But I want to know how to stream youtube videos through this tag. <!DOCTYPE html> <html lang="nl"> <head><title>HTML5</title></head> <body> <video width="320" height="240" controls="controls"> <source src="movie.mp4" type="video/mp4" /> <source src="movie.ogg" type="video/ogg" /> Your browser does not support the video tag. </video> </body> </html> If you change the source to the youtube URL it doesn't work This doesn't work <!DOCTYPE html> <html lang="nl"> <head><title>HTML5</title></head> <body> <video width="320" height="240" controls="controls"> <source src="http://www.youtube.com/embed/-p3atsZRPLc" /> Your browser does not support the video tag. </video> </body> </html>
  3. kney

    Fatal Error

    The code is indented on my host, but it didn't do the indentation when i copied it over. That pretty much solves the issue. Thanks mate! <?php include("includes/header.php"); function uploadPhoto($path, $title) { $apiKey = "******"; $apiSecret = "******"; $permissions = "write"; $token = "******"; $f = new phpFlickr($apiKey, $apiSecret, true); $f->setToken($token); return $f->async_upload($path, $title); } if($_SESSION['usernr'] != true){ ?> <section id="content" class="body"> <h1>Sorry!</h1> You are not authorized to view this page! </section> <?php }else{ //Include phpFlickr require_once("phpFlickr/phpFlickr.php"); $error=0; $f = null; if($_POST){ if(!$_POST['name'] || !$_FILES["file"]["name"]){ $error=1; }else{ if ($_FILES["file"]["error"] > 0){ echo "Error: " . $_FILES["file"]["error"] . "<br />"; }else if($_FILES["file"]["type"] != "image/jpg" && $_FILES["file"]["type"] != "image/jpeg" && $_FILES["file"]["type"] != "image/png" && $_FILES["file"]["type"] != "image/gif"){ $error = 3; }else if(intval($_FILES["file"]["size"]) > 525000){ $error = 4; }else{ $dir= dirname($_FILES["file"]["tmp_name"]); $newpath=$dir."/".$_FILES["file"]["name"]; rename($_FILES["file"]["tmp_name"],$newpath); //Instantiate phpFlickr $status = uploadPhoto($newpath, $_POST["name"]); if(!$status) { $error = 2; } } } } ?> <section id="content" class="body"> <div id="doc" class="yui-t7"> <div id="hd" role="banner"><h1>Foto Uploader</h1></div> <div id="bd" role="main"> <div id="mainbar" class="yui-b"> <?php if (isset($_POST['name']) && $error==0) { echo " <h2>Your file is uploaded to <a href='http://www.flickr.com/photos/78262663@N02/' target='_blank'>DK1885 his photos!</a></h2>"; }else { if($error == 1){ echo " <font color='red'>Please enter a file name.</font>"; }else if($error == 2) { echo " <font color='red'>Your photo can't be uploaded.</font>"; }else if($error == 3){ echo " <font color='red'>Please only upload JPG, JPEG, PNG or GIF files.</font>"; }else if($error == 4){ echo " <font color='red'>The file size is larger than 512Kb.</font>"; } ?> <h2>Upload your photos!</h2> <form method="post" accept-charset="utf-8" enctype='multipart/form-data'> <p>Name: <input type="text" name="name" value="" ></p> <p>Picture: <input type="file" name="file"/></p> <p><input type="submit" value="Submit"></p> </form> <?php } ?> </div> </div> <div id="ft"></div> </div> </section> <?php } include("includes/footer.php"); ?> It's weird that the indentation gets done correct now..
  4. kney

    Fatal Error

    yea i think he did, and I used $status = uploadPhoto($newpath, $_POST["name"]); and function uploadPhoto($path, $title) { }
  5. kney

    Fatal Error

    the uploadphoto() function is specified in this php file (7 lines below, from where I use it)
  6. I get this error: Fatal error: Call to undefined function uploadphoto() in ....... on line 39 I use phpFlickr to upload my photos from my website to Flickr. Here's the code <?php include("includes/header.php"); if($_SESSION['usernr'] != true){ ?> <section id="content" class="body"> <h1>Sorry!</h1> You are not authorized to view this page! </section> <?php }else{ //Include phpFlickr require_once("phpFlickr/phpFlickr.php"); $error=0; $f = null; if($_POST){ if(!$_POST['name'] || !$_FILES["file"]["name"]){ $error=1; }else{ if ($_FILES["file"]["error"] > 0){ echo "Error: " . $_FILES["file"]["error"] . "<br />"; }else if($_FILES["file"]["type"] != "image/jpg" && $_FILES["file"]["type"] != "image/jpeg" && $_FILES["file"]["type"] != "image/png" && $_FILES["file"]["type"] != "image/gif"){ $error = 3; }else if(intval($_FILES["file"]["size"]) > 525000){ $error = 4; }else{ $dir= dirname($_FILES["file"]["tmp_name"]); $newpath=$dir."/".$_FILES["file"]["name"]; rename($_FILES["file"]["tmp_name"],$newpath); //Instantiate phpFlickr $status = uploadPhoto($newpath, $_POST["name"]); if(!$status) { $error = 2; } } } } function uploadPhoto($path, $title) { $apiKey = "*****************"; $apiSecret = "*****************"; $permissions = "write"; $token = "*****************"; $f = new phpFlickr($apiKey, $apiSecret, true); $f->setToken($token); return $f->async_upload($path, $title); } ?> <section id="content" class="body"> <div id="doc" class="yui-t7"> <div id="hd" role="banner"><h1>Foto Uploader</h1></div> <div id="bd" role="main"> <div id="mainbar" class="yui-b"> <?php if (isset($_POST['name']) && $error==0) { echo " <h2>Your file is uploaded to <a href='http://www.flickr.com/photos/78262663@N02/' target='_blank'>DK1885 his photos!</a></h2>"; }else { if($error == 1){ echo " <font color='red'>Please enter a file name.</font>"; }else if($error == 2) { echo " <font color='red'>Your photo can't be uploaded.</font>"; }else if($error == 3){ echo " <font color='red'>Please only upload JPG, JPEG, PNG or GIF files.</font>"; }else if($error == 4){ echo " <font color='red'>The file size is larger than 512Kb.</font>"; } ?> <h2>Upload your photos!</h2> <form method="post" accept-charset="utf-8" enctype='multipart/form-data'> <p>Name: <input type="text" name="name" value="" ></p> <p>Picture: <input type="file" name="file"/></p> <p><input type="submit" value="Submit"></p> </form> <?php } ?> </div> </div> <div id="ft"></div> </div> </section> <?php } include("includes/footer.php"); ?>
  7. yeah I know, it gives something like this. With the bold being my URL. And it doesn't do it correctly
  8. Hi, I'm going to have a website where I'm going to publish certain newsitems daily/weekly or whatever. This is the link http://onenation.freehostia.com/kenneth/nieuws.php If you click the title of the certain news item you get the whole article. Now, each of these articles should have a "like button" from Facebook. A bit like it is now, but if I click like in my first article, it likes the whole site instead of the 1 article. How can I seperate this?
  9. <?php // Connect to your Database mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error()); mysql_select_db("Database_Name") or die(mysql_error()); $query = ("SELECT * FROM tablename"); $resultset = mysql_query($query); while($result = mysql_fetch_array($resultset)){ if ($result["columnname"] == "mytexthere"){ header("Location: index.php"); break; } } ?>
  10. Shouldn't you use is_numeric? $category=mysql_real_escape_string($_GET['category']); if (is_numeric($category)) { Edit: What AyKay47 says
  11. you didn't close table tag
  12. <?php $test = ""; while($row = mysql_fetch_assoc($rs) { echo 'Order ID: ' . $row['order_id']; if($row['order_id'] == $test){ echo 'Total: ' . $row['total']; } $test = $row['order_id']; } ?>
  13. <?php session_start(); // timeout after 10 minutes $inactive = 600; $session_life = time() - $_session['timeout']; if($session_life > $inactive) { session_destroy(); header("Location: logoutpage.php"); } S_session['timeout']=time(); ?>
  14. You only need to include the page where you have the image in all 47 files. And when it needs to be updated you change it only in the image.php file e.g. image.php <?php echo "<img src='image.jpg' width='125' height='156' />"; ?> e.g. index.php, blabla.php <?php // wherever the right column is include("image.php"); ?>
  15. <?php echo "<form name='newmessage' method='post' action='send_message.php?goauld=". $_GET['goauld'] ."'>"; ?>
  16. <?php $a = "SELECT * FROM blog_posts ORDER BY id DESC LIMIT 5"; $query = mysql_query($a) or die (mysql_error()); $query_results = mysql_fetch_array($query); // should work echo $query_results[0]; ?>
  17. kney

    <?html?>

    Try <?php $to = $emailer; $sender = "Daisy Toys<newsletter@daisytoys.com>"; $subject = "Daisy Toys Newsletter for - $company"; $message = "<HTML><head>///////////other html Stuff " . require("filelocation.php") . "</BODY></HTML>"; mail($emailer, $subject, "", $headers); ?>
  18. kney

    <?html?>

    Post your total code then
  19. <?php $date = "2011/06/05"; $newDate = strtotime('+15 days',$date); ?>
  20. kney

    <?html?>

    <?php //other php functions ?> <HTML> email body section A <?php require( dirname( __FILE__ ) . '/../../folder/file.php' ); ?> email body section B </HTML>
  21. Forgot a dot $result = mysql_query( "SELECT * FROM movie_info WHERE id = " . (int) $_POST['field'] ." LIMIT 1");
  22. & I would do this on one line $data = mysql_query(”SELECT * FROM users WHERE upper($field) LIKE’%$find%’”); like this $data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE '%$find%'");
  23. Just saw I added too much this wasn't supposed to be under the rest anymore.. and no problem } // get Bombay time alert(calcTime('Bombay', '+5.5'));
×
×
  • 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.