Jump to content

Search the Community

Showing results for tags 'html5'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. I’m currently trying to building a websocket widget, using node package manager(NPM),WAMPserver and electronjs. the package was well installed because when i start it it works. It log into the console But i dont know how i can handle it with html on wamp server . it seems electronjs is not working for wamp and websocket.
  2. I've got an HTML 5 date input box working on my site. Anyone know how to make the whole thing selectable like a drop down (select) box? Currently you can only select it by clicking on the arrow at the far right of it. I don't mind about losing the cross or up and down arrows. I just want the field to be fully selectable like a drop down box. Any ideas please? Thanks.
  3. I have made a small CSS image slider for my webpage, but have a few issues with the slider and my images. The images differ in size on the screen (although I have made sure the images were the same size before upload). I have written code for three images, the first image of the slider is too high, the second image is great, third image is lower than the second and first image... and then it shows a fourth blank image? HTML Code: <div id="slider"> <figure> <li><img src="http://xxx/jkhzmGV.jpg" /></li> <li><img src="http://xxx/49RqNB5.jpg" /></li> <li><img src="http://xxx/7nrTa5p.jpg" /></li> </figure> </div> CSS Code: @keyframes slider { 0% { left: 0; } 20% { left: 0; } 25% { left: -100%; } 45% { left: -100%; } 50% { left: -200%; } 70% { left: -200%; } 75% { left: -300%; } 95% { left: -300%; } 100% { left: -400%; } } #slider { overflow: hidden; } #slider figure img { width: 20%; float: left; } #slider figure { position: relative; width: 500%; margin: 0; left: 0; text-align: left; font-size: 0; animation: 30s slider infinite; } }
  4. I am using a simple image upload. http://www.w3schools.com/php/php_file_upload.asp It gives me 2 errors like this. Warning: move_uploaded_file(C:/xampp/htdocs/home/upload/images/grandpix 2.jpg): failed to open stream: No such file or directory in C:\xampp\htdocs\home\upload\post.php on line 174 Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\phpF915.tmp' to 'C:/xampp/htdocs/home/upload/images/grandpix 2.jpg' in C:\xampp\htdocs\home\upload\post.php on line 174 This is my code. Post.php . I see that it's the "$target_dir" issue. How can I fix it? if(isset($_FILES['fileToUpload'])){ if(!empty($_FILES['fileToUpload']['name'])) { $target_dir = $_SERVER['DOCUMENT_ROOT'].'/home/upload/images/'; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { $uploadOk = 1; } else { $errors[] = 'File is not an image.'; $uploadOk = 0; } // Check if file already exists if (file_exists($target_file)) { $errors[] = 'Sorry, file already exists.'; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 500000) { $errors[] = 'Sorry, your file is too large.'; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" ) { $errors[] = 'Sorry, only JPG, JPEG, PNG & GIF files are allowed.'; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { $errors[] = 'Sorry, your file was not uploaded.'; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { $errors[] = 'Sorry, there was an error uploading your file.'; } } $insert_image = $db->prepare("INSERT INTO images(user_id, item_id, image_path, date_added) VALUES(:user_id, :item_id, :image_path, :date_added)"); $insert_image->bindParam(':user_id', $userid); $insert_image->bindParam(':item_id', $item_id); $insert_image->bindParam(':image_path', $target_file); $insert_image->bindParam(':date_added', $date_added); if(!$insert_image->execute()) { $errors[] = 'There was a problem uploading the image!'; } else { if(empty($errors)) { $db->commit(); $success = 'Your post has been saved.'; } else { $db->rollBack(); } } } else { $errors[] = 'An image is required!'; } }
  5. I have tried other players and am now testing the mediaelement.js player, which works in all browsers, playing the video, and shows the 'poster' image in all browsers, except no 'poster' image appears in IE8. As I know the "poster' isn't supported by IE8, I'm looking for help with a work-around to place a thumbnail image as a substitute (for IE8) for the 'poster' image. Any help will be appreciated. Here's my current code: <video id="video" poster="http://www.-domain-.com/img/testImage.jpg" preload="none" controls="controls" width="240" height="220" > <source type="video/mp4" src="http://www.-domain-.com/video/testVideo.mp4"/> <object width="240" height="220" type="application/x-shockwave-flash" data="http://www.-domain-.com/mediaelement/flashmediaelement.swf"> <param name="movie" value="http://www.-domain-.com/mediaelement/flashmediaelement.swf" /> <param name="flashvars" value="controls=true&file=http://www.-domain-.com/video/testVideo.mp4" /> <!-- Image as a last resort --> <img src="http://www.-domain-.com/img/testImage.jpg" width="240" height="220" title="No video playback capabilities" /> </object> </video>
  6. I looked at a tutorial on youtube to make a blog. I need to be connected after logging in my admin login with the admin panel. What is my mistake here? Thank you very much! index.php <?php include_once "../blog/connect.php"; include_once "../blog/functie.php"; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <title>Dashboard I Admin Panel</title> <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" /> <!--[if lt IE 9]> <link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script src="js/jquery-1.5.2.min.js" type="text/javascript"></script> <script src="js/hideshow.js" type="text/javascript"></script> <script src="js/jquery.tablesorter.min.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery.equalHeight.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".tablesorter").tablesorter(); } ); $(document).ready(function() { //When page loads... $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); }); </script> <script type="text/javascript"> $(function(){ $('.column').equalHeight(); }); </script> </head> <body> <?php if(session("login") && session("uye_rutbe") == 1){ require_once "inc/default.php"; }else{ } if ($_POST){ $kadi= p("kadi"); $sifre = md5(p("sifre")); if (!$kadi || !$sifre){ echo "kullanıcı adı sifre bos bırakılamaz"; } else{ $row = $connect->query("SELECT * FROM uyeler WHERE uye_kadi = '$kadi' && uye_sifre = '$sifre'"); $row = $connect->fetch(PDO::FETCH_ASSOC); if ( $row["uye_id"]) { $session = array( "giris_yap" => true, "uye_id" => $row["uye_id"], "uye_kadi" => $row["uye_kadi"], "uye_rutbe" => $row["uye_rutbe"] ); session_olustur($session); header("Refresh:0;"); } else { echo "<font color='red'>Böyle Bir Yönetici Yoktur.</font>"; } } } ?> <div id="giris_yap"> <form action="" method="post"> <table cellpadding="0" cellspacing="0"> <tr> <td>Gebruikersnaam:</td> <td><input type="text" name="kadi" /></td> </tr> <tr> <td>Wachtwoord:</td> <td><input type="password" name="sifre" /></td> </tr> <tr> <td></td> <td><button type="submit">Inloggen</button></td> </tr> </table> </form> </div> </body> </html> function.php <?php function p($par, $st =false){ if($st){ return htmlspecialchars(trim($_POST[$par])); }else{ return trim( $_POST[$par]); } } function g($par){ return strip_tag(trim($_GET[$par])); } function kisalt($par,$uzunluk = 50){ if(strlen($par) > $uzunluk){ $par=mb_substr($par,0,$uzunluk,"UTF-8").". ."; } return $par; } function go($par, $time = 0){ if($time == 0){ header("Location: {$par}"); }else{ header("Refresh: {$time}; url={$par}"); } } function session($par){ if ($_SESSION[$par]){ return $_SESSION[$par]; }else{ return false; } } function session_olustur($par){ foreach ($par as $anahtar => $deger){ $_SESSION[$anahtar]=$deger; } } function sef_link($url){ $url = trim($url); $url = strtolower($url); $find = array('<b>', '</b>'); $url = str_replace ($find, '', $url); $url = preg_replace('/<(\/{0,1})img(.*?)(\/{0,1})\>/', 'image', $url); $find = array(' ', '"', '&', '&', '\r\n', '\n', '/', '\\', '+', '<', '>'); $url = str_replace ($find, '-', $url); $find = array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ë', 'Ê'); $url = str_replace ($find, 'e', $url); $find = array('í', 'ì', 'î', 'ï', 'I', 'Ã', 'ÃŒ', 'Ã', 'Ã', 'Ä°', 'ı'); $url = str_replace ($find, 'i', $url); $find = array('ó', 'ö', 'Ö', 'ò', 'ô', 'Ó', 'Ã’', 'Ô'); $url = str_replace ($find, 'o', $url); $find = array('á', 'ä', 'â', 'à ', 'â', 'Ä', 'Â', 'Ã', 'À', 'Â'); $url = str_replace ($find, 'a', $url); $find = array('ú', 'ü', 'Ãœ', 'ù', 'û', 'Ú', 'Ù', 'Û'); $url = str_replace ($find, 'u', $url); $find = array('ç', 'Ç'); $url = str_replace ($find, 'c', $url); $find = array('Å', 'ÅŸ'); $url = str_replace ($find, 's', $url); $find = array('Ä', 'ÄŸ'); $url = str_replace ($find, 'g', $url); $find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/'); $repl = array('', '-', ''); $url = preg_replace ($find, $repl, $url); $url = str_replace ('--', '-', $url); return $url; } function query($query){ return mysql_query($query); } function row($query){ return mysql_fetch_array($query); } function rows($query){ return mysql_num_rows($query); } { } ?> Connect.php <?php session_start(); $host = "localhost"; $database = "blog"; $user = "root"; $password = ""; try { $connect = new PDO("mysql:localhost={$host};dbname={$database}", $user, $password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); $connect->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING ); } catch (PDOException $e) { return 'Hay Allah!, Connection Error: '. $e->getMessage(); } ?>
  7. Php value which was assigned to a text box, how to get this value to be used further with mysql query. Pls help me with the code
  8. Hi, I am struggling to get a htmnl 5 canavas not to work after the back button is pressed in the browser. I have stopped back button being allowed but it stops me using javascript to use go back which i need. The code is as follows. <?php require('globals.php'); if ($ir['wof_spins'] > 0) { error("You have span the wheel this hour"); //this does not work on page back } ?> <!DOCTYPE html> <html> <head><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <script type='text/javascript' src='http://code.jquery.com/jquery-compat-git.js'></script> <script type='text/javascript' src="js/jquery.transit.min.js"></script> <style type='text/css'> .wheel-wrap { position: relative; width: 550px; height: 550px; overflow: hidden; margin: 0 auto; z-index: 1; } .marker { top: 10px; left: 247px; z-index: 1; position: absolute; } .wheel { top: 90px; left: 74px; width: 550px; z-index: 1; } </style> <script type='text/javascript'>//<![CDATA[ $(function(){ window.WHEELOFFORTUNE = { cache: {}, init: function () { console.log('controller init...'); var _this = this; this.cache.wheel = $('.wheel'); this.cache.wheelMarker = $('.marker'); this.cache.wheelSpinBtn = $('.wheel'); //mapping is backwards as wheel spins clockwise //1=win this.cache.wheelMapping = [400, 120, 80, 750, 150, 300, 60, 175, 500, 125, 75, 1000, 120, 200, 90, 600, 100, 250].reverse(); this.cache.wheelSpinBtn.on('click touchstart', function (e) { e.preventDefault(); if (!$(this).hasClass('disabled')) _this.spin(); }); //reset wheel this.resetSpin(); //setup prize events this.prizeEvents(); }, spin: function () { console.log('spinning wheel'); var _this = this; // reset wheel this.resetSpin(); //disable spin button while in progress this.cache.wheelSpinBtn.addClass('disabled'); /* Wheel has 10 sections. Each section is 360/10 = 36deg. */ var deg = 1500 + Math.round(Math.random() * 1500), duration = 6000; //optimal 6 secs _this.cache.wheelPos = deg; //transition queuing //ff bug with easeOutBack this.cache.wheel.transition({ rotate: '0deg' }, 0) .transition({ rotate: deg + 'deg' }, duration, 'easeOutCubic'); //move marker _this.cache.wheelMarker.transition({ rotate: '-20deg' }, 0, 'snap'); //just before wheel finish setTimeout(function () { //reset marker _this.cache.wheelMarker.transition({ rotate: '0deg' }, 300, 'easeOutQuad'); }, duration - 500); //wheel finish setTimeout(function () { // did it win??!?!?! var spin = _this.cache.wheelPos, degrees = spin % 360, percent = (degrees / 360) * 100, segment = Math.ceil((percent / 6)), //divided by number of segments win = _this.cache.wheelMapping[segment - 1]; //zero based array console.log('spin = ' + spin); console.log('degrees = ' + degrees); console.log('percent = ' + percent); console.log('segment = ' + segment); console.log('win = ' + win); //display dialog with slight delay to realise win or not. setTimeout(function () { $.ajax({ url: 'spinwheel.php', type: 'post', data: {"win":win}, success: function(data) { if(!alert('You have won 짜'+win)) document.location = 'http://samuraiassault.com/loggedin.php'; } }); }, 700); //re-enable wheel spin _this.cache.wheelSpinBtn.removeClass('disabled'); }, duration); }, resetSpin: function () { this.cache.wheel.transition({ rotate: '0deg' }, 0); this.cache.wheelPos = 0; } } window.WHEELOFFORTUNE.init(); });//]]> </script> </head> <body> <!-- By http://jquery4u.com / Sam Deering --> <h3><u>Wheel Of Fortune</u></h3><hr/> <table><tr> <td class="contentcontent" width="100%"> <div class="wheel-wrap"> <img class="wheel" src="images/wheel.jpg" /> <img class="marker" src="images/marker.png" /> </div> </tr> </td> </table><hr/><?php echo $goback; ?><hr/> </body> </html> thanks for you help in advance
  9. Hi All, I'm very new to PHP and have been reading forums for the better half of two days trying to get ot the bottom of an issue I'm having with Contact form validation. Problem: When submitting the form data, the information stored in a variable is not outputted to the webpage. What I think I'm expecting: On form submission, the HTML5 elements should be checked to see if they are empty. If they are empty, the "string" that I'm storing in the *Err variables should then be outputted on the page to advise the use that the field has not been filled in. Things I've tried: I've confirmed that Apache server is configured to allow HTML pages to be parsed as PHP and have verified that it's working by confirming that PHP scripts do run in the page, PHP includes within the HTML documents apply and that when I use <?php echo "Blah";?> on the page, it outputs correctly. When using a statement such as <?php echo $blah;?> or <?php echo "$blah";?> or <?php echo "{$blah}";?>, the content of the variable is not displayed to the user submitting the form. What am I doing wrong here? I'm trying to do this with just CSS, HTML5 and PHP - I've read about jquery and javascript but preference is to stay with the three above unless what I'm trying to do is not possible. Any pointers/assistance would be hugely appreciated - I mustn't be understanding something correctly. Cheers, A PHP Script: (P.S... I've intentionally left the mail component out until I get the form validating correctly). <?php htmlspecialchars($_SERVER["PHP_SELF"]); if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Name is required"; echo $nameErr; } else { $name = test_input($_POST["name"]); } if (empty($_POST["email"])) { $emailErr = "Email is required"; } else { $email = test_input($_POST["email"]); } if (empty($_POST["website"])) { $website = ""; } else { $website = test_input($_POST["website"]); } if (empty($_POST["phone"])) { $website = ""; } else { $website = test_input($_POST["phone"]); } if (empty($_POST["message"])) { $comment = ""; } else { $comment = test_input($_POST["message"]); } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> Markup: <form class="form-style-9" method="post" enctype="multipart/form-data"> <ul> <li>Contact Form</li> <li> <input type="text" name="name" required class="field-style field-split align-left" placeholder="Name"><span class="error">*<?php echo $nameErr;?></span> <input type="email" name="email" required class="field-style field-split align-right" placeholder="Email"> </li> <li> <input type="tel" name="phone" required class="field-style field-split align-left" placeholder="Phone"> <input type="url" name="website" class="field-style field-split align-right" placeholder="Website"> </li> <li> <input type="text" maxlength="20" min="5" name="subject" required class="field-style field-full align-none" placeholder="Subject"> </li> <li> <textarea name="message" maxlength="200" required class="field-style" placeholder="Message"></textarea> </li> <li> <input id="submit" name="submit" type="submit" value="Send Message"> </li> </ul> </form>
  10. Hi, I've got a "data.txt" file with the following content: One1:One2:One3:One4:One5:One6 Two1:Two2:Two3:Two4:Two5:Two6 Three1:Three2:Three3:Three4:Three5:Three6 Now I want to be able to take each data and put on a specific location of a htlm code. Each line for its own. So for the first line, it should look something like this: <html> <head> <title></title> <head> <body> <h1>One2</h1> <h2>One4 some other Text One5</h2> <img src="One6.jpg"> </body> </html> Unforturtunately I don't have a clue how to do that. Can anybody help me out or does someone know a good and easy tutorial? Thanks a lot
  11. Can anyone suggest how to build web app like http://www1.lost-in-val-sinestra.com/ without flash. We want to pull the data from facebook and using pulled data edit the sample video and play in the browser. I was thinking to use image magick with ffmpeg to edit the video but unable to do it successfully. I tried to edit video using below steps 1. Extract all frames from the video using ffmpeg. 2. Identify the frames need to be customized. 3. Identify the coordinates of placeholders where we need to place the facebook data. 4. Using image magick customized frames with facebook image (facing difficulty here as the video moves continously taking coordinate of each frames is tedious) 5. Create final video with edited frames using ffmpeg.
  12. Hi guys, I have stuck with this issue for over 3 hours now. My remove all button just wouldn't work. Can anyone tell me what's the issue? I have 2 pages, one parent and another pop-up page that takes the values (cartSubmit) from parent. And I wrote out the code for both pages but I just cannot get it to work. I apologize in advanced if my code looks messy or doesn't make any sense. Please take a look at the code and let me know if you could spot anything wrong with it. Any help is greatly appreciated. Here is the code related to the remove all button in the parent page: if(isset($_POST['finalSelected'])) { echo "<br/>inside"; if(!empty($_POST['fSelected'])) { echo "<br/>if NOT empty"; $chosen = $_POST['fSelected']; foreach ($chosen as $item) echo "</br>aID selected: $item </br>"; //implode function to transform an array to a string //chosen(array) to $delimit(String) $delimitStr = implode(", ", $chosen); //Save the selected String to SESSION if(!isset($_SESSION["final"])) { $_SESSION["final"] .= "$delimitStr"; } else { $_SESSION["final"] .= ", $delimitStr"; } //Explode function to transform the SESSION variable back to an array for further trimming. $arraySession = explode(', ', $_SESSION["final"]); //Array unique to filter out duplicates. $uniqueArray = array_unique($arraySession); $cartSubmit = implode(", ",$uniqueArray); $_SESSION['cartSubmit'] = $cartSubmit; } else { echo "<br/>else empty"; $noSubmit = $_SESSION["final"]; //Explode function to transform the SESSION variable back to an array for further trimming. $arraySession = explode(', ', $_SESSION["final"]); //Array unique to filter out duplicates. $uniqueArray = array_unique($arraySession); $cartSubmit = implode(", ",$uniqueArray); $_SESSION['cartSubmit'] = $cartSubmit; } } <form name= "finalForm" method="POST" action="test6-1.php" target = "_self"> <input type="Submit" name="finalSelected"/> <a href="javascript:popup('test6-3.php?aID= <?php if(empty($_SESSION['final']) && empty($_SESSION['cartSubmit'])) echo "0"; else if(empty($cartSubmit)) echo "0"; else echo $_SESSION['cartSubmit'];?>')">Cart</a> <?php if(isset($FinalName)) { foreach($FinalName as $key => $item) {?> <tr><td> <input type="checkbox" name="fSelected[]" value="<?php echo htmlspecialchars($FinalID[$key])?>" /> <?php echo "$FinalID[$key] & $item";?> </td></tr> <?php } }?> </form> And here is the code in the pop-up page. <script> window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); } </script> if(isset($_POST['removeAll'])) { $aID = "0"; unset($_SESSION['cartSubmit']); unset($_SESSION['final']); header("Location : test6-3.php?aID=0"); }
  13. Hi everyone, as the title stated, I would like to know how I could submit a form in one page(cart) and unset a session variable on other page. Right now my form is setting a variable within the page back to 0, however I would like the form to unset the session variable from other page as well. The issue with my code is that every time I attempt to clear out all items, my code can empty out the cart. But whenever I close and reopen the cart, the same content will show up again. So I need to unset the session variable. Please let me know what should I do in order to solve the problem and I greatly appreciate your help. My code is currently looking like this: cart.php if(!empty($_GET['aID'])) { $aID = $_GET['aID']; echo $aID; if(isset($_POST['removeAll'])) { $aID = "0"; } $cartSQL = "SELECT * from article where aID in ($aID)"; echo "cart sql :$cartSQL"; $cartQuery = mysqli_query($dbc, $cartSQL) or die (mysqli_error($dbc)); while($row = mysqli_fetch_array($cartQuery, MYSQLI_BOTH)) { $aTitle[] = $row[ 'name' ]; } } <form action = "" method = "POST"> <td style = "width = 200px"><input type="submit" value="Empty cart" name="removeAll"></td> </form> And this is the session variable from other page where I would like it to be unset upon submitting the form. if(!empty($cartSubmit)) $_SESSION["cartSubmit"] = $cartSubmit; else $cart = $_SESSION["cartSubmit"]; <a href="javascript:popup('cart.php?aID=<?php if(empty($cartSubmit)) echo "$cart"; else echo "$cartSubmit";?>')">Cart</a>
  14. Hello everyone, I am working on a form that is similar to a shopping cart system and I am thinking of creating a button that submits the checked value and saves them to a $_SESSION variable. And also a link that links to a cart.html that takes the values of a $_SESSION variable. I am have trouble figuring what tag/attribute should I use in order to achieve that. Right now my code attached below submits the checked values to cart.html directly. However I want my submit button to save the checked box to a $_SESSION variable and STAY on the same page. And then I will implement a <a> to link to the cart.php. I researched a little bit about this subject and I know it's somewhat related to ajax/jquery. I just wanted to know more about it from you guys. I appreciate your attention for reading the post and Thanks! Below is the form that I currently have: <form name= "finalForm" method="POST" action="cart.php"> <input type="Submit" name="finalSelected"/> <?php foreach($FinalName as $key => $item) {?> <tr> <td><input type="checkbox" name="fSelected[]" value="<?php echo htmlspecialchars($FinalID[$key])?>" /> <?php echo "$FinalID[$key] & $item";?> </td> </tr> <?php } ;?> Below is the code for cart.php <?php require ('connect_db.php'); if(isset($_POST['finalSelected'])) { if(!empty($_POST['fSelected'])) { $chosen = $_POST['fSelected']; foreach ($chosen as $item) echo "aID selected: $item </br>"; $delimit = implode(", ", $chosen); print_r($delimit); } } if(isset($delimit)) { $cartSQL = "SELECT * from article where aID in ($delimit)"; $cartQuery = mysqli_query($dbc, $cartSQL) or die (mysqli_error($dbc)); while($row = mysqli_fetch_array($cartQuery, MYSQLI_BOTH)) { $aTitle[] = $row[ 'name' ]; } } ?> <table> <?php if(isset($delimit)) { $c=0; foreach($aTitle as $item) {?> <tr> <td> <?php echo $aTitle[$c]; $c++;?> </td> </tr> <?php }}?> </table>
  15. Hi everyone, I am having trouble passing/displaying the values inside of a selected list. I created a add/remove list using Jquery and I tried to display the values passed using foreach and for loops but it is still not working. The values I am trying to get are $existing_mID[$j], which is inside of the option value attribute. Please kindly let me know what should I do in order to get the values and I really appreciate your help. <?php $selected = $_POST['selectto']; if(isset($selected)) { echo "something in selected<br />"; for ($i=0;$i<count($selected);$i++) echo "selected #1 : $selected[$i]"; foreach ($selected as $item) echo "selected: item: $item"; } ?> This is the form <form> <select name="selectfrom[]" id="select-from" multiple="" size="10"> <?php $j=0; foreach($existing_mTitle as $item) { ;?> <option value="<?php $existing_mID[$j];?>" > <?php echo "$existing_mID[$j] & $item";$j++;?> </option> <?php }?> </select> <a href="JavaScript:void(0);" id="btn-add">Add »</a> <a href="JavaScript:void(0);" id="btn-remove">« Remove</a> <select name="selectto[]" id="select-to" multiple="" size="10"></label> </select> <input type="submit" name="addArticle" value="Add" /> </form> Below is my Jquery code that I implemented. $(document).ready(function() { $('#btn-add').click(function(){ $('#select-from option:selected').each( function() { $('#select-to').append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option>"); $('#select-to option').attr('selected',true); $(this).remove(); }); }); $('#btn-remove').click(function(){ $('#select-to option:selected').each( function() { $('#select-from').append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option>"); $('#select-to option[value=' +$(this).val()+ ']').attr('selected',true); $(this).remove(); }); }); });
  16. i can do stuff in html, php, flash, java and server developement and work for more then 8 years in different segments for webprogramming. german.
  17. I would like to create a VOIP chat in real time (audio only) from pc to pc over internet, i know more than basic in ​​html5, php, javascript mysql mainly, but this is totally new to me(VOIP audio or call chat), I have no idea if it is possible to transmit audio in real time using those languages​​, if you could help me or know something about it would appreciate it, I've searched internet and but can´t find something that tells me a path. I appreciate your comments. thank you very much.
  18. Hi, I've been looking at the Bootstrap 3 and various tutorials / example sites even from their own website. This has lead me to a question I cannot seem to find a quick answer to why do they use divs over the new HTML5 tags such as nav. For example; <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project name</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#contact">Contact</a></li> </ul> </div><!--/.nav-collapse --> </div> </div> Comapred to something more like; <div class="container"> <nav> <ul> <li><a href="#"> Home </a></li> </ul> </nav> </div> I know these two examples don't match up in the slightest but I'm not looking for the synatx just an explaniation. Is it the fact that HTML5 is still the draft stages and IE doesn't handle nav to gracefully wihtout shiv etc... Or is the developer of the examples is just a bit lazy and couldn't be bothered to swap it to the newer tags? The reason I ask is I'm not too sure which way would be the best for developing a site using bootstrap. Thanks in advance.
  19. Newb here. My form works with sessions and the video loads etc, data submits, etc. all that is good. But i've gotten lost in the complexity of the build it seems and my html has become malformed I think. As a result each submission or page reload inserts another form inside the form inside the form etc etc etc. It some sort of weird looping madness or something. I'm very new to classes and how they work and i can't find where the madness is coming from. To duplicate the error, fill out the form and submit (the video won't play in firefox so use safari or chrome to test). I've been trying to resolve this for hours - i'm very lost in the complexity. <?php # '../' == sub-folder. use './' == root require '../inc_0700/config_inc.php'; #provides configuration, pathing, error handling, db credentials echo '<link rel="stylesheet" type="text/css" href="w05c09_gojiraIncidentReport.css">'; //END CONFIG AREA ---------------------------------------------------------- # Read the value of 'action' whether it is passed via $_POST or $_GET with $_REQUEST if(isset($_REQUEST['act'])){$myAction = (trim($_REQUEST['act']));}else{$myAction = "";} switch ($myAction){//check 'act' for type of process case "display": # 2)Display user's name! showObjects(); break; case "clear": # 3 Clear the session data clearObjects(); showForm(); break; default: # 1)Ask user to enter their name showForm(); } function showForm(){# shows form so user can enter their name. Initial scenario get_header(); #defaults to header_inc.php echo '<script type="text/javascript" src="' . VIRTUAL_PATH . 'include/util.js"></script> <script type="text/javascript"> function checkForm(thisForm){//check form data for valid info if(empty(thisForm.YourName,"Please Enter Your Name")){return false;} return true;//if all is passed, submit! } </script> <video id="bgVideo" preload="auto" autoplay="true" loop="loop" muted="muted" volume="0" poster="_bgGrfxs/bg_vidGlobe.jpg"> <source src="_bgVideo/bg_vidLoop.mp4" type="video/mp4"/> <source src="_bgVideo/bg_vidLoop.ogv" type="video/ogg"/> </video> <!-- This image stretches exactly to the browser width/height and lies behind the video--> <div id="bodyDummy"> <!-- <h3 align="center"">' . smartTitle() . '</h3>--> <br /> <br /> <br /> <br /> <br /> <br /> <form align="center" action="' . THIS_PAGE . '" method="post" onsubmit="return checkForm(this);"> <img width="10%" src="img_logo-panPacificDefenseCenter.png" alt="Kaiju Incident Reporter"/> <br /> <h2 style="color: #ff6d26;">Incident Report Form</h2> <br /> <!-- incWho? --> <br /> <b>Reporting Officer ID:</b><br /> <input type="text" name="incWho" placeholder="Please enter your full name here" /> <br /> <br /> <!-- incWhat --> <b><a id="orange" href="http://godzilla.wikia.com/wiki/Main_Page">Massive Unidentified Terrestrial Organism encountered:</a></b><br /> <select type="text" name="incWhat" data-placeholder="Select Incident Location..." class="chzn-select" multiple style="width:354px;" tabindex="40"> '; include 'ddlist-Kaiju.php'; echo '</select> <br /> <br /> <!-- incWhen = date of incident --> <b>Date of Incident:</b><br /> <input type="text" name="incWhen" placeholder="Please enter your full name here" /> <br /> <br /> <!-- incWhere --> <b>Incident Location:</b><br /> <select type="text" name="incWhere" data-placeholder="Select Incident Location..." multiple style="width:354px;" tabindex="111"> '; include 'ddlist-countriesInternational.php'; echo '</select> <br /> <br /> <!-- incWhy --> <b>Incident notes:</b><br /> <textarea name="incWhy" cols="54" rows="3" placeholder="Please enter any details you can recall of the incident - if incident is still occurring run" ></textarea> <br /> <br /> <!-- incScale --> <b>Rate the severity of the incident (0 to 5):</b> <br /> <br /> <input type="range" data-show-value="true" data-hightlight="true" data-popup-enabled="true" name="incScale" min="0" max="5" value="0" onchange="updateTextInput(this.value);"> <br /> <br /> <input id="go" type="submit" value="Go!"> </p> <input type="hidden" name="act" value="display" /> </form> <br /> <p style="#444"><i>Once you have completed your incident report, Run! For the love god man run, run for the hills and be safe!</i></p> '; get_footer(); #defaults to footer_inc.php echo '</div><!-- END bodyDummy -->'; } function showObjects() {#form submits here we show entered name //dumpDie($_POST); //if the session is not started, that could be a problem get_header(); #defaults to footer_inc.php if(!isset($_SESSION)){session_start();} echo "<br />"; if(!isset($_SESSION['kSession'])) {//if no session exists, create it $_SESSION['kSession']= array(); } //we need to add post data here $_SESSION['kSession'] [] = new incReport($_POST['incWho'], $_POST['incWhat'], $_POST['incWhen'], $_POST['incWhere'], $_POST['incWhy'], $_POST['incScale']); $totalScale = 0; foreach($_SESSION['kSession'] as $incReport)//loop thru each array item { echo $incReport; $totalScale += $incReport->incScale; } $totalReports = count($_SESSION['kSession']); $aveRating = $totalScale/$totalReports; echo '<div style="margin: auto; padding:0 10px; background-color:#ff6d26;width: 300px";><p style="color:white;">Average Incident Severity:</p> <h1 style="color:white;";>'; echo "$aveRating"; echo'</h1></div>'; if ($aveRating == 5){ echo '<p>Five: We suggest you make peace with this, your final moment.. enjoy the sunset before that giant foot comes down on you.</p>';} if ($aveRating == 4){ echo '<p>Four: The end is near, run man run, she isn\'t worth it, save yourse<p>lf.</p>';} if ($aveRating == 3){ echo '<p>Three: And your still there? Seriously?</p>';} if ($aveRating == 2){ echo '<p>Two: Take a picture, it will last longer. Now. Run for the hills!</p>';} if ($aveRating == 1){ echo '<p>One: Have you considered running?</p>';} if ($aveRating == 0){ echo '<p>Zero: This would be a good time to consider moving to a safer vantage point.</p></form></div><!--end dummy-->';} //get_footer(); #defaults to footer_inc.php //------end of work area-------// get_header(); #defaults to footer_inc.php if(!isset($_POST['incWho']) || $_POST['incWhat'] == ''){//data must be sent feedback("No form data submitted"); #will feedback to submitting page via session variable myRedirect(THIS_PAGE); } if(preg_match('[^A-Za-z0-9]', $_POST['incWho'])){//data must be alphanumeric only feedback("Only letters & numbers are allowed."); #will feedback to submitting page via session variable myRedirect(THIS_PAGE); } $myName = strip_tags($_POST['incWho']);# here's where we can strip out unwanted data } function clearObjects(){ //echo "clearing objects here"; if(!isset($_SESSION)){session_start();} unset($_SESSION['kSession']); feedback("session cleared"); } class incReport{ public $incWho = ""; public $incWhat = ""; public $incWhen = ""; public $incWhere = ""; public $incWhy = ""; public $incScale = ""; function __construct($incWho, $incWhat, $incWhen, $incWhere, $incWhy, $incScale){ $this->incWho=$incWho; $this->incWhat=$incWhat; $this->incWhen=$incWhen; $this->incWhere=$incWhere; $this->incWhy=$incWhy; $this->incScale=$incScale; } function __toString(){ static $kID = 1;//kaiju incident number $myReturn = '<video id="bgVideo" preload="auto" autoplay="true" loop="loop" muted="muted" volume="0" poster="_bgGrfxs/bg_vidGlobe.jpg"> <source src="_bgVideo/bg_vidLoop.mp4" type="video/mp4"/> <source src="_bgVideo/bg_vidLoop.ogv" type="video/ogg"/> </video> <div id="bodyDummy"> <br /> <br /> <br /> <br /> <br /> <br /> <form><p> Incident ID: kID00' . $kID ; //works $kID++; //iterate report $myReturn .= ' | Incident Reported by: ' . $this->incWho . ' ' ;//works $myReturn .= ' | Massive Terrestial Organsim Observed: ' . $this->incWhat . ' ' ;//shows where... $myReturn .= ' | Date of Incident: ' . $this->incWhen . ' ' ; //works $myReturn .= ' | Incident Location: ' . $this->incWhere . ' '; //shows what $myReturn .= ' | Incident Details: ' . $this->incWhy. ' '; // working $myReturn .= ' | Incident Severity: ' . $this->incScale . '</p> <p align="center"><a href="' . THIS_PAGE . '">File Report, then Run!</a> | <a href="' . THIS_PAGE . '?act=clear">Reset</a></p> ' ; return $myReturn; } }
  20. We are a Silicon Valley based startup and 30-60 days away from launch. We are seeking a partner and outstanding web developer to be responsible for developing and implementing innovative and secure web application for our eCommerce business. The person would work closely with our Marketing, Sales, Engineering and IT members to develop specifications and make recommendations on the use of new and emerging technologies and then implement those recommendations. Design, Programming, and database administration are all elements of this position. This person must have following experience and skills: - HTML5, XHTML, CSS3, PHP, and JavaScript, AJAX, jQuery, responsive frameworks and other technologies - command of web standards, CSS-layouts, DOM scripting, cross-browser compatibility & browser degradation strategies - working with the various JavaScript and PHP libraries - understanding of dynamic or active web content and the use of CGI, Perl, Java, XML and JSON - experience with SQL database (MySQL) - little understanding of Unix/Linux system and Apache web-server administration - experience working with Google Webmaster Tools, Google Analytics, and Google Custom Search - develop responsive and mobile websites
  21. Hi All, I have a question for you all. My client would like a component developed for Joomla that will allow them to upload PDF magazines to the website and then it be output on the PDF in a secure format so they cannot be downloaded or copied. Does anyone know of an open source solution that might enable me to do this. The requirement is that this not be made using flash so that it will work on iOS devices. There are two ways I can see this working, either when the PDF is uploaded it gets converted into a different format so it can simply be integrated into the page when output, or the PDF gets uploaded as it, and it output in some wrapper that will protect it, im really not quite sure, you any advice will be great! Thanks for your help! I look forward to hearing your responses.
  22. I am modifying someone else's code to do this website and I am not sure how to do this correctly in html5 and php. This is how it currently is. /*------------------------------------------------------------------ Begin to find start/end times NOTE: if s_date_time_opts is false we are editing all events and there will not be any data to get -------------------------------------------------------------------*/ if( $s_date_time_opts ) { if( request_var('calAllDay', '') == "ON" ) { $event_start_date = 0; $event_end_date = 0; $event_data['event_all_day'] = 1; $event_data['event_day'] = sprintf('%2d-%2d-%4d', $date['day'], $date['month_no'], $date['year']); $sort_timestamp = gmmktime( 0,0,0,$date['month_no'], $date['day'], $date['year']); } else { $start_hr = request_var('calHr', 0); $start_mn = request_var('calMn', 0); $event_start_date = gmmktime($start_hr, $start_mn, 0, $date['month_no'], $date['day'], $date['year'] ) - $user->timezone - $user->dst; $sort_timestamp = $event_start_date; $end_m = request_var('calMEnd', 0); $end_d = request_var('calDEnd', 0); $end_y = request_var('calYEnd', 0); $end_hr = request_var('calHrEnd', 0); $end_mn = request_var('calMnEnd', 0); $event_end_date = gmmktime($end_hr, $end_mn, 0, $end_m, $end_d, $end_y ) - $user->timezone - $user->dst; $event_data['event_all_day'] = 0; $event_data['event_day'] = ''; // validate start and end times if( $event_end_date < $event_start_date ) { $error[] = $user->lang['NEGATIVE_LENGTH_EVENT']; } else if( $event_end_date == $event_start_date ) { $error[] = $user->lang['ZERO_LENGTH_EVENT']; } } $event_data['event_start_time'] = $event_start_date; $event_data['event_end_time'] = $event_end_date; $event_all_day = $event_data['event_all_day']; $event_day = $event_data['event_day']; } /*------------------------------------------------------------------ End start/end times -------------------------------------------------------------------*/ and an input field in the same php file $all_day_check = "<input type='checkbox' name='calAllDay' value='ON' clicked='clicked' onclick='toggle_all_day_event()' />"; some javascript in the html file function toggle_all_day_event() { if( document.postform.calAllDay.checked ) { document.postform.calMEnd.disabled=true; document.postform.calDEnd.disabled=true; document.postform.calYEnd.disabled=true; document.postform.calHr.disabled=true; document.postform.calMn.disabled=true; document.postform.calHrEnd.disabled=true; document.postform.calMnEnd.disabled=true; } else { document.postform.calMEnd.disabled=false; document.postform.calDEnd.disabled=false; document.postform.calYEnd.disabled=false; document.postform.calHr.disabled=false; document.postform.calMn.disabled=false; document.postform.calHrEnd.disabled=false; document.postform.calMnEnd.disabled=false; } } and some html further down in the html file <fieldset class="fields1"> <dl style="clear: left;"> <dt><label>All Day Event:</label></dt> <dd>{ALL_DAY_CHECK}</dd> </dl> </fieldset> First off I would like the All Day Event checkbox currently on the page to be hidden and unchecked by default, or baring that unchecked and the disabled fields to be enabled and if checked later to disable the fields. I thought I might be able to initialize the calAllDay variable earlier in the php file with this // Intialize Calendar All Day Event to Off $calAllDay = 'OFF'; and change the input checkbox to this $all_day_check = "<input type='checkbox' name='calAllDay' value='ON' onclick='toggle_all_day_event()' />"; but the behavior of this sets the checkbox to unchecked (like I could live with) but the disabled fields in the form are still disabled untill I check the checkbox and then uncheck it again. I want the fields to be enabled on load.
  23. Iv got the stripe checkout button working with its own static fields. Iv got a form which I want to pass the name , email and amount data to the stripe charge page. the amount is calculated and stored in this variable : grand_total here is the code for the charge page : <?php require_once(dirname(__FILE__) . '/config.php'); $token = $_POST['stripeToken']; $customer = Stripe_Customer::create(array( "email" => 'email', "card" => $token, )); $charge = Stripe_Charge::create(array( 'customer' => $customer->id, 'amount' => 2499, 'currency' => 'usd' )); echo '<h1>Successfully charged $24.99!</h1><br/>'; $_SESSION['stripeToken'] = $token; ?> Here is the code for the form fields : <div class="formfield"><label for="Name" class="formlabel">Name</label><input type="text" name="Name" id="Name" size="50" /></div> <div class="formfield"><label for="Email_Address" class="formlabel">Email</label><input type="text" name="Email_Address" id="Email_Address" size="50" /></div> Thanks for the help
  24. I am looking for a webdesigner / coder who can create the basic CSS for a fluid adaptive website. The main layout would be something like the 'Mondrian' example here http://designshack.net/articles/css/5-really-useful-responsive-web-design-patterns/ navigation design would be something like this. http://www.impressivewebs.com/demo-files/css3-glow-tabs/ At the moment I am too busy with different projects to spend a lot of time figuring out the new CSS possibilities and therefore I am looking for someone to help me. Please contact me by PM on phpfreaks thank you anatak
  25. I find this website is very good for downloading PHP + MySQL, HTML5 + CSS, WordPress, Magento document and video tutorial. I am happy to share with you, guys, Have a nice day. http://dvdit.org/
×
×
  • 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.