Jump to content

dragon_sa

Members
  • Posts

    520
  • Joined

  • Last visited

Everything posted by dragon_sa

  1. also this { mail($to, $sub, $mes, $headers); } should be mail($to, $sub, $mes, $headers); } else {
  2. This line if(($_SESSION['security_code'] != $_POST['security_code']) || (empty($_SESSION['security_code'])) ){ should be if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ){ as this section of the code wants to send the message so it must comply to your if statement, you were saying if it does not equal the code or the code is empty send the message
  3. I dont think its your problem, but when repeating-x you dont need the center property on the background-position, I cant repeat your problem here.
  4. are you sure your get_all_subjects(); is connecting to the database and returning any data, as you havent provided this bit of code(minus any usernames and passwords) we cant see what is going on, we cant see where your variables are meant to be coming from
  5. try removing the ticks from the table name $query ="INSERT INTO companies (company_name, contact_name, location, postcode, street1, street2, city, phone, email, basicpackage_description, premiumuser_description, password, salt, approved, upload) VALUES ('$company_name', '$contact_name', '$location', '$postcode', '$street1', '$street2', '$city', '$phone', '$email', '$basicpackage_description', '$premiumuser_description', '$password', '$salt', '$approved', '$upload')";
  6. remove this bit } /* if artist is set display the artist */ if($artist="") { That is already handled in the if statement I gave you be sure to remove all the code I showed eg including the curly braces
  7. I have had a bit of a trawl through that code, I can so far only find 2 spots that refer to the page=Product in what you have given so far and that is on your search page I cant find anywhere where that $Pagedescr gets set, so you need to find out what table has the product description and which column name, The easiest thing to do on the index page would be to query the database for the product id that gets sent and then get the associated product description, once you have that you can set the title. Remove that title query you had as title already gets set a bit further down your index page so we will need to modify that if a product has been selected.
  8. remove this bit /* check to see if an artist has been selected */ if(!$_GET['artist']) { $artist = 0; }else{ $artist = $_GET['artist']; } and change your if($artist>0) { to if(isset($_GET['artist']) && $_GET['artist'] != '') { $artist = mysql_real_escape_string($_GET['artist']); //rest of your code here
  9. is the value for artist sent in the link here actually a number? <a href="artist.php?artist=<?PHP echo $row['artist']; ?>"> I see you use the same part row here for the artist name <b><font size="5"><?PHP echo $artist; ?></font></b> <br> so if the value are sending is not a number this will fail if($artist>0) {
  10. which page has the product links used to select products?
  11. Does the index page get loaded everytime you select a product or does only the section where the product page get loaded? To change the title of the index page it needs to be reloaded, the code to evaluate the the title will need to be on the index page, when you click on a product you would be able to add the page title to the link and then call that page title on the index page. The product page itself has no part of this, we wil need to perform the work on the index page, and the index page will need to reload for each product called
  12. are we not talking about the title for the product page each time a product is displayed? If not how does your page work when you are viewing a product, does the product page get called into another page? We are going to need more code for how that variable $Pagedescr is set and when and where it is set.
  13. variables are case sensitive as the first note, secondly you are checking for pageTitle when you should be checking for the variable you want to echo i am assuming it is $Pagedescr so your code should be more like this <title><?php if (isset($Pagedescr)) { echo $Pagedescr; } else { echo "Name of the company"; } ?></title>
  14. You can do this using getimagesize(); eg $img = "someimage.jpg"; // the image you want to check list($width, $height) = getimagesize($img); // gets the width and height as variables $width and $height // add you if statement conditions here and echo your results or set your variables based on results Keep in mind that not all images are square so you might want to think about testing for the largest size and scale that way, this should get you started, try some coding and if you get stuck let us no and post your attempt.
  15. - You initially declare and set your variables $a1, $a2, $a3. - You then call the function fix_names declaring that they are the 3 variables you want processed. - The variables inside the function are $n1, $n2, $n3, these are only available inside the function, and are set to the values of the 3 variables you declared when you call this function in this case $a1, $a2, $a3. - The function applies the formatting to the 3 variables and then returns the values to $a1, $a2, $a3 repectively. - You can call the same function many times like this <?php $a1 = "EDWARD"; $a2 = "thomas"; $a3 = "wriGHT"; $b1 = "bOB"; $b2 = "FRed"; $b3 = "johN"; $dave = "daVe"; $mark = "MARK"; $frank = "jasOn"; fix_names($a1,$a2,$a3); echo $a1." ".$a2." ".$a3."<br/>"; fix_names($b1,$b2,$b3); echo $b1." ".$b2." ".$b3."<br/>"; fix_names($dave,$mark,$frank); echo $dave." ".$mark." ".$frank."<br/>"; function fix_names(&$n1,&$n2,&$n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); } ?> Try it for yourself
  16. if the client is creating directories with names like this, I would be cleansing their data(removing special characters) in your scripts that allow them to create such directory names, then you will not have this issue. To fix it now you will have to manually change the directory names and the links that refer to these directories, and fix your scripts that allow them to create directories and file names.
  17. hers a function that will work <?php function get_primes($number) { $primes = array(2); $x = 3; while($x < $number) { $isprime = true; foreach($primes as $val) { if($x % $val == 0) { $isprime = false; break; } } if($isprime) { $primes[] = $x; } $x+=2; } foreach($primes as $val) { echo $val."<br>"; } } get_primes(20); ?>
  18. what is creating the directories with the special characters in it? I would always avoid making directories with names like this 1.1034350!
  19. try this on the final page for testing print_r($_POST['cars']); this will show you the array of id's if you still have them Then you need to process the array to suit your needs I assume entering into a database
  20. show_source(/path/to/file);
  21. try changing this <input name="submit" type="button" value="Register" /> to this <input name="submit" type="submit" value="Register" /> It needs to be a submit type to submit your form, I am not sure how this issue relates to phpMyAdmin though?
  22. Why dont you comment out the public function and run your mysql query and echo out the results you are getting to see if they are what you are expecting from the DB
  23. Just use define('SERVER_NAME' , 'http://www.fitness.com/'); //and used it like this <a href='<?php echo SERVER_NAME; ?>filename.php'>go to that page</a>
  24. as Muddy_Funster says public function login($uname, $pass) { $pass=sha1($pass); $result =$this->db->query("SELECT * FROM tbl_userauth"); $result->execute(); $resl=$result->fetchAll(PDO::FETCH_ASSOC); if ($resl[0]['username'] !=$uname && $resl[0]['password']!=$pass) { return $this->error("Username or Password Not Found"); } else{ header("location:dash.php"); } }
  25. He means how is your password stored in the database, have you used md5 or sha1 or something else to encrypt it. When you compare the passwords you need to do the same thing so the values are the same or they will not match and hence you have an issue.
×
×
  • 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.