wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
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
-
Undefined variable and Undefined index error
wildteen88 replied to hass1980's topic in PHP Coding Help
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? -
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); }
-
Undefined variable and Undefined index error
wildteen88 replied to hass1980's topic in PHP Coding Help
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? -
Undefined variable and Undefined index error
wildteen88 replied to hass1980's topic in PHP Coding Help
$HTTP_*_VARS are depriecated (and are disabled by default) you should use the newer (shorter) superglobal arrays $_GET, $_POST, $_COOKE, $_SERVER, $_SESSION etc -
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
-
You'd use floats for this. A good tutorial which explains how to create a two column layout with divs is here
-
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
-
Variables within single quotes will be parsed. Remove the single quotes
-
Correct.
-
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();
-
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.
-
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.
-
Most probably a call to a custom function
-
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
-
First grab the variable from the url $folder = $_GET['var']; Now just replace "./files" with "./$folder"
-
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.
-
[SOLVED] [HELP] function GetPlayerStats($sqlid,$output)
wildteen88 replied to R4nk3d's topic in PHP Coding Help
It'll be ablot easier if you did $myvar = GetPlayerStats($_SESSION["ID"]); What you're trying to do is over complicating things abit. -
Need Sample Projects joomla,drupal,payment gateway
wildteen88 replied to vivekme77's topic in Applications
Have you tried reading the documentation for Joomla yet. -
[SOLVED] body background image staggered with header?
wildteen88 replied to FaT3oYCG's topic in CSS Help
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). -
$result = mysql_query($query); Should be $result = mysqli_query($query);