Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. Your function to calculate is also wrong. function pmt($loan, $interest, $months){ $amount = $loan * ($interest / 12) * pow(1 + $interest / 12,$months) / (pow(1 + $interest / 12,$months) - 1); return round($amount, 2); }
  2. You had </form> in the wrong spot and also 2 names in form wrong as well A working html and form using code i posted to you. Compare and see the differences <html> <head> <title>Homework 3</title> </head> <body> <div> <p> Fill out this form to calculate monthly car payment</p> <form method="post" action="hw2test.php"> <p>Loan Amount: <input type="text" name="loan" size="5" /></p> <p>Interest Rate: <input type="text" name="interest" size="5" /></p> <p>Number of Month: <input type="text" name="months" size="5" /></p> <input type="submit" name="submit" value="Calculate" /> </form> </div> </body> </html>
  3. You asked the same question the other post, no need to make new ones. If are going to ask a new question should post your current code. http://php.net/manual/en/function.isset.php You are running the code only if $_POST['loan'] is NOT set Name your submit button (name="submit") in your form Check if the form was submitted Check if any post values are set and data you expect Check if variables exist or not empty before trying to use them In this case I will use is_numeric to check data types Use curly braces Look over the php manual and tutorial there, get familiar with everything. Seems to me your teacher did not explain a lot or you took a nap. https://secure.php.net/manual/en/getting-started.php <?php function pmt($loan, $interest, $months){ $amount = $loan * $interest / 12 * pow((1 + $interest / 12), $months) / (pow((1 + $interest / 12), $months - 1)); return round($amount, 2); } //check if form submitted if (isset($_POST['submit'])) { //check each if each post is set and it's value is data expect if (isset($_POST['loan']) && is_numeric($_POST['loan'])) { $loan = $_POST['loan']; } if (isset($_POST['interest']) && is_numeric($_POST['interest'])) { $interest = $_POST['interest']; } if (isset($_POST['months']) && is_numeric($_POST['months'])) { $months = $_POST['months']; } } //check if all 3 variables exist if ($loan && $interest && $months) { //execute the code echo "Your monthly car payment will be " . pmt($loan, $interest, $months) . " a month, for " . $months . " months"; } ?>
  4. Keep your initial scale to 1 and adjust with an additional media query @media screen and (max-width: 650px) { .wrap{ width:650px; } @media screen and (max-width: 480px) { .wrap{ width:480px; } And any other adjustments would want. Or do your wrap initally as a %? .wrap{ width:99%; }
  5. You need to start a session top of each script session_start(); http://php.net/manual/en/session.examples.basic.php
  6. There are 2 wp_mail() functions in your code //line 237 confirmation email wp_mail($coord_email, stripslashes($mail_subject), html_entity_decode(nl2br($email_body)), $headers); //line 301 wp_mail($reg_form['email'], stripslashes($mail_subject), html_entity_decode(nl2br($email_body)), $headers); Both seem to send the same content and could comment one or both out depending your needs. There is other variables in the plugin elsewhere that could work as an option to send or not as well. if ($company_options['send_confirm']=="Y"){ if ($send_mail == "Y"){ The plugin creator would have the easiest time where to set this initially so your plugin is not doing needless work. Is way too many folders and scripts to look through.
  7. As denno stated media queries can do it. In the head area of html use these 3 lines <meta name="viewport" content="width=device-width; initial-scale=1.0"> <link href="/style.css" rel="stylesheet" type="text/css"> <link href="/media-queries.css" rel="stylesheet" type="text/css"> First line sets the initial size Second line includes your default stylesheet Third line will be your adjustments for same named dividers and classes as you use in your main stylesheet. Here is an example I use that moves my sidebar to below the main content area and some other adjustments. You will find out using css versus images and % versus fixed sizes makes it a lot simpler to do. media-queries.css /************************************************************************************ smaller than 980 *************************************************************************************/ @media screen and (max-width: 980px) { /* pagewrap */ #pagewrap { width: 95%; } /* content */ #content { width: 60%; padding: 3% 4%; } /* sidebar */ #sidebar { width: 30%; } #sidebar .widget { padding: 8% 7%; margin-bottom: 10px; } /* embedded videos */ .video embed, .video object, .video iframe { width: 100%; height: auto; min-height: 300px; } } /************************************************************************************ smaller than 650 *************************************************************************************/ @media screen and (max-width: 650px) { /* header */ #header { height: auto; } /* search form */ #searchform { position: absolute; top: 5px; right: 0; z-index: 100; height: 40px; } #searchform #s { width: 100px; } #searchform #s:focus { width: 150px; } /* main nav */ #main-nav { position: static; } /* site logo */ #site-logo { margin: 15px 100px 5px 0; position: static; } /* site description */ #site-description { margin: 0 0 15px; position: static; } /* content */ #content { width: auto; float: none; margin: 20px 0; } /* sidebar */ #sidebar { width: 100%; margin: 0; float: none; } #sidebar .widget { padding: 3% 4%; margin: 0 0 10px; } /* embedded videos */ .video embed, .video object, .video iframe { min-height: 250px; } } /************************************************************************************ smaller than 560 *************************************************************************************/ @media screen and (max-width: 480px) { /* disable webkit text size adjust (for iPhone) */ html { -webkit-text-size-adjust: none; } /* main nav */ #main-nav a { font-size: 90%; padding: 10px 8px; } }
  8. Just like Barand said. Can try this though, if want direct download with header and content types will have to work that out. $path = "/download/"; if (isset($_GET['f']) && trim($_GET['f']) != "") { if (is_file($_SERVER['DOCUMENT_ROOT'] . $path . $_GET['f'])) { echo " <a href='" . $path . $_GET['f'] . "' download>" . $_GET['f'] . "</a>"; } else { header("HTTP/1.0 404 Not Found"); die('File not found'); } } else { header("HTTP/1.0 404 Not Found"); die('File missing'); }
  9. File should be a .php extension unless server is configured to parse php in html. For each $_GET['key'] you would check for...it must be looking for the same name in the form. I did a new form that should work for you, in this example I did an all together 10 digits for phone numbers. Here is a post for other telephone checking patterns. http://forums.phpfreaks.com/topic/296613-validation-issue/?do=findComment&comment=1513077 Redirects back to main site after 5 seconds with a message, only because you are including a header, otherwise would have displayed the message back into the form. Optional google recaptcha included, just insert key first line if have one. Can try this out and let me know. <?php $recaptcha_key = "";//optional google recaptcha if (isset($_POST['submit'])) { $errors = array(); $msg = "";//keep empty if (isset($_POST['fname']) && trim($_POST['fname']) != '') { $fname = trim($_POST['fname']); } else { $fname = ''; $errors[] = 'first name'; } if (isset($_POST['lname']) && trim($_POST['lname']) != '') { $lname = trim($_POST['lname']); } else { $lname = ''; $errors[] = 'last name'; } if (isset($_POST['company']) && trim($_POST['company']) != '') { $company = trim($_POST['company']); } else { $company = ''; $errors[] = 'company'; } if (isset($_POST['email']) && filter_var(trim($_POST['email']), FILTER_VALIDATE_EMAIL)) { $email = trim($_POST['email']); } else { $email = ''; $errors[] = 'email'; } if (isset($_POST['phone']) && ctype_digit($_POST['phone']) && strlen($_POST['phone']) == 10) { $phone = trim($_POST['phone']); } else { $phone = ''; $errors[] = 'phone'; } if (isset($_POST['message']) && trim($_POST['message']) != '') { $message = trim($_POST['message']); } else { $message = ''; $errors[] = 'message'; } if(!empty($recaptcha_key)){ if(isset($_POST['g-recaptcha-response'])){ $captcha=$_POST['g-recaptcha-response']; } if(!$captcha){ $errors[] = 'captcha'; } else { $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_key."&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']); if($response.success==false){ $errors[] = 'captcha'; } } } if (empty($errors)) { //escape,filter,sanitize data and insert data to mysql echo "<p style='color:#66FF00;'>Thank you, we will contact you within 24 hours.</p>"; header("refresh:5; url=http://".$_SERVER['SERVER_NAME']); exit; } else { $msg = "<p style='color:#FF3300;'>You have the following errors:" . implode($errors, ", ") . "</p>"; } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>ARSI | AUTOMATED RESCORE SYSTEMS</title> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> <meta http-equiv="pragma" content="no-cache" /> <?php include "include/head.php"; if(!empty($recaptcha_key)){ ?> <script src='https://www.google.com/recaptcha/api.js'></script> <?php }?> <style> *:focus { outline: none; } body { font: 14px/21px "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; max-width:99%; } a { text-decoration:none; } .wrap{ position:relative; width:75%; margin-left:auto; margin-right:auto; padding:5px; } ul{ list-style-type: none; padding:0; margin:0; } .contact_form h2, .contact_form label { font-family:Georgia, Times, "Times New Roman", serif; } .form_hint, .required_notification { font-size: 11px; } .contact_form ul { width:750px; list-style-type:none; list-style-position:outside; margin:0px; padding:0px; } .contact_form li{ padding:12px; border-bottom:1px solid #eee; position:relative; } .contact_form li:first-child, .contact_form li:last-child { border-bottom:1px solid #777; } .contact_form h2 { margin:0; display: inline; } .required_notification { color:#d45252; margin:5px 0 0 0; display:inline; float:right; } .contact_form label { width:150px; margin-top: 3px; display:inline-block; float:left; padding:3px; } .contact_form input { height:20px; width:300px; padding:5px 8px; -moz-transition: padding .25s; -webkit-transition: padding .25s; -o-transition: padding .25s; transition: padding .25s; } .contact_form textarea { padding:8px; width:300px; -moz-transition: padding .25s; -webkit-transition: padding .25s; -o-transition: padding .25s; transition: padding .25s; } .contact_form button { margin-left:156px; } .contact_form input, .contact_form textarea { padding-right:30px; border:1px solid #aaa; box-shadow: 0px 0px 3px #ccc, 0 10px 15px #eee inset; border-radius:2px; } .contact_form input:focus, .contact_form textarea:focus { background: #fff; border:1px solid #555; box-shadow: 0 0 3px #00FF00; padding-right:70px; } /* Button Style */ button.submit { background-color: #68b12f; background: -webkit-gradient(linear, left top, left bottom, from(#68b12f), to(#50911e)); background: -webkit-linear-gradient(top, #68b12f, #50911e); background: -moz-linear-gradient(top, #68b12f, #50911e); background: -ms-linear-gradient(top, #68b12f, #50911e); background: -o-linear-gradient(top, #68b12f, #50911e); background: linear-gradient(top, #68b12f, #50911e); border: 1px solid #509111; border-bottom: 1px solid #5b992b; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; box-shadow: inset 0 1px 0 0 #9fd574; -webkit-box-shadow: 0 1px 0 0 #9fd574 inset ; -moz-box-shadow: 0 1px 0 0 #9fd574 inset; -ms-box-shadow: 0 1px 0 0 #9fd574 inset; -o-box-shadow: 0 1px 0 0 #9fd574 inset; color: white; font-weight: bold; padding: 6px 20px; text-align: center; text-shadow: 0 -1px 0 #396715; } button.submit:hover { opacity:.85; cursor: pointer; } button.submit:active { border: 1px solid #20911e; box-shadow: 0 0 10px 5px #356b0b inset; -webkit-box-shadow:0 0 10px 5px #356b0b inset ; -moz-box-shadow: 0 0 10px 5px #356b0b inset; -ms-box-shadow: 0 0 10px 5px #356b0b inset; -o-box-shadow: 0 0 10px 5px #356b0b inset; } input:required, textarea:required { background: #fff; border-color:#FF0000; } .contact_form input:required:valid, .contact_form textarea:required:valid { /* when a field is considered valid by the browser */ background: #fff; box-shadow: 0 0 5px #5cd053; border-color: #28921f; } .form_hint { background: #d45252; border-radius: 3px 3px 3px 3px; color: white; margin-left:8px; padding: 1px 6px; z-index: 999; /* hints stay above all other elements */ position: absolute; /* allows proper formatting if hint is two lines */ display: none; } .form_hint::before { content: "\25C0"; /* left point triangle in escaped unicode */ color:#d45252; position: absolute; top:1px; left:-6px; } .contact_form input:focus + .form_hint { display: inline; } .contact_form input:required:valid + .form_hint { background: #28921f; } .contact_form input:required:valid + .form_hint::before { color:#28921f; } </style> </head> <body> <div class="wrap"> <form class="contact_form" action="" method="post" name="contact_form" novalidate> <ul> <li> <h2>PARTNERS</h2> <button style="float:right;"><a href="partner-login.php">PARTNER LOGIN</a></button> <p>Are you interested in becoming a Partner?<br/>Please fill out the form below and we will contact you within 24 hours.</p> </li> <?php echo $msg;?> <li> <label for="fname">First Name:</label> <input id="fname" name="fname" type="text" value="<?php echo $fname;?>" required/> </li> <li> <label for="lname">Last Name:</label> <input id="lname" name="lname" type="text" value="<?php echo $lname;?>" required/> </li> <li> <label for="company">Company:</label> <input id="company" name="company" type="text" value="<?php echo $company;?>" required/> </li> <li> <label for="email">Email:</label> <input id="email" name="email" type="email" value="<?php echo $email;?>" required/> <span class="form_hint">Format "name@domain.com"</span> </li> <li> <label for="phone">Phone Number:</label> <input id="phone" name="phone" type="tel" pattern="\d{10}" title='Phone Number (Format: 0123456789 10 digits)' value="<?php echo $phone;?>" required/> <span class="form_hint">Format "0123456789 10 digits"</span> </li> <li> <label for="message">Message:</label> <textarea id="message" name="message" cols="40" rows="4" required><?php echo $message;?></textarea> </li> <?php if(!empty($recaptcha_key)){ ?> <div class="g-recaptcha" data-sitekey="$recaptcha_key"></div> <?php }?> <li> <button class="submit" type="submit" name="submit">Submit Form</button> </li> </ul> </form> <div> <?php include "include/footer.php";?> </body> </html>
  10. You never want to store raw passwords, instead save the passwords as one way encrypted hashed values Use password_hash and password_verify
  11. That server could be blocking your ip. I'm sure curl would work for me as well. Might want to look into DOM, simplexml,and xpath for scraping, or use regex with preg_match or preg_match_all There is also simplehtmldom to make it easier for a beginner. <?php //$url = "http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/";//works //$url = "http://fullmovie-hd.com/?p=42820";//works $url = "fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/";//will fail, requires protocol //add protocol if missing if(!parse_url($url, PHP_URL_SCHEME)){ $url = "http://".$url; } //create a stream context for additional options $context = stream_context_create( array( 'http' => array( 'follow_location' => true, 'timeout' => 15 ) ) ); $html = file_get_contents($url, false, $context); var_dump($http_response_header); var_dump($html); ?> What I saw as source: array(7) { [0]=> string(15) "HTTP/1.1 200 OK" [1]=> string(13) "Server: nginx" [2]=> string(35) "Date: Thu, 03 Sep 2015 07:44:14 GMT" [3]=> string(38) "Content-Type: text/html; charset=UTF-8" [4]=> string(17) "Connection: close" [5]=> string(24) "X-Powered-By: PHP/5.4.35" [6]=> string(55) "Link: <http://fullmovie-hd.com/?p=42820>; rel=shortlink" } string(9915) "<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Jurassic Attack Hindi Dubbed NowVideo – Embed Video Links</title> <meta name="google-site-verification" content="8w6BAQbLzv_qs28Gv9P2w9c_7xGJXa8OQ2jfVahouTw" /> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="http://fullmovie-hd.com/xmlrpc.php"> <link rel="alternate" type="application/rss+xml" title="Embed Video Links » Feed" href="http://fullmovie-hd.com/feed/" /> <link rel="alternate" type="application/rss+xml" title="Embed Video Links » Comments Feed" href="http://fullmovie-hd.com/comments/feed/" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/fullmovie-hd.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.2.4"}}; !function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='nu-bootstrap-css' href='http://fullmovie-hd.com/wp-content/themes/prose/css/bootstrap.min.css?ver=4.2.4' type='text/css' media='all' /> <link rel='stylesheet' id='nu-genericons-css' href='http://fullmovie-hd.com/wp-content/themes/prose/css/genericons.css?ver=4.2.4' type='text/css' media='all' /> <link rel='stylesheet' id='nu-fonts-css' href='//fonts.googleapis.com/css?family=Karla%3A400%2C700%2C400italic%2C700italic%7CLusitana%3A400%2C700%7CBerkshire+Swash%3A400&subset=latin%2Clatin-ext&ver=20131010' type='text/css' media='all' /> <link rel='stylesheet' id='nu-style-css' href='http://fullmovie-hd.com/wp-content/themes/prose/style.css?ver=4.2.4' type='text/css' media='all' /> <script type='text/javascript' src='http://p.jwpcdn.com/6/11/jwplayer.js?ver=4.2.4'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-includes/js/jquery/jquery.js?ver=1.11.2'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <script type='text/javascript' src='http://fullmovie-hd.com/wp-content/themes/prose/js/bootstrap.min.js?ver=4.2.4'></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://fullmovie-hd.com/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://fullmovie-hd.com/wp-includes/wlwmanifest.xml" /> <link rel='prev' title='The One HIndi Dubbed Videoweed' href='http://fullmovie-hd.com/the-one-hindi-dubbed-videoweed/' /> <link rel='next' title='Jurassic Attack Hindi Dubbed Novamov' href='http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-novamov/' /> <meta name="generator" content="WordPress 4.2.4" /> <link rel='canonical' href='http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/' /> <link rel='shortlink' href='http://fullmovie-hd.com/?p=42820' /> <script type="text/javascript">jwplayer.defaults = { "ph": 2 };</script> <script type="text/javascript"> if (typeof(jwp6AddLoadEvent) == 'undefined') { function jwp6AddLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } } </script> </head> <body class="single single-post postid-42820 single-format-standard"> <div id="site-navigation" class="navbar navbar-default navbar-static-top site-navigation" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> <!-- #site-navigation --></div> <div id="site-header" class="container site-header" role="banner"> <div class="site-branding"> <div class="site-title"> <a href="http://fullmovie-hd.com/" title="Embed Video Links" rel="home"> Embed Video Links </a> </div> <div class="site-description">All Movies Embed Video Links</div> </div> <!-- #site-header --></div> <div id="main" class="site-main"> <div class="container"> <main id="content" class="site-content" role="main"> <div class="content-area"> <article id="post-42820" class="post-42820 post type-post status-publish format-standard hentry category-uncategorized"> <header class="entry-header"> <div class="entry-meta"> <span class="posted-on"><a href="http://fullmovie-hd.com/jurassic-attack-hindi-dubbed-nowvideo/" title="1:28 am" rel="bookmark"><time class="entry-date published" datetime="2014-03-09T01:28:26+00:00">March 9, 2014</time></a></span> </div> <h1 class="entry-title">Jurassic Attack Hindi Dubbed NowVideo</h1> <div class="entry-meta"> <span class="byline"><span class="author vcard"><a class="url fn n" href="http://fullmovie-hd.com/author/shaimunpvtltd/" title="View all posts by Admin">Admin</a></span></span> <!-- .entry-meta --></div> <!-- .entry-header --></header> <div class="clearfix entry-content"> <!-- Quick Adsense WordPress Plugin: http://quicksense.net/ --> <div style="float:none;margin:10px 0 10px 0;text-align:center;"> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=215219"></script> </div> <p style="text-align: center;"><strong>Jurassic Attack Hindi Dubbed NowVideo</strong></p> <p style="text-align: center;"><strong><iframe style="overflow: hidden; border: 0; width: 600px; height: 480px;" src="http://embed.nowvideo.sx/embed.php?width=600&height=480&v=f29946a95646f" height="240" width="320" scrolling="no"></iframe></strong></p> <!-- Quick Adsense WordPress Plugin: http://quicksense.net/ --> <div style="float:none;margin:10px 0 10px 0;text-align:center;"> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=215219"></script> </div> <div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div> <!-- .entry-content --></div> <footer class="entry-footer entry-meta"> <span class="cat-links"> <a href="http://fullmovie-hd.com/category/uncategorized/" rel="category tag">Uncategorized</a> </span> <!-- .entry-meta --></footer> <!-- #post-42820 --></article> </div> <!-- #content --></main> </div> <!-- #main --></div> <div id="extra" class="site-extra" role="complementary"> <div class="container"> <div class="row"> </div> </div> <!-- #extra --></div> <footer id="footer" class="site-footer" role="contentinfo"> <div class="container"> <div class="site-info"> © 2015 Embed Video Links. Proudly powered by WordPress. <!-- .site-info --></div> <div class="site-credit"> <a href="http://csthemes.com/theme/prose">Prose</a> by csThemes <!-- .site-credit --></div> </div> <!-- #footer --></footer> </body> <!-- PopAds.net Popunder Code for www.fullmovie-hd.com --> <script type="text/javascript"> var _pop = _pop || []; _pop.push(['siteId', 202458]); _pop.push(['minBid', 0]); _pop.push(['popundersPerIP', 0]); _pop.push(['delayBetween', 0]); _pop.push(['default', false]); _pop.push(['defaultPerDay', 0]); _pop.push(['topmostLayer', false]); (function() { var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true; var s = document.getElementsByTagName('script')[0]; pa.src = '//c1.popads.net/pop.js'; pa.onerror = function() { var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true; sa.src = '//c2.popads.net/pop.js'; s.parentNode.insertBefore(sa, s); }; s.parentNode.insertBefore(pa, s); })(); </script> <!-- PopAds.net Popunder Code End --> <script type="text/javascript" src="http://www.adcash.com/script/java.php?option=rotateur&r=213859"></script> <script type="text/javascript"> var uid = '9499'; var wid = '16485'; </script> <script type="text/javascript" src="http://cdn.popcash.net/pop.js"></script> </html>"
  12. Not sure what your issue is as it seems to connect fine. They use wordpress and they redirect to pretty urls, usually can just add /feed to the end of urls, only few work like this and the rest go to a custom 404 page. The only useful page they have there is their custom 404 page. http://fullmovie-hd.com/go-to-404-page A person should ask the site owner for permission to scrape information from their site. Personally I don't feel like coding something for kodi, is a waste because this site will be gone soon enough because their content is illegal.
  13. Something like this. <?php $string = <<<DATA <div itemprop="commentText" class='post entry-content '> <p>I posted this....<a href='http://forums.phpfreaks.com/topic/297984-multiple-regex-on-the-same-string/' class='bbc_url' title=''>http://forums.phpfre...he-same-string/</a></p> <p> </p> <p>If you don't want to read the original post, I'm trying to abandon Wordpress, but still use the functionality of a couple of plugins. </p> <p> </p> <p>Not seeing any responses tells me that maybe I should be barking up a different tree. Is it possible to parse a database post and look for a URL that is NOT inside an a href tag?</p> <p> </p> <p>I Googling, I didn't see anything in the simpledom examples about scraping for anything OUTSIDE of a tag.</p> <p> </p> <p>Thanks!</p> <p> </p> <p> I'll post some mp3 links in this string like http://www.stephaniequinn.com/Music/Allegro%20from%20Duet%20in%20C%20Major.mp3 and also try it without the protocol </p> www.stephaniequinn.com/Music/Allegro%20from%20Duet%20in%20C%20Major.mp3 just for good measure.<br />http://www.stephaniequinn.com/Music/Mozart%20-%20Presto.mp3 stephaniequinn.com/Music/Mozart%20-%20Presto.mp3 is not looking for any url patterns.<br /> http://www.stephaniequinn.com/Music/Commercial%20DEMO%20-%2004.mp3 <p>An acdc sample using ogg:https://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg</p> <p>m4a sample:http://download.wavetlan.com/SVV/Media/HTTP/AAC/MediaCoder/MediaCoder_test1_HE-AAC_v4_Stereo_VBR_64kbps_44100Hz.m4a</p> <p>wav sample:http://freewavesamples.com/files/Yamaha-TG500-AP-Dance-C5.wav </p> </div> DATA; function checkProtocol($url){ if(!parse_url($url, PHP_URL_SCHEME)){ return "http://".$url; }else{ return $url; } } $matches = array();//define array $string = preg_replace('/\s+/', ' ',$string);//clean multiple whitespace $pattern = '/((http|https|ftp|ftps)\:\/\/)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?\.(mp3|m4a|ogg|wav)/';//match url and audio patterns $mp3player = preg_replace_callback($pattern, 'callback', $string);//find and replace //replace callback function function callback($matches){ if(!empty($matches[0])){//check if matches exist //print_r($matches[0]); $mp3_url = checkProtocol($matches[0]);//add http protocol if any missing return " <audio controls> <source src='$mp3_url'> Your browser does not support html5. </audio> "; } } echo $mp3player;//display including players ?>
  14. You bind the values not the columns. $stmt->bindParam(':fname', $fname, PDO::PARAM_STR); $stmt->bindParam(':fname1', $fname1, PDO::PARAM_STR); $stmt->bindParam(':fname2', $fname2, PDO::PARAM_STR); $stmt->bindParam(':fname3', $fname3, PDO::PARAM_STR); $stmt->bindParam(':fname4', $fname4, PDO::PARAM_STR); also there could be multiple ips returned, I explode them and use the first one if (strstr($ip, ', ')) { $ip_array = explode(', ', $ip); $ip = $ip_array[0]; }
  15. I think this is a poor idea to do mysql fetches for menu navigation. You can do a simple if/else or a switch and include scripts.
  16. pdo prepared statements You should checking if the request methods are even set and not empty, plus the data you expect. It's also better to use it's actual method and not $_REQUEST redirect1.php?id=<?php echo $_GET['id']; ?> How are you protecting the redirect1.php script?
  17. This isn't in your posted code and the variable $nachricht does not exist. Instead of multiple checking and changing around which is empty and not, why not make an error array and just test each POST, if does not meet your criteria then add it to the error array. You can test this, style and change anything different in the form or use this as an idea. <?php $msg = ''; $from ='my email address'; if (isset($_POST['submit'])) { $errors = array(); if (isset($_POST['name']) && trim($_POST['name']) != '') { $name = trim($_POST['name']); } else { $name = ''; $errors[] = 'name'; } if (isset($_POST['company']) && trim($_POST['company']) != '') { $company = trim($_POST['company']); } else { $company = ''; $errors[] = 'company'; } if (isset($_POST['email']) && filter_var(trim($_POST['email']), FILTER_VALIDATE_EMAIL)) { $email = trim($_POST['email']); } else { $email = ''; $errors[] = 'email'; } if (isset($_POST['subject']) && trim($_POST['subject']) != '') { $subject = trim($_POST['subject']); } else { $subject = ''; $errors[] = 'subject'; } if (isset($_POST['message']) && trim($_POST['message']) != '') { $message = trim($_POST['message']); } else { $message = ''; $errors[] = 'message'; } if(isset($_POST['g-recaptcha-response'])){ $captcha=$_POST['g-recaptcha-response']; } if(!$captcha){ $errors[] = 'captcha'; } else { $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6LckhPASAAAAAM-dJPmrFmovICuk5EFvMSIxUrEI&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']); if($response.success==false){ $errors[] = 'captcha'; } } if (empty($errors)) { //escape,filter,sanitize before inserting data to mysql $msg = "Form was submitted"; } else { $msg = "<p style='color:red;'>You have the following errors:" . implode($errors, ", ") . "</p>"; } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Contact Form</title> <script src='https://www.google.com/recaptcha/api.js'></script> <style> *:focus { outline: none; } body { font: 14px/21px "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; max-width:99%; } .wrap{ position:relative; width:75%; margin-left:auto; margin-right:auto; padding:5px; } ul{ list-style-type: none; padding:0; margin:0; } .contact_form h2, .contact_form label { font-family:Georgia, Times, "Times New Roman", serif; } .form_hint, .required_notification { font-size: 11px; } .contact_form ul { width:750px; list-style-type:none; list-style-position:outside; margin:0px; padding:0px; } .contact_form li{ padding:12px; border-bottom:1px solid #eee; position:relative; } .contact_form li:first-child, .contact_form li:last-child { border-bottom:1px solid #777; } .contact_form h2 { margin:0; display: inline; } .required_notification { color:#d45252; margin:5px 0 0 0; display:inline; float:right; } .contact_form label { width:150px; margin-top: 3px; display:inline-block; float:left; padding:3px; } .contact_form input { height:20px; width:300px; padding:5px 8px; -moz-transition: padding .25s; -webkit-transition: padding .25s; -o-transition: padding .25s; transition: padding .25s; } .contact_form textarea { padding:8px; width:300px; -moz-transition: padding .25s; -webkit-transition: padding .25s; -o-transition: padding .25s; transition: padding .25s; } .contact_form button { margin-left:156px; } .contact_form input, .contact_form textarea { padding-right:30px; border:1px solid #aaa; box-shadow: 0px 0px 3px #ccc, 0 10px 15px #eee inset; border-radius:2px; } .contact_form input:focus, .contact_form textarea:focus { background: #fff; border:1px solid #555; box-shadow: 0 0 3px #00FF00; padding-right:70px; } /* Button Style */ button.submit { background-color: #68b12f; background: -webkit-gradient(linear, left top, left bottom, from(#68b12f), to(#50911e)); background: -webkit-linear-gradient(top, #68b12f, #50911e); background: -moz-linear-gradient(top, #68b12f, #50911e); background: -ms-linear-gradient(top, #68b12f, #50911e); background: -o-linear-gradient(top, #68b12f, #50911e); background: linear-gradient(top, #68b12f, #50911e); border: 1px solid #509111; border-bottom: 1px solid #5b992b; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; box-shadow: inset 0 1px 0 0 #9fd574; -webkit-box-shadow: 0 1px 0 0 #9fd574 inset ; -moz-box-shadow: 0 1px 0 0 #9fd574 inset; -ms-box-shadow: 0 1px 0 0 #9fd574 inset; -o-box-shadow: 0 1px 0 0 #9fd574 inset; color: white; font-weight: bold; padding: 6px 20px; text-align: center; text-shadow: 0 -1px 0 #396715; } button.submit:hover { opacity:.85; cursor: pointer; } button.submit:active { border: 1px solid #20911e; box-shadow: 0 0 10px 5px #356b0b inset; -webkit-box-shadow:0 0 10px 5px #356b0b inset ; -moz-box-shadow: 0 0 10px 5px #356b0b inset; -ms-box-shadow: 0 0 10px 5px #356b0b inset; -o-box-shadow: 0 0 10px 5px #356b0b inset; } input:required, textarea:required { background: #fff; border-color:#FF0000; } .contact_form input:required:valid, .contact_form textarea:required:valid { /* when a field is considered valid by the browser */ background: #fff; box-shadow: 0 0 5px #5cd053; border-color: #28921f; } .form_hint { background: #d45252; border-radius: 3px 3px 3px 3px; color: white; margin-left:8px; padding: 1px 6px; z-index: 999; /* hints stay above all other elements */ position: absolute; /* allows proper formatting if hint is two lines */ display: none; } .form_hint::before { content: "\25C0"; /* left point triangle in escaped unicode */ color:#d45252; position: absolute; top:1px; left:-6px; } .contact_form input:focus + .form_hint { display: inline; } .contact_form input:required:valid + .form_hint { background: #28921f; } .contact_form input:required:valid + .form_hint::before { color:#28921f; } </style> </head> <body> <div class="wrap"> <form class="contact_form" action="" method="post" name="contact_form" novalidate> <ul> <li> <h2>Contact Form</h2> </li> <?php echo $msg;?> <li> <label for="name">Name:</label> <input id="name" name="name" type="text" value="<?php echo $name;?>" required/> </li> <li> <label for="company">Company:</label> <input id="company" name="company" type="text" value="<?php echo $company;?>" required/> </li> <li> <label for="email">Email:</label> <input id="email" name="email" type="email" value="<?php echo $email;?>" required/> <span class="form_hint">Proper format "name@domain.com"</span> </li> <li> <label for="subject">Subject:</label> <textarea id="subject" name="subject" cols="40" rows="4" required><?php echo $subject;?></textarea> </li> <li> <label for="message">Message:</label> <textarea id="message" name="message" cols="40" rows="4" required><?php echo $message;?></textarea> </li> <div class="g-recaptcha" data-sitekey="6LckhPASAAAAAM-dJPmrFmovICuk5EFvMSIxUrEI"></div> <li> <button class="submit" type="submit" name="submit">Submit Form</button> </li> </ul> </form> <div> </body> </html>
  18. Since you have a calendar type app... I suggest you make this a REST api or something similar output this in json do users sessions pagination/limit fetches data by date and per user, the selection date in the calendar would set this GET request and return the data, default could be todays/now date optional cache the json responses: the new method would be faster and less usage do not see caching the data individual dates and single users being a performance gain your app may work better using the live data To sum it up is a json response using their session id,date and returns limited data. If you have any type security such as a password, can use a public key provided to them instead. Another post using dates as GET parameters showed to another member http://forums.phpfreaks.com/topic/296327-same-file-for-multiple-pages/?view=findpost&p=1511965
  19. Since is wordpress and using some plugins all you want is for the theme? You should use a responsive more dynamic theme that could work with different screen sizes and devices and adjusts content within automatic. Mobile devices can see browsers similar to desktops these days. It's more detecting the device and sizing it properly. Not sure why you have just content and is blue for mobile, made it appear was at some other website. I personally don't like the switcher. Is a large top bar, you could take advantage of that area. A logo, favicon and background style could help it. Few different shades of green used, I understand trying to match the "leaves" icon for posts but large square blocks of different color isn't working. If you can mimick the rounded corners style for the rest could look pretty good. Can take advantage more features of html5. More seo, meta data could help.
  20. You haven't done anything wrong. If you want to learn or reference anything php could browse php.net obdc functions
  21. Well the code is lacking in many ways. not checking if anything is set or data you expect is just small flaws in this Is $model_id always a number? If so can check for that and only run the script or query if is true. if(isset($_REQUEST['mod_id']) && ctype_digit(trim($_REQUEST['mod_id']))){ //execute }else{ //do something else } Other ways to protect yourself would be to use prepared statements or mysqli_real_escape_string You should check everything and take alternate actions like a redirect or produce errors if it fails before attempting to actually use them.
  22. I tested and saw both have a redirect, a 302 and a 301, you need to follow redirects now. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  23. Upgrade that so have the latest version of php.
  24. I learned from php.net Making piles of own functions and scripts and when get enough of them together can create a larger project. Give yourself a goal and follow it through, if you get stuck something research it or ask the friendly people here in the forum. When I learned php there wasn't many sites on the net like this or a lot of places to research specific problems, had to do lots of trial and fail, learn what didn't work and see the few choices that did. It's a lot easier to learn this now, but you need to learn the current and correct way. Is lots of outdated tutorials and bad code on the net. If coming from other programming languages have to take into account php is a loose/non-strict programming language while most others are strict, it's almost like a free-for-all in what you can do. Two posts here that may help you. suggestions/do and don't list http://forums.phpfreaks.com/topic/262327-bored-looking-for-ideas-heres-a-list/ You should first learn php before attempting a php framework. Each framework has their own rules and levels of difficulty.
×
×
  • 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.