Jump to content

Search the Community

Showing results for tags 'html'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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 (Dreamweaver, Zend, 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


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 68 results

  1. Is there away to get something unique on a client computer? I read about ActiveX but it is only works on IE. I need something that can work on other browsers also, maybe on PHP or on Javascript.
  2. Hello! I hope someone can help me with an issue I'm having. Recently, I have had an issue displaying my banner on my website, which is has a .php file source. I have had any known changes to my php version (currently on 5.6, and considering to switch to 7.0); also, I am hosted through Dreamhost. If someone could look at the following code and offer any advice, I'd be greatly appreciative! My link on the design: <img src= "http://hayalkarga.com/theme/10/images/banner/banner.php" alt= "" /> The Image Code: <?php $dir = ''; $file = ''; $num = 0; $count = 0; $array = array(); $allowedExtensions = array('jpeg', 'jpe', 'jpg', 'gif', 'png', 'bmp'); mt_srand((double)microtime()*1000000); $dir = opendir('.'); while (false !== ($file = readdir($dir))) { if(!is_dir($file) && in_array(strtolower(substr(strrchr($file,'.'), 1)), $allowedExtensions)){ $array[] = $file; } } $count = count($array); $num = mt_rand(0, $count-1); if($count > 0) { $size = getimagesize($array[$num]); $stream = fopen($array[$num], 'rb'); if(is_array($size) && $stream !== false){ header('Content-type: '.$size['mime']); fpassthru($stream); exit(); } } else { echo 'Error: No Images'; } ?> I should note that the image works in my browser at http://www.hayalkarga.com/theme/10/images/banner/banner.php, but does not incorporate into the design when utilizing the link in HTML. Thank you in advance!
  3. Hi all, I am a real newbie with PHP and mysql. I am trying to create a thumbnail carousel to present all the web applications we have in house.I am using some code from this demo because it does close to everything I need. The problem is that it displays only one image per slide and I would like to display multiple items per slide instead. Is it possible with a foreach loop for example? Code: <?php include_once('db.php'); $query = "select * from images order by id desc limit 6"; $res = mysqli_query($connection,$query); $count = mysqli_num_rows($res); $slides=''; $Indicators=''; $counter=0; while($row=mysqli_fetch_array($res)) { $title = $row['title']; $desc = $row['desc']; $image = $row['image']; if($counter == 0) { $Indicators .='<li data-target="#carousel-example-generic" data-slide-to="'.$counter.'" class="active"></li>'; $slides .= '<div class="item active"> <img src="images/'.$image.'" alt="'.$title.'" /> <div class="carousel-caption"> <h3>'.$title.'</h3> <p>'.$desc.'.</p> </div> </div>'; } else { $Indicators .='<li data-target="#carousel-example-generic" data-slide-to="'.$counter.'"></li>'; $slides .= '<div class="item"> <img src="images/'.$image.'" alt="'.$title.'" /> <div class="carousel-caption"> <h3>'.$title.'</h3> <p>'.$desc.'.</p> </div> </div>'; } $counter++; } ?> <!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" xml:lang="en" lang="en"> <head> <title>Dynamic image slider using twitter bootstrap & PHP with MySQL | PGPGang.com</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <style type="text/css"> img {border-width: 0} * {font-family:'Lucida Grande', sans-serif;} </style> </head> <body onload="changePagination('0','first')"> <h2>Dynamic image slider using twitter bootstrap & PHP with MySQL Example. => <a href="http://www.phpgang.com/">Home</a> | <a href="http://demo.phpgang.com/">More Demos</a></h2> <link rel="stylesheet" href="css/bootstrap.min.css" /> <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script> <script src="js/bootstrap.min.js"></script> <style> .carousel-caption { background-image: url("http://www.phpgang.com/wp-content/themes/PHPGang_v2/img/bg_sidebar.png"); } .carousel-inner>.item>img, .carousel-inner>.item>a>img { height:400px; width:700px; } </style> <div class="container" style="width: 730px;"> <h2>Dynamic Image Slider</h2><span style="float: right;margin-top: -30px;"><a href="addnew.php">Add More Images</a></span> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <?php echo $Indicators; ?> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <?php echo $slides; ?> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </body> </html> Thanks, Alex
  4. Hello PHP freak members I learn how to ecrypt my password using the blow fish method but I'm having trouble decypting the password. Is there anyone that can over see the problem that I'm having? Sample ecrypted password > $2y$09$Q5klufp7bj6iuBA3dHpz5.fLN1sLzeGKE7nuXKunLMKKvE.rZtSTW Original password > 1234 <?php error_reporting(E_ALL & ~E_NOTICE); session_start(); if(isset ($_SESSION['id'])){ header('location: profile.php'); } else { if($_POST['submit']){ include "connect_prompt/connect_query.php"; $email = mysqli_real_escape_string($db_conx,$_POST['email']); $password_one = $_POST['password_one']; ///////////////// Blow Fish /////////////////////////////////// function cryptPass($input, $rounds = 9){ $salt = ""; $saltChars = array_merge(range('A','Z'),range('a','z'),range(0,9)); for($i = 0; $i < 22; $i++){ $salt .= $saltChars[array_rand($saltChars)]; } return crypt($input, sprintf('$2y$%02d$', $rounds) . $salt); } $password_one = $_POST['password_one']; $password = $_POST['password']; $hashedPass = cryptPass($password); if(crypt($password_one, $hashedPass) == $hashedPass){ ///////////////// Blow Fish /////////////////////////////////// $sql = "SELECT id, email, password FROM customer WHERE email='$email' AND password='$password_one' LIMIT 1"; $query = mysqli_query ($db_conx, $sql); if($query){ $row = mysqli_fetch_row($query); $userID = $row[0]; $db_email = $row[1]; $db_password = $row[2]; } if($email == $db_email && $password_one == $db_password){ $_SESSION['email'] = $email; $_SESSION['id'] = $userID; header("location: profile.php"); } else { echo "Sorry, Username or Password was incorrect"; } } } } ?> <form action="login.php" method="POST"> <input type="email" name="email" id="email" placeholder=" your@email.com" /> <br/><br/> <input type="password" name="password_one" id="password_one" placeholder=" ********" /> <br/><br/> <input type="submit" name="submit" value="SIGN IN" /> </form>
  5. Hi, I have forgotpass.php code. But I dont have a forgotpass.html code. I tray somethink but it's not working. I need cust html code, for the this php code. Thank you and regards. <? include("header.php"); $error = $diplay = ""; if(isset($_POST['sendmepass'])) { $mem_email = $affiliater->GetEmailByUsername($_POST['affiliatername']); if ($mem_email != "") { $newpass = generatePassword(); $affiliater->ReminderPassword($_POST['affiliatername'], $newpass); //Send mail $to = $mem_email; $subject = 'Password Reminder'; $body = str_replace("{USERNAME}", $_POST['affiliatername'], FORGOTMAILDETAIL); $body = str_replace("{NEWPASSWORD}", $newpass, $body); $headers = "Content-Type: text/html; charset=iso-8859-1\n"; mail($to, $subject, $body, $headers); $error = "Your password will be e-mailed to you at the e-mail address you registered with the system! Please check it to recovery your password"; $diplay = "style='display: none;'"; }else $error = "User inactive or not exists! Please type exactly affiliatername which you used to registry"; } $template->set_filenames(array("body" => "forgotpass.html")); $template->assign_vars(array( 'ERROR' => $error, 'DIPLAY' => $diplay, 'USERNAME'=> "Username", )); $template->pparse("body"); include("footer.php"); ?>
  6. I am trying to display some images dynamically from a mysql table. This is what I tried it with PHP and its working for me. // Fetch all the records: while ($stmt->fetch()) { $html = " <div class='row-fluid custom'>\n"; $html .= " <div class='span6'>\n"; $html .= " <img src='images/{$image}'>\n"; $html .= " </div>\n"; $html .= " </div>\n"; //Add images to array $images[] = $html; } And this is the markup from about PHP: <div class='row-fluid custom'> <div class='span6'> <img src='images/cond-1.png'> </div> </div> <div class='row-fluid custom'> <div class='span6'> <img src='images/cond-2.png'> </div> </div> <div class='row-fluid custom'> <div class='span6'> <img src='images/cond-3.png'> </div> </div> <div class='row-fluid custom'> <div class='span6'> <img src='images/cond-4.png'> </div> </div> But my problem is, now I need to modify above Markup to like this. <div class="row-fluid custom"> <div class="span6"> <img src="images/cond-1.png"> </div> <div class="span6"> <img src="images/cond-2.png"> </div> </div> <div class="row-fluid custom"> <div class="span6"> <img src="images/cond-3.png"> </div> <div class="span6"> <img src="images/cond-4.png"> </div> </div> Can anybody tell me how I create like that markup using php? Hope somebody may help me out. Thank you.
  7. I have a set of items to select from mysql. And then I want to display these items on my page with different 'markup`. This is how my HTML look like for each item. <ul class='unstyled main-facilities row'> <li class='info-facility-item '> <span class='fa-stack'> <i class='fa fa-square fa-stack-2x'></i> <i class='fa fa fa-cutlery fa-stack-1x fa-inverse'></i> </span> Item-01 </li> <li class='info-facility-item '> <span class='fa-stack'> <i class='fa fa-square fa-stack-2x'></i> <i class='fa fa fa-rss fa-stack-1x fa-inverse'></i> </span> Item-02 </li> <li class='info-facility-item '> <span class='fa-stack'> <i class='fa fa-square fa-stack-2x'></i> <i class='fa fa-refresh fa-stack-1x fa-inverse'></i> </span> Item-03 </li> ... ... ... </ul> If I have same markup for each item, then I can do it like this: // Fetch all the records: while ($stmt->fetch()) { $result = "<li class='info-facility-item '>\n"; $result .= " <span class='fa-stack'>\n"; $result .= " <i class='fa fa-square fa-stack-2x'></i>\n"; $result .= " <i class='fa fa fa-rss fa-stack-1x fa-inverse'></i>\n"; $result .= " </span>{$item}\n"; $result .= "</li>\n"; $items[] = $result; } } But I am not sure how to modify my `while` loop to render different markup for each item. Can anybody tell me is there a way to do this in PHP? Thank you.
  8. hey guys, i am trying to auto generate an email. i have a function that calls for the following use of : <?php $emailSub = 'Test Subject'; $emailTo = 'myemail@gmail.com'; $emailMsg = 'You have a new email that must be read below:<br> '; mail($emailTo,$emailSub,$emailMsg); ?> i dont seem to get any email. any suggestions as to why ?
  9. I have 3 variables coming from 3 columns from a table. I want to insert these variables into 3 columns in a different table. Variables are name, cover, and pageno. The issue is I can see the values in the hidden inputs this is when the page loads when nothing is selected in the combobox??? If I select book number two the same values are in the hidden inputs. If I select book one this is what I see because when the page loads it populates the values as book 1. <input type="hidden" name="cover" value="cover 1"> <input type="hidden" name="pageno" value="pageno 1"> If I select book two this is what I see. <input type="hidden" name="cover" value="cover 1"> <input type="hidden" name="pageno" value="pageno 1"> Make sense? If not, no matter which book I select I see the same values. Here's the code. <select name="name"> <option value="<?php echo "{$_POST['name']}"; ?>"> </option> <?php include('theconnection.php'); $con = mysqli_connect($host,$user,$pass,$dbName); if (!$con) { die('cannot connect: ' . mysqli_error($con)); } mysqli_select_db($con,"thebooks"); $result = mysqli_query($con,"SELECT * FROM books"); $result = mysqli_query($con,"SELECT b.id, b.name, b.cover, b.pageno FROM books"); $cover = ''; $pageno = ''; while($row = mysqli_fetch_array($result)) { echo ("<option value='$row[name]'>$row[name] $row[cover], $row[pageno] </option>"); $cover = "$row[cover]"; $pageno = "$row[pageno]"; } ?> </select> <input type="hidden" name="cover" value="<?php echo $cover; ?>"> <input type="hidden" name="pageno" value="<?php echo $pageno; ?>"> Maybe Javascript will work? I can't figure out how to do this with Javascript either.
  10. <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="/bfg.mp4"target="mvideo">hgfiy</a> </div> </div> <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="bbg.mp4"target="mvideo"><!--vimeo video--> <iframe width="610" height="490" src="bbg.mp4" frameborder="0" name="mvideo" allowfullscreen></iframe> <!--vimeo video--></a> </div> </div> <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="/bfg.mp4"target="mvideo">hgfiy</a> </div> </div> <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="bbg2.mp4"target="mvideo"><!--vimeo video--> <iframe width="610" height="490" src="bbg2.mp4" frameborder="0" name="mvideo" allowfullscreen></iframe> <!--vimeo video--></a> </div> </div> i have the code above.how can I make a video elent a link in a side bar such that when a user clicks it it shows in main iframe
  11. Hello all, I have a website with a form that I want a user to fill out then if it is valid I have the button submit and I want it to email me. The message. If success full I want a message to popup on screen saying success I am using bootstrap 4 <div class="messageSuccess"></div> <div class="row"> <div class="col-md-9 mb-md-0 mb-5"> <form id="contact-form" name="contact-form" action="" method="post"> <!--action="contactEmail.php" --> <div class="row "> <div class="col-md-6 "> <div class="md-form mb-0 "> <input class="form-control" type="text" id="txtName" name="txtName" required /> <label for="txtName">Your Name </label> <div class="nameError"></div> </div> </div> <div class="col-md-6 "> <div class="md-form mb-0 "> <input class="form-control" type="text" id="txtEmail" name="txtEmail" required /> <label id="lblEmail" for="txtEmail">Your Email Address </label> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="md-form mb-0"> <input class="form-control" type="text" id="txtSubject" name="txtSubject" data-error="Subject Here" required /> <label for="txtSubject">Subject </label> <div class="help-block with-errors"></div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="md-form"> <textarea class="form-control" type="text" id="txtMessage" name="txtMessage" rows="4" required data-error="Please leave us a message."></textarea> <label for="txtMessage">Your Message </label> </div> </div> </div> <div class="text-center text-md-left"> <input type="submit" id="BtnFormSubmit" class="btn btn-primary btn-xl text-white" value="Send Message" /> </div> <div class="status"></div> </form> <!-- JavaScript Inner File Form Validation --> <script type="text/javascript"> $(document).ready(function () { var form = $("#contact-form"); var name = $("#txtName").val(); var email = $("#txtEmail").val(); var subject = $("#txtSubject").val(); var message = $("#txtMessage").val(); var btnSubmit = $("BtnFormSubmit"); $(form).submit(function (event) { if (this.checkValidity() == false) { $(this).addClass("was-validated"); event.preventDefault(); event.stopPropagation(); } alert("Form Valid to create message"); if (!event.isDefaultPrevented) { alert("passed prevent default"); var url = "testemail.php"; // POST values 'ajax' $.ajax({ type: "POST", url: url, data: $(this).serialize(), success: function (data) { // done: // data = JSON object object for contactEmail.php // recieve message type: success | danger var messageAlert = "alert- " + data.type; var messageText = data.message; // Bootstrap alert box HTML var alertBox = '<div class="alert ' + messageAlert + ' alert-dismissable"><button type="button" class="close" ' + 'data-dismiss="alert" aria-hidden="true">&times;</button>' + messageText + '</div>'; // if messageAlert and messageText if (messageAlert && messageText) { // Put message on page in messageSuccess section. $(form).find("#messageSuccess").html(alertBox); // Reset the form. $(form)[0].reset(); } } }); //return false; } }); //$(name).blur(function () { //}) // Validate :inputs $(":input").blur(function () { let controlType = this.type; switch (controlType) { case "text": case "password": case "textarea": validateText($(this)); break; case "email": validateEmail($(this)); break; default: break; } }); // each :input focusin remove existing validation messages if any. $(":input").click(function () { $(this).removeClass("is-valid is-invalid"); }) /* OPTIONAL ':input' KEYDOWN validation messages remove */ // Reset Form and remove all validation messages. $(":reset").click(function () { $(":input").removeClass("is-valid is-invalid"); $(form).removeClass("was-validated"); }); }); // Validate Text Function function validateText(control) { let textField = control.val(); if (textField.length > 1) { $(control).addClass("is-valid"); } else { $(control).addClass("is-invalid"); } } // Validate Email Function (Email newer regex: /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/ ) function validateEmail(control) { let textField = control.val(); let regexPattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b$/i; if (regexPattern.test(textField)) { $(control).addClass("is-valid"); } else { $(control).addClass("is-invalid"); } } </script> <?php $from = 'SampleEmail@YourEmail.com'; $sendTo = 'sample@Gmail.com'; $subject = 'Your Message Subject Here';// Email Message Contact Form Fields // Array - ($varName => Text from controls) $controls = array('txtName' => 'Name', 'txtEmail' => 'Email', 'txtSubjext' => 'Subject', 'txtMessage' => 'Message'); $successMessage = 'Contact Message Successfully Sent. Thank you, I will get back to you soon.'; $errorMessage = 'There was an error submitting your message, Please try again. Or try later.'; error_reporting(E_ALL & ~E_NOTICE); try { if(count($_POST) == 0) throw new \Exception('Contact Form Message is empty'); $emailText = "You have a new message from your contact form\n------------------------------------------------------\n"; foreach($_POST as $key => $value) { if(isset($controls[$key])) { $emailText .= "$controls[$key]: $value\n"; } } $headers = array('Content-Type: text/plain; charset="UTF-8";', 'From: ' . $from, 'Reply-To: ' . $from, 'Return-Path: ' . $from, ); // Send email mail($sendTo, $subject, $emailText, implode("\n", $headers)); $responseArray = array('type' => 'success', 'message' => $successMessage); } catch(\Exception $e) { $responseArray = array('type' => 'danger', 'message' => $errorMessage); } // If AJAX request return JSON response **RARE** if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $encodedJSON = json_encode($responseArray); header('Content-Type: application/json'); echo $encodedJSON; } else { echo $responseArray['message']; } ?>
  12. I am trying to send a basic email that is multipart via the mail() function in php. I am not interested in using PHPmail. This should be very light weight. Currently when I send email to gmail, it is sending the html part as plain text so all the tags are showing. Here is my code: //GET VAR INPUT $to = htmlentities($_GET['to']); $friendly_from = htmlentities($_GET['friendly_from']); $email_from = htmlentities($_GET['email_from']); $subject = htmlentities($_GET['subject']); $text = htmlentities($_GET['text']); $html = htmlentities($_GET['html']); //SEND EMAIL # Setup mime boundary $mime_boundary = 'Multipart_Boundary_x' . md5(time()) . 'x'; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\r\n"; $headers .= "Content-Transfer-Encoding: 7bit\r\n"; $headers .= "Reply-To: " . $email_from . " \r\n"; # Add in plain text version $body.= "--$mime_boundary\n"; $body.= "Content-Type: text/plain; charset=\"charset=us-ascii\"\n"; $body.= "Content-Transfer-Encoding: 7bit\n\n"; $body.= $text; $body.= "\n\n"; # Add in HTML version $body.= "--$mime_boundary\n"; $body.= "Content-Type: text/html; charset=\"UTF-8\"\n"; $body.= "Content-Transfer-Encoding: 7bit\n\n"; $body.= $html; $body.= "\n\n"; # End email $body.= "--$mime_boundary--\n"; # <-- Notice trailing --, required to close email body for mime's # Finish off headers $headers .= "From: " . $friendly_from . " <" . $email_from . ">\r\n"; $headers .= "X-Sender-IP: " . $_SERVER[SERVER_ADDR] . "\r\n"; $headers .= 'Date: ' . date('n/d/Y g:i A') . "\r\n"; # Mail it out return mail($to, $subject, $body, $headers); Here is what I am receiving. (And yes I can accept html emails).
  13. Hello, The below is the code i have i want to track down the ipaddress of the people who ever subscribed to my list. I am beginner in php kindly do the needful. Thanks a lot in advance. <!-- Subscribe form --> <form action="subscribe/NLprocess.php" method="post"> <h6 class=footer-widget-heading>Enter your email:</h6> <div class="input"> <input type="text" class="button" name="email" placeholder="Email address"> <input type="submit" class="button" id="submit" value="Subscribe"> </div> </form> <!-- End subscribe form --> The processing file NLprocess.php ---- $emailmanager = 'smallstamps@gmail.com'; // SECOND: // save this file, and close it. Thank you! error_reporting(0); $email = trim($_POST['email']); $Ok = ereg("^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $email); if ($Ok) { mail($emailmanager,'Subscribe','','From: '.$email); if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm)) { ?> <script language = 'javascript'> alert('Thank you, Now you Subcribed to smallstamps.com Updates'); history.go(-1); </script> <? exit(); } } else { if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm)) { ?> <script language = 'javascript'> alert('Sorry, please provide a valid Email address.'); history.go(-1); </script> <? exit(); } } ?> Kindly let me know what i have to do to track the ip address.
  14. I'm using a plugin to include a photo gallery on a wordpress site. At the bottom of the page in the footer I include <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> just like the samples I look at do it here http://getbootstrap.com/getting-started/#examples The problem is that the plugin doesn't work when I include jquery. I posted the probelm here https://wordpress.org/support/topic/huge-it-doesnt-work-with-google-ajax-jquery And the reply was jQuery should not be called this way? That's the way the samples do it You try to call jQuery in no standard way? It's the same in every footer Sooo, how do you call jquery and what is the standard way? Thanks in advance
  15. Hello there, my name is Ryan. I am a Web Developer from England that specialises in creating mobile-responsive websites. Whether you need a website that takes monthly payments, one-off purchases or runs ads I will take your idea and craft an elegant solution. Skills - PHP HTML5 CSS Javascript I have built user-interfaces and backend database systems, in my 10 years of web development there is little I haven't touched upon. If you are interested in my services you can contact me at: Email ryansocratous@gmail.com Skype ryanify Thank you.
  16. <?php $host= "localhost"; $username="root"; $password="root"; $db_name= "test2.0"; $tbl_name="permohonan"; mysql_connect("$host","$username","$password")or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); if(isset($_POST['submit'])) { $Jabatan = mysql_real_escape_string($_POST['Jabatan']); $unit = mysql_real_escape_string($_POST['unit']); $lain2 = mysql_real_escape_string($_POST['lain2']); $nama_pemohon = mysql_real_escape_string($_POST['nama_pemohon']); $destinasi = mysql_real_escape_string($_POST['destinasi']); $tujuan = mysql_real_escape_string($_POST['tujuan']); $maklumat_ = mysql_real_escape_string($_POST['maklumat_']); $datedepart_= mysql_real_escape_string($_POST['datedepart_']); $timedepart_= mysql_real_escape_string($_POST['timedepart_']); $datearrive_ = mysql_real_escape_string($_POST['datearrive_']); $timearrive_ = mysql_real_escape_string($_POST['timearrive_']); $query1 = mysql_query("INSERT INTO permohonan VALUES(NULL,'$Jabatan','$unit','$lain2','$nama_pemohon','$destinasi','$tujuan','$maklumat_','$datedepart_','$timedepart_,'$datearrive_',$timearrive_')"); if($query1) { header("location : reservationform.php"); } } ?>
  17. Hi, I have all the elements I need but I need to connect the dots... Situation... I have a job table that is brought in with this variable <?php $row = 1; if (($handle = fopen($statfile, "r")) !== FALSE) { echo '<table class="sortable" border="0">'; while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { if (substr($data[0],0,3)!='HDR' && substr($data[0],0,3) != 'JOB' ) continue; $num = count($data); if (substr($data[0],0,3)=='HDR') { echo '<thead><tr>'; }else{ echo '<tr>'; } for ($c=1; $c <= 4; $c++) { //echo $data[$c] . "<br />\n"; if(empty($data[$c])) { $value = " "; }else{ $value = trim($data[$c]); } if (substr($data[0],0,3)=='HDR') { echo '<th style="text-align:center">'.$value."</th>\n"; }else{ if ($c==1) { echo '<td style="text-align:center"><a href="http://wfbscd13/cgi-bin/aplog.cgi?type=job&logname='.$value.'&hostname='.$host.'" target="_blank">'.$value."</a></td>\n"; }else{ echo '<td style="text-align:center">'.$value."</td>\n"; } } } if (substr($data[0],0,3)=='HDR') { echo '</tr></thead><tbody>'; }else{ echo '</tr>'; } $row++; } echo '</tbody></table>'; fclose($handle); } ?> I attached a picture to show my screen... The right hand div with the list of jobs is on the right. I have it set so I can hover over the row and it highlights a row. Here is that code... It is jquery (1.9.1) <script type="text/javascript"> $("tr").not(':first').hover( function () { $(this).css("background","#d3d3d3"); }, function () { $(this).css("background",""); } ); </script> And finally the php query for the header.... <?php $row = 1; if (($handle = fopen("status.txt", "r")) !== FALSE) { echo '<table class="sortable" border="0">'; while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { if ($row > 1 && substr($data[0],0,3) != 'JOB' ) continue; $num = count($data); if ($row == 1) { echo '<thead><tr>'; }else{ echo '<tr>'; } for ($c=4; $c <$num; $c++) { //echo $data[$c] . "<br />\n"; if(empty($data[$c])) { $value = " "; }else{ $value = trim($data[$c]); } if (substr($data[0],0,3)=='HDR') { echo '<th style="text-align:center">'.$value."</th>\n"; }else{ if ($c==1) { echo '<td style="text-align:center">'.$value."</td>\n"; }else{ echo '<td style="text-align:center">'.$value."</td>\n"; } } } if (substr($data[0],0,3)=='HDR') { echo '</tr></thead><tbody>'; }else{ echo '</tr>'; } $row++; } echo '</tbody></table>'; fclose($handle); } ?> What I need is to show this last query in the header on hover of the first query.... But I can't seem to connect the dots... Can anyone help me?
  18. Hello, I'm trying to output my database on my website but it's not working, it shows up just a blank page ( http://prntscr.com/90dfbf ), here's the code : <html> <head> <title>Untitled</title> </head> <body> <?php require_once(‘conn.php’); $sql = ("SELECT * FROM oglasi"); $query = mysql_query($sql); while ($row = mysql_fetch_array($query)) { $naziv = $row[‘naziv’]; $sadrzaj = $row[‘sadrzaj’]; echo $naziv; echo $sadrzaj; }; ?> </body> </html> And conn.php is: <?php $conn = mysql_connect(‘localhost’, ‘root’, ‘ELsk0l@r00t’) or die (mysql_error()); mysql_select_db(‘elskoglasi’) or die (‘Database selection incorrect’); ?>
  19. this is tricky to explain: I have a raw php script, written by someone else, that sends an email to a list extracted from a CSV file. It requires that certain values in the file be manually edited each time it's used, such as the following: $mail->setFrom('email@email.com', 'From Name'); // <==== change email address, From Name $subject = "Subject Line"; // <==== Adjust this subject $html = ' html here '; // <==== include email html MagicParser_parse("test.csv","myRecordHandler","csv|44|1|34"); // <==== change 'test.csv' file name the function is called by simply calling this email.php file in the browser. I'd like to build a form that would a) edit these values/strings on the fly and then b) call the file in the browser. The thing is, it's been a while since I've messed with PHP forms to any extent, and I can't remember how to get started on something like this. And I'm not familiar at all with fopen and fwrite to edit strings like this without messing up the existing code (there's a lot of other code in the file that needs to be left alone, obviously). I'm hoping someone can help me with a starting point - an idea on how to get this thing going - whether to build the form right in the same file or to build one in another file that posts these values to this existing file... hopefully someone can understand what I'm asking, and thank you much for your help. regards, glenn
  20. I have this js code that works great. Now the new option I would like to add is the "days". Right now it's only based on hours, mins, seconds. Can you show me how you would add the "days" option to it? function Timer(container, timeLeft) { // get hour, minute and second element using jQuery selector var hoursContainer = $(container).find('.hour'); var minsContainer = $(container).find('.min'); var secsContainer = $(container).find('.sec'); // hold time left var currentTimeLeft = timeLeft; // 1 second = 1000 ms var secondsForTimer = 1000; // hold ID value return by setInterval() var timerInterval; // call setInteval() only when timeLeft is greater than 0 if (currentTimeLeft == 0) { return; } else { //Call setInterval()function and store ID value to timerInterval. timerInterval = setInterval(countdown, secondsForTimer); } //function being passed to setInterval() function countdown() { currentTimeLeft = parseInt(currentTimeLeft - secondsForTimer); if (currentTimeLeft == 0) { //stop calling countdown function by calling clearInterval() clearInterval(timerInterval); return; } else { //calculate hours left var wholeSeconds = parseInt(currentTimeLeft / 1000,10); var wholeMinutes = parseInt(currentTimeLeft / 60000,10); var wholeHours = parseInt(wholeMinutes / 60,10); //calculate minutes left var minutes = parseInt(wholeMinutes % 60,10); //calculate seconds left var seconds = parseInt(wholeSeconds % 60,10); //prefix 0 to hour, min and second counter $(hoursContainer).text((wholeHours < 10 ? "0" : "") + wholeHours + (wholeHours <=0 ? " hr" : " hrs")); $(minsContainer).text((minutes < 10 ? "0" : "") + minutes + (minutes <=0 ? " min" : " mins")); $(secsContainer).text((seconds < 10 ? "0" : "") + seconds + (seconds <=0 ? " sec" : " secs")); } } } Thanks.
  21. I've come up with an SQL sum query: $query = "SELECT SUM(calories) FROM tracklog AS calories WHERE userid = $_SESSION[userid]"; No errors are shown, however how do I get this value to be displayed using HTML? I want it to be displayed after 'Total number of calories lost to date:'
  22. I can't figure out how to make this script (twitch(dot)tv) to show only online/live channels not all... Here is Javascript (function () { 'use strict'; angular .module('twitch', []) .controller('TwitchCtrl', TwitchCtrl); function TwitchCtrl($http, $scope) { $scope.streams=[]; var apiEndPoint = 'https://api.twitch.tv/kraken/streams/'; var streamers = ['Chizijs','tornis', 'elveeftw', 'piecits', 'lobosjr', 'fattypillow']; var apiSuccess = function(response, streamer){ console.log(response); var stream = response.data; stream.Name = streamer; var offline = stream.stream === null if(offline){ stream.stream = {game: 'offlines', channel:{ 'logo': '' }}; $scope.streams.push(stream); } else{ $scope.streams.unshift(stream); } console.log(stream); }; var apiError = function(response, streamer){ console.log(response); if(response.status === 422){ var stream = response.data; stream.Name = streamer; stream.stream = {game: 'Account Closed', channel:{ 'logo': ''}}; console.log(stream); $scope.streams.push(stream); } }; var setupSuccess = function(streamer){ return function(response){ return apiSuccess(response, streamer); }; }; var setupError = function(streamer){ return function(response){ return apiError(response, streamer); }; }; for(var i = 0; i < streamers.length; i++){ var onSuccess = setupSuccess(streamers[i]); var onError = setupError(streamers[i]); $http({url: apiEndPoint + streamers[i], method:'GET'}) .then(onSuccess, onError); } } })();
  23. Hello I want to run a contest on my website and i am asking visitors to post their names and BTC addresses and i'll use random.org's list randomizer to pick one from the list what i did so far: <?php if ($_POST) { $name = $_POST['commentName']; $txt = $_POST['commentBTC']; $handle = fopen("comments.html","a"); fwrite($handle, "<b>" . $name . "</b> : " . $txt . "<br/>"); fclose($handle); } ?> and ] <form action="" method="POST" onsubmit="return checkform(this);"> Some Name: <input type="text" maxlength="10" name="commentName"/><br> BTC Address: <input type="text" maxlength="34" pattern="^[123][a-km-zA-HJ-NP-Z1-9]{25,34}$" name="commentBTC" required/><br> so i get a html list, which is great. the problem is that some visitors are signing up multiple times is there a way to check 'comments.html' for 'commentBTC' and if exists, to deny signing up? i can drop the 'commentName' field if it's easier to have only a bitcoin address list. help? thank you!
  24. Hi, I have the following code for playing a video on my page. The problem is that the video works good on desktop browsers, but on desktop safari and mobile browsers it displays me only the cover image not playing the video. I've tried a couple of solutions but none of them seems to be working for me. <video autoplay class="embed-responsive-item" poster="videos/cover.jpg"> <source src="videos/landing_page_video_vimeo5_converted.mp4" type="video/mp4"> <source src="videos/landing page video vimeo5.ogg" type="video/ogg"> <source src="videos/landing page video vimeo5.ogg" type="video/webm"> </video>
  25. I created a login system with bootstrap but for some reason I cannot delete the "placeholder" (in which it is written "admin") in both the inputs of the form ("uname" and "psw"). Even if I change the placeholder it's remain "admin". Have you any idea? This is the code: <!DOCTYPE html> <html> <head> <title>Login</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="css/styles.css"> </head> <body> <div class="container"> <div class="jumbotron text-center" id="jumbo_log"> <h1>Login Page</h1> <p>You must login to enter</p> <form id="theform" method="get"> <div class="container2"> <label for="uname"><b>Username</b></label> <input type="text" id= "uname" name="uname" required><br> <label for="psw"><b>Password</b></label> <input type="password" id="psw" name="psw" required><br><br> <input type="submit" id="submit" class="btn btn-info" value="Login"><br><br> <a class="btn btn-primary" href="registration.php" role="button">Click here if you are not registered</a> </div> </form> </div> </body> </html>
  • 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.