Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. You named the variable wrong this $conn = mysqli_connect ($host, $user, $pass, $name); should be $conn = mysqli_connect ($dbhost, $dbuser, $dbpass, $dbname);
  2. That's a better start, adding password encryption and your session data should work
  3. That was an old tutorial you followed Besides what I wrote below the main redirect issue is that you are checking for $_SESSION['checklogin'] in dashboard.php but never set the session or check a value anywhere else session_start(); if (!isset($_SESSION['members']) || $_SESSION['members'] != "1") { header ("Location: index.php"); } mysql_* functions are deprecated and should use mysqli_* or pdo session_register() deprecated, use $_SESSION['email'] = "me@mail.com"; you are passing plain text passwords and should be using something like password_hash() and to check the password is password_verify() don't use stripslashes, only use the appropriate escape functions such as mysql_real_escape_string() , mysqli_real_escape_string() , or pdo prepared statements trim the whitespace or can end up different values You should find a new tutorial using pdo or mysqli
  4. this is just one example that would work echo "<a href='" . the_post_thumbnail( 'medium' ) . "'><img src='" . the_post_thumbnail( 'thumbnail' ) . "'/></a>";
  5. This should work for you include($_SERVER['DOCUMENT_ROOT']."/thankyou.html"); Otherwise you can use a relative path file.php or folder/file.php , no forward slash assumes from it's base document's path / starts from root ./ is same directory ../ is up one directory ../../ , every ../ additional is up one directory
  6. You used a curly brace by accident here if(!count{$errors))
  7. Do your own logging on the script that saves a database or csv file, save whatever you want from it. You can use $_SERVER['REQUEST_URI'] which returns script,query,directory or $_SERVER['SCRIPT_NAME'] just the name of the script $_SERVER
  8. I see you are using gmail as a relay, in this case you don't need smtp You do need the openssl enabled though.
  9. The old include location was in /cp/app/includes/ , you would need to use /plan/ instead You could even do this include_once($_SERVER['DOCUMENT_ROOT']."/plan/cp_config.php"); include_once($_SERVER['DOCUMENT_ROOT']."/plan/db_connect.php"); link to where you placed the files
  10. Usually there is a form, that forms action will determine where is redirected <form action="contact_form.php" method="POST"> Did you ever make one or is one supposed to be supplied a website creator? you can try looking in \var\www\html\ using an ftp client like filezilla or in your provided admin panel from the host In order to parse php code the extension must be php, you can also allow html to parse php if set it up on the server. an .ini file is similar to a text file, maybe people are informing you of the php.ini configuration file. If you create a new file called info.php in the public www(root of your site), you can see where it's located or other information Depending on which hosting admin panel you have can access it from there as well. info.php <?php phpinfo(); ?> To summarize contact.html should contain a form and the action pointing to your php script your php script would perform the mail function Some people do it all in one php script, the form and also the mail function, like contact.php
  11. If you don't want to create a pile of if/else or switches for each one and name them the same try the code below. Assumes images are in a directory named images if(isset($_GET['show']) && trim($_GET['show']) != ''){ $keyword = trim($_GET['show']); $image = "/images/".$keyword.".jpg"; $image_location = $SERVER['DOCUMENT_ROOT'].$image; if(!file_exists($image_location)){ $image = "/images/default.jpg"; } } else { $image = "/images/default.jpg"; }
  12. <?php if(isset($_GET['show']) && trim($_GET['show']) != ''){ $keyword = trim($_GET['show']); switch ($keyword) { case "house": $image = "$keyword.jpg"; break; case "mickey": $image = "$keyword.jpg"; break; default: $image = "default.jpg"; break; } }else{ $image = "default.jpg"; } echo $image; ?>
  13. Edit your php.ini file this line: ;extension=php_openssl.dll to this: extension=php_openssl.dll Restart server and then try it.
  14. I like the idea from Psycho to perform an action depending the count in the array. This simplifies trying to match domains which will fail in so many ways unless you make a pile of functions and checks, relative links, protocol/scheme, www, host or subdomain
  15. The way you are doing it is the best way, saving image locations in a database. As for different resolutions you can use GD and do it on the fly and only keep one better quality sized image. You could even cache the generated images. A relational database is probably best here, one table would hold your episodes and going by id can link another table with all it's screenshots If posted your database layout and how you query them someone may be able to help further with what you have.
  16. Are you making an email spamming bot?
  17. The first one is the title of the document which is a hidden element of the page to a visiting user and used by browsers and search engines <title><?php bloginfo('name'); ?></title> The other one in body they are using as the title of your blogs home href link which is visible. This is way of automating the creation of your home link <h1><a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1>
  18. If you have permission the other server add a script to find the latest folder by date. If not ask them to do it. something like this <?php function latestDirectory($path = NULL) { if ($path == NULL) { $path = "/"; } $list = array(); $path = rtrim($path, "/"); if (substr($path, 0, 1) != "/") { $path = "/" . $path; } if ($path == "/") { $path = $_SERVER['DOCUMENT_ROOT']; } else { $path = $_SERVER['DOCUMENT_ROOT'] . $path; } $working_dir = getcwd(); chdir($path); $ret_val = false; if ($p = opendir($path)) { while (false !== ($file = readdir($p))) { if ($file{0} != '.' && is_dir($file)) { $timestamp = filemtime($path . '/' . $file); $pretty_date = date("m/d/Y h:i:s A", $timestamp); $list[] = array( "directory" => $path . '/' . $file, "date" => $pretty_date, "timestamp" => $timestamp ); } } rsort($list); } chdir($working_dir); //return list array; return $list; } $list_array = latestDirectory(); //use directory names,document root included in function if (!empty($list_array)) { //last directory created echo $list_array['0']['directory']; //list of directories echo "<pre>"; print_r($list_array); echo "<pre>"; } ?>
  19. Here is a little function to make it easier for you <?php function scoreLevel($score){ if(!$score || $score <= 0){ return 1; } $score = $score -1; $level = (int) floor($score / 100) + 1; return $level; } //usage //echo scoreLevel('201'); //test in a loop foreach (range(0, 500) as $number) { echo "score:".$number." level:".scoreLevel($number)."<br />"; } ?>
  20. The code works fine for me as well adding echo Is there api usage limits?
  21. The term to look for is ajax polling
  22. Here is a few http://betalist.com/ http://erlibird.com/ http://www.openforbeta.com/ http://startupli.st/ http://web.appstorm.net/ http://killerstartups.com/ http://www.testerpool.com/ http://www.startuptabs.com/ http://momb.socio-kybernetics.net/ http://betabait.com/ http://www.betabound.com/
  23. Another framework to look at is laravel Octobercms is a laravel based cms made for developers
  24. Welcome, is never too late to learn. Did you visit php.net ?
  25. You can suppress the strict standards notices php ini_set('error_reporting', 30711); htaccess php_value error_reporting 30711
×
×
  • 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.