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 125 results

  1. 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"); ?>
  2. If you search for images on Google images, you will see how they setup their images, side by side and have infinity scroll. I don't care about the infinity scroll part, but I am interested in how they set up the images? My plan is to retrive the images from the database and use pagination numbers.
  3. im trying to insert a value in to mysql using an experiment everything works fine after hitting the insert button but the problem arises wen i refresh the page as a empty value gets inserted in to the mysql table wen i refresh it.(pardon my english) this is the index page where i fetch an result from mysql table: <div id="container"> <div class="Container-left"> </div> <div class="container-right"> <form action="1.2.php" method="post"> <textarea height="190px" width="190px" name="text" placeholder="share wats on your mind"></textarea> <br> <input type="submit" name="button" value="Type Here" /> </form> <hr> <?php include '1.2.php'; while ($fetch = mysqli_fetch_array($query1)) { echo 'comment:'.$fetch['post'].'<br/>'; echo '<small>date:'.$fetch['date'].'</small><br/><hr>'; } ?> </div> </div> this is the page where my second code rests: <?php include 'config.php'; error_reporting(E_ALL ^ E_NOTICE); $h= htmlspecialchars($_POST['text']); $p= mysqli_real_escape_string($conn,$h); $sql = "INSERT INTO article (post) VALUES ('$h') "; $sql1="SELECT * FROM article"; $query=mysqli_query($conn, $sql); $query1= mysqli_query($conn, $sql1); if ($_POST['button']){ echo 'inserted'; } else { echo 'not inserted'. mysqli_error($conn); } what should i do to stop value getting inserted in to my table while refreshing the page. pl help and thanks in advance.
  4. 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.
  5. 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.
  6. 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 ?
  7. So I've done a search for pdf to html converters and there are plenty of free online options. The only problem is that they don't convert the pdf to html in an actual 8.5 x11 size, so that when you go to print or use them to be filled by code and then printed, they are to small. Now, some would say, simply resize the html file, but the issue there is when created it actually consists of two files. One an html file with absolute position values for all your text and the second as a jpeg for any backgrounds, frames or images. You can adjust the size of the background, borders and images, but then that would also mean you'd have to go line for line in the html to adjust the absolute positions of all the text. So my question would be, is there a converter that would create an html file in the actual 8.5 x 11 size that anyone knows of? And don't say, Acrobat, cause their conversion doesn't even come close to looking like the original document. Any insight on this matter would be greatly appreciated.
  8. 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.
  9. I have a small issue here which I can't quite figure out. I have three containers on one page all below each other. One for buttons, a JS image slideshow and a description box. The image slider seems to take up unnecessary space when the browser is resized activating media queries: http://gyazo.com/33376dcadc99cba69d5668e240fae788 CSS desktop view (without media queries): body { background: #141414 url('../images/background1.png'); background-repeat: repeat-y; background-attachment:fixed; background-position:center; } #container{ height:450px; width:840px; margin:120px auto 2% auto; position:relative; } #container2{ height:60px; width:840px; margin:0 auto 50px auto; position:relative; -moz-box-shadow:0 0 5px 5px black; -webkit-box-shadow:0 0 5px 5px black; box-shadow:0 0 5px 5px black; } #container2 p{ color:white; font-size:15px; padding-left:5px; } #container2 h2{ color:white; font-size: 18px; text-decoration:none; padding-left:5px; padding-top:2px; } #img{ height:450px; width:840px; position:absolute; -moz-box-shadow: 0 0 5px 5px black; -webkit-box-shadow: 0 0 5px 5px black; box-shadow: 0 0 5px 5px black; } #l_holder{ height:450px; width:100px; position:absolute; left:0px; top:0px; cursor:pointer; } #r_holder{ height:450px; width:100px; position:absolute; right:0px; top:0px; cursor:pointer; } .left{ height:50px; width:50px; position:absolute; top:45%; left:0px; } .right{ height:50px; width:50px; position:absolute; top:45%; right:0px; } .clear{ clear:bottom; } CSS with media queries, this is where the container is causing a problem: @media all and (min-width: 3.5in) and (max-width: 10in) { body { background: #141414; } #container{ height:30%; width:100%; margin:5% auto; padding:0 0 0px 0; } #container2{ width:100%; margin: 0; padding: 0; } #container2 p{ padding-left:3px; } #container2 h2{ padding:5px 0 0 3px; } #container2 .body_black_box{ } #img{ height:80%; width:100%; } #l_holder{ height:80%; } #r_holder{ height:80%; } .left{ } .right{ } .clear{ } } Any help is greatly appreciated.
  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. All I am trying to do is add a record on a page without the page refreshing. For that ajax is used. Here is the code. It does not add the record to mysql table. Can anyone tell me what I am doing wrong? record.php <!DOCTYPE HTML> <html lang="en"> <head> <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script> <script type="text/javascript" > $(function() { $(".submit_button").click(function() { var textcontent = $("#content").val(); var name = $("#name").val(); var dataString = 'content='+ textcontent + '&name='+name; if(textcontent=='') { alert("Enter some text.."); $("#content").focus(); } else { $("#flash").show(); $("#flash").fadeIn(400).html('<span class="load">Loading..</span>'); $.ajax({ type: "POST", url: "action.php", data: dataString, cache: true, success: function(html){ $("#show").after(html); document.getElementById('content').value=''; $("#flash").hide(); $("#content").focus(); } }); } return false; }); }); </script> </head> <body> <?php $record_id = $_GET['id']; // getting ID of current page record ?> <form action="" method="post" enctype="multipart/form-data"> <div class="field"> <label for="title">Name *</label> <input type="text" name="name" id="name" value="" maxlength="20" placeholder="Your name"> </div> <div class="field"> <label for="content">content *</label> <textarea id="content" name="content" maxlength="500" placeholder="Details..."></textarea> </div> <input type="submit" name="submit" value="submit" class="submit_button"> </form> <div id="flash"></div> <div id="show"></div> </body> </html> action.php if(isset($_POST['submit'])) { if(empty($_POST['name']) || empty($_POST['content'])) { $error = 'Please fill in the required fields!'; } else { try { $name = trim($_POST['name']); $content = trim($_POST['content']); $stmt = $db->prepare("INSERT INTO records(record_id, name, content) VALUES(:recordid, :name, :content"); $stmt->execute(array( 'recordid' => $record_id, 'name' => $name, 'content' => $content )); if(!$stmt){ $error = 'Please fill in the required fields.'; } else { $success = 'Your post has been submitted.'; } } catch(Exception $e) { die($e->getMessage()); } } }
  13. 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).
  14. 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.
  15. Right now my website url appears like this. http://www.mywebsite.com/index.php I was wondering if there is a way to remove the index.php and just have it show like this when someone goes to the website? http://www.mywebsite.com
  16. So I have a simple query that adds a text record into a MySQL database table. It works great with exception of one thing. I noticed that if I have "&" symbol in my paragraph, the text after that symbol won't be inserted into the table. The text before that symbol will insert fine. It seems to be doing that only with & symbol; other symbols insert and show up fine. can anyone tell me why this is happening?
  17. Hello, I am new to PHP, so I decided the best way to learn is to build a CMS, that I can build and adapt as time progresses. I am wanting to create a setup/install wizard for when a user first uploads the website and then visits the website. I attempted to do this on my own, but it did not work, but hey I still included the code in-case I was close to getting it working. (See below). I am wanting to have a HTML form that will contain the input fields, where the user will enter their database host, username, and password. And all of the details in the form will replace the mysqli connection in the config.php file, which is seperate from the install file. That is all I really need help with at the moment, as creating users, etc is pretty easy (even though I am new to PHP). My "attempted" code: - Install.php: <?php /* Config required to replace the database strings */ require('config/config.php'); /* HTML Form to be echoed for the user */ $form = " <form name='form' action='' method='get'> <input type='text' name='host' placeholder='Database host' /> <input type='text' name='database' placeholder='Database name' /> <input type='text' name='username' placeholder='Database username' /> <input type='password' name='password' placeholder='Database password' /> <input type='submit' name='submit' value='Change values' /> </form> "; /* Echo the form so I can see it */ echo $form; /* Get the results from the HTML Form */ $gethost = $_GET['host']; $getdb = $_GET['database']; $getuser = $_GET['username']; $getpass = $_GET['password']; /* Replace the database connections in config.php */ /* However, does not work :/ */ if (isset($_GET['submit'])) { str_replace($gethost,$host); } ?> - Config.php: <?php $host = "localhost"; $username = "root"; $password = ""; $database = "website"; /* Change this line in the HTML Form in setup.php */ $dbc = mysqli_connect($host, $username, $password, $database); ?> Thanks in advanced, Unique
  18. 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
  19. 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
  20. 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.
  21. <?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"); } } ?>
  22. First off, I am very new to php and I am learning the best I can. I am trying to display a dynamic grid style table within a loop and display my mysql data inside of it. The data is a Image URL, directory URL, URL description, and it prints all this data as an image with a link to the gallery. The code works fine as... 5 wide x 5 down. It's supposed to look a little something like this: [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Now that works, however when I change my rows and column variable # to 7 and 7 is when the problems start.. Here is my main code for this function: //define variables $uniqhash = ""; $modelname = ""; $email = ""; $galleryurl = ""; $gallerydesc = ""; $category = ""; $datesubmitted = ""; $gallerythumb = ""; $rows = 0; $count = 0; $columns = 0; $select = "SELECT * From `models`"; $images_rows = mysqli_query($conn, $select); $images = array(); if( empty( $images ) ) { echo 'Sorry, there was a fatal error in selecting images from database.'; } while ($image = mysqli_fetch_assoc($images_rows)) { $images[] = $image; } echo '<table align="center" border="0"><tr>'; $size = sizeOf($images) - 1; //get count of array and put into $size foreach($images as $image){ if($rows == 7) { echo '</tr><tr>'; // if our count is x wide, start a new row $rows = 0; } if ($columns == 7){ echo '</tr><tr>'; $columns = 0; } echo "<td><a href=" . $image['galleryurl'] . " target=\"new\"><img src=" . $image['gallerythumb'] . " height=\"160\" width=\"160\" alt=\"" . $image['gallerydesc'] . "\"></a></td>"; $rows++; $count++; $columns++; echo ($rows == 7 && $columns == 5 && $count != $size) ? '</tr>': ''; } echo '</tr></center></table>'; When I change $rows and $columns to 7 each it will display images like: (sample of 13 images) [] [] [] [] [] [] [] [] [] [] [] [] [] [] I would like it to print x images across for $rows and x amount of rows for $columns in a grid like fashion. If anyone can give me some help on this I would appreciate it...I have been desperately reading up on loops trying to figure it out but so far no luck. P.S I am familiar with sanitizing all my data and that I need to implement this but I want to make sure my code functions first.
  23. <?php $con=mysqli_connect("localhost","my_user","","shazz"); $query = mysqli_query($con,"SELECT * from posts2 order by rand() LIMIT 0,4"); $post_title ="shazz"; while ($row=mysqli_fetch_array($query)) { $post_id=$row['post_id']; $post_title=$row['post_title']; $post_date=$row['post_date']; $post_author=$row['post_author']; $post_image=$row['post_image']; $post_keywords=$row['post_keywords']; $post_content=substr($row['post_content'],0,200); } ?> the following are the errors im facing: Warning: mysqli_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'shazz' inC:\xampp\htdocs\shazz\include\main_content.php on line 3 Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given inC:\xampp\htdocs\shazz\include\main_content.php on line 4 Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given inC:\xampp\htdocs\shazz\include\main_content.php on line 6
  24. 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?
  25. So I have been working on my website for a while which all is php&mysql based, now working on the social networking part building in similar functions like Facebook has. I encountered a difficulty with getting information back from a link. I've checked several sources how it is possible, with title 'Facebook Like URL data Extract Using jQuery PHP and Ajax' was the most popular answer, I get the scripts but all of these scripts work with html links only. My site all with php extensions and copy&paste my site links into these demos do not return anything . I checked the code and all of them using file_get_contents(), parsing through the html file so if i pass 'filename.php' it returns nothing supposing that php has not processed yet and the function gets the content of the php script with no data of course. So my question is that how it is possible to extract data from a link with php extension (on Facebook it works) or how to get php file executed for file_get_contents() to get back the html? here is the link with code&demo iamusing: http://www.sanwebe.com/2013/06/extract-url-content-like-facebook-with-php-and-jquery thanks in advance.
  • 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.