Jump to content

lonewolf217

Members
  • Posts

    642
  • Joined

  • Last visited

    Never

Everything posted by lonewolf217

  1. also, put this at the top of your page to view any other errors <?php error_reporting(E_ALL); ini_set("display_errors", 1);
  2. maybe its just MSSQL, because when I run this select * from table where action like "%login%" i get "Invalid column name '%login%'"
  3. take out the slashes <?php $sql = "SELECT rating from users where username = 'Chris'"; I am not entirely sure if this will work with your class structure, but try it <?php $result = $mysqli->query($sql) or die(mysql_error()); if it doesn't, then you should just take exactly what you have for your $sql statement and throw it into your sql query engine and try to run it manually to see what the errors are
  4. SQL requires single quotes for text fields (i.e. around 'Chris'), double quotes wont work from my understanding. your bigger problem though is you do not close the bracket for your else statement which is probably causing the page to not show. You need to turn on error reporting to see the errors for stuff like this
  5. I am not sure if this was your latest code or not, but i think the problem may be here else{echo "<option value='$noticia2[cat_id]'>$noticia2[category]</option>";} you are assigning a value to the option of the category ID rather than the name. the "value" field is what will be sent to the next page. Change it to else{echo "<option value='$noticia2[category]'>$noticia2[category]</option>";} and i think it should work
  6. php isn't used for design. that is javascript or css typically
  7. this means there is something wrong with either your database connect or your query. try putting "or die(mysql_error());" at the end of those lines to see what the problem is
  8. you can look into the suckerfish menu for a nice simple sample http://htmldog.com/articles/suckerfish/dropdowns/
  9. i wouldn't turn that down if its solved, dont forget to click the Topic Solved button !
  10. and what happens when you make the modification to $location in your script ? You will probably also have to manually update what is already in your database <?php $location = "/profileimages/$name";
  11. http://www.w3schools.com/PHP/php_file.asp look into using a for or while loop with fgets and a simple counter. once you hit the 5 records you want, display a link and close the file
  12. try just opening "www.domain.com/profileimages/(name of the image)" from your browser and see if it shows up properly. If it does, I would suggest taking out the dirname(__FILE__) from your $location variable. If it doesn't, you need to check what the actual path to the file is
  13. Regardless if you dont know exactly what your code does, your syntax needs to be correct so you can take it one step at a time to make sure each part works. That is how you debug code, not posting it to a site and hoping for a magic response
  14. the first thing to fix is your syntax errors. turn on error reporting and make sure your parenthesis match up
  15. where is the code that uses PHP_SELF ? are you referencing it as $_SERVER['PHP_SELF'] ?
  16. i think the problem lies here <?php $location = dirname(__FILE__)."/profileimages/$name"; from here http://us2.php.net/manual/en/function.dirname.php it looks like this will get the pathname of the page that is currently loaded, or "/customers/squiblo.com/squiblo.com/httpd.www". You then append the path that you do want to the end of this, bringing you to the monstrosity in your database. do you happen to know what the correct path of the file SHOULD be ? perhaps then we can see exactly where the problem is, but right now I do not know what your expected directory structure is
  17. are you talking about foreach ? in your case, what happens if $countries array changes in size in your included file. then you will have to remember somehow to change the value of your while loop else it will start chopping off countries. with a foreach loop it will automatically go through each index of the array no matter how large it is. Did it not work when you pasted my code ?
  18. i think the problem is with your quotes here $string .= "<font color="#2766c5">" . $_POST['message'] . "\n<hr>"; to $string .= "<font color=#2766c5>" . $_POST['message'] . "</font>\n<hr>"; and also you aren't closing any of your HTML tags, which can cause problems with strip_tags. make sure your <b> and <font> tags are all properly closed
  19. <?php sort($countries); foreach($countries as $tempCountry) { echo "<OPTION value='" . $tempCountry . "'"; if($country == $tempCountry) { //country is a match echo " selected='selected'"; } echo ">" . $tempCountry . "</OPTION>"; } [code] the problem in your code is that you are echoing the value of the array index regardless of it matches or not, then you are echoing it a second time if it does match. Regardless, using foreach is always cleaner than trying a while loop to go through an array
  20. check two things 1) what is the location that is in the database 2) is the file actually at the location that you want it to be in ? I am a little hazy on file uploads, but I do not understand this part <?php //get file attributes $name = $_FILES['myfile']['name']; $tmp_name = $_FILES['myfile']['tmp_name']; // <----------- where is 'tmp_name' coming from ?? // and then later move_uploaded_file($tmp_name,$location); // <------- are you sure it is moving the file where you want it to be ?
  21. when you view the page source what does the output look like ? it seems you are running strip_tags before writing to the file. This will remove any type of formatting that you use
×
×
  • 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.