Jump to content

PHPFreaksMaster

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PHPFreaksMaster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You are getting uri from URL, your url must something like this http://localhost/mysite/pagename.php?uri=somevalue if your url is empty I mean is not declared then it will give that error
  2. you can use SORT in your query SELECT * FROM `table_name` SORT BY `Path`
  3. check your functions.php file you didn't declare $uri variable before using or past your functions.php file code
  4. The error message says that your file path is incorrect I will show some examples: OK, let say I have my files in a directory(includes) and I want to include files from that directory in a that which is in same place with includes directory. $file = "includes/header.php"; include($file); but it would be better to use a condition for checking if file path if ok or not. $file = "includes/file.php"; if(file_exists($file)){ include($file); }else{ echo "File not found: $file"; } another example: Lets say I have a folder named includes and another folder named pages and what I want to do is include file form includes folder in newpage.php which is in pages folder then $file = "../includes/config.php"; include($file); Hope it helps
  5. something like this: $text =$_POST['divisions']; $array = explode(",",$text); // print array values using print_r function echo "<pre>".print_r($array,true)."</pre>"; // print array values using foreach loopos foreach($array as $value){ echo "$value <br />"; }
  6. something like this $exts = ".jpg,.gif,.psd,"; echo substr($exts,0,strlen($exts)-1);
  7. try this code: DEFINE ('DB_USER', 'username'); DEFINE ('DB_PASSWORD', 'pass.'); DEFINE ('DB_HOST', 'host'); DEFINE ('DB_NAME', 'databasename'); // Make the connection: $mysqli = @new @mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $strQuery = "SELECT color FROM horses WHERE horse_id=$momhorseid LIMIT 1"; $query = $mysli->query($strQuery); if($query){ if($query->num_rows>0){ $result = $query->fetch_assoc(); }else{ echo "No record found"; } }else{ die($mysqli->error); } Note: You must change your hostname, username, password and databasename according to your server information.
  8. //What does these two lines do? it means that start the session and assign the value username from $user variable into session variable.
  9. do mean, if #msg is grater then 20 and less then 200 then show fine message else show long message? if yes then use this code $msg = strip_tags($_POST['msg']); if((strlen($msg)>=20) && (strlen($msg)<=200)) { echo "Message is fine"; } else{ die("The message is too long or too short."); }
×
×
  • 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.