Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Oops Just to let you know I had a typo in the code. This line list($name, $imageurl, $cost) = mysql_num_rows($result); should of been To clarify you only need to use a loop if you are planning on retrieving more than one result from the query.
  2. if you're still getting the error then make sure you're saving your file as ASCII (or UTF-8 without BOM).
  3. The questions you have asked has nothing to do with PHP, but 1. That form of url is known as a subdomain. Your website host should provide a facility for setting up subdomains. 2. Clean URLs are archived using mod_rewrite
  4. Looking at your original post do_html_header() is defined in output_fns.php. With the code you posted above I do not see a like include 'output_fns.php'; If you do not include that file PHP wont be able to call your function. Or is that line in book_sc_fns.php?
  5. Looking at your code you do not need to use any form of loop. As you're only returning one result. You could of done it this way: $query = "SELECT money FROM `users` WHERE `username` = '".$luser."'"; $result= mysql_query($query); if(mysql_num_rows($result) != 0) { list($money) = mysql_fetch_row($result); $query = "SELECT name, imageurl, description FROM adoptables WHERE uid = '$aID'"; $result = mysql_query($query); list($name, $imageurl, $cost) = mysql_num_rows($result); }
  6. You have output on line 2 in dosignup.php Make sure you do not have anything before your opening PHP tag (<?php), this includes spaces/new lines etc.
  7. its simple $HTTP_GET_VARS should be $_GET $HTTP_POST_VARS should be $_POST $HTTP_SESSION_VARS should be $_SESSION etc... You starting to see the pattern?
  8. $HTTP_*_VARS are depriecated (and are disabled by default) you should use the newer (shorter) superglobal arrays $_GET, $_POST, $_COOKE, $_SERVER, $_SESSION etc
  9. You need to escape quotes within strings before it goes into the database. Use mysql_real_escape_string to escape such characters (and any other harmful characters) when inserting data into the database
  10. You'd use floats for this. A good tutorial which explains how to create a two column layout with divs is here
  11. If mysql_num_rows is failing then it usually means your query has failed due to an error. To see if you query is causing an error Change $lastreply=mysql_query("SELECT * FROM reply"); to $lastreply=mysql_query("SELECT * FROM reply") or die(mysql_error()); Post the error message you get here
  12. Variables within single quotes will be parsed. Remove the single quotes
  13. Correct.
  14. If its all the form data ($_POST) then you could do $_SESSION = $_POST However this will remove existing session variables. Otherwise you can do something like the following // list all field you want to be added to your session $fields = array('genre', 'formed', 'position0', 'member0' /* etc */); // here we define the session variable for each field foreach($fields as $var) { if(isset($_POST[$var])) $_SESSION[$var] = $_POST[$var]; } Place this code before you call header();
  15. How would I know where to place that code. You've not explained what you're trying to do/what your script does. I guess.
  16. Use the $_SESSION superglobal array to add/retrieve data to/from your session Assign new session variable $_SESSION]'new_var'] = 'new value'; // OR $_SESSION]'new_var'] = $some_var; Retrieve session variable $some_var = $_SESSION]'new_var']; Just make sure you call session_start(); at the top of each page which uses sessions.
  17. Most probably a call to a custom function
  18. The real problem is not on line 10. Its actually on line 6 (near the end). Have alook at your post above and see what I'm talking about. The syntax highlighting in your post above gives it away
  19. First grab the variable from the url $folder = $_GET['var']; Now just replace "./files" with "./$folder"
  20. Looking at your code you should first define all variables as asc. Now within your if/elseif/else statement you just redefine the necessary variable(s) when the sort order changes.
  21. It'll be ablot easier if you did $myvar = GetPlayerStats($_SESSION["ID"]); What you're trying to do is over complicating things abit.
  22. Have you tried reading the documentation for Joomla yet.
  23. From what I see you need to adjust the position of the background image for your body tag. In your CSS change body { background: #f3ebe0 url(bg.gif) repeat-x; to this: body { background: #f3ebe0 url(bg.gif) 0 -105px repeat-x; NOTE: You if you change the size of the header later on you will need to adjust the postion of the background image again).
  24. $result = mysql_query($query); Should be $result = mysqli_query($query);
  25. When you change the mysql root password you need to configure phpMyAdmin to use this new password. You do this by editing the config.inc.php file which is located in C:/wamp/apps/phpmyadmin3.x.x
×
×
  • 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.