Jump to content

TheHaloEffect

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TheHaloEffect's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey! How is Flickr's URL accomplished in the sense of http://www.flickr.com/$username/$randomnumbersgohere/ I've noticed it doesn't have a .php or .html after the final / Any advice would be appreciated! Thanks
  2. Meh, now I've gotta rewrite my whole upload script Yer I meant in a blob.
  3. The image is in MySQL. The path the upload script shows is ?show=xx
  4. http://www.xodiac.net/screens/ does exactly the same thing In theory, it should work...
  5. I tried that before mate, I tried quite a few variations but still no joy. I've changed it now so you can see the error... /home/halo/public_html/screens/phpthumb/screens/upload.php?show=12 does not exist
  6. Hey guys, First off, thanks for looking at my post The problem I'm having is this: I've set phpthumb to do the following:- <img src="phpthumb/phpThumb.php?src=/screens/upload.php?show=<?php $random = rand(11,14); echo $random; ?>" alt=""> Now, on the site itself, it comes up with an error saying Whereas if you visit: http://www.xodiac.net/screens/upload.php?show=12 - the picture does very well indeed exist. Any ideas what's going on? Thanks again! <3
  7. I've renamed the column to brands, and updated the other scripts, and it all works fine, i can submit new brands into the database, and display the contents of the database into another script...but the drop down box still does bugger all Below is the addfood script without the drop down box added to it <html> <head><title>Submit Food</title></head> <body> <?php $self = $_SERVER['PHP_SELF']; $food = $_POST['food']; $amount = $_post['amount']; $energy = $_POST['energy']; $protein = $_POST['protein']; $carbs = $_POST['carbs']; $carbsats = $_POST['carbsats']; $fat = $_POST['fat']; $fatsats = $_POST['fatsats']; $fibre = $_POST['fibre']; $sodium = $_POST['sodium']; $salt = $_POST['salt']; if( ( $food == NULL ) ){ $form ="<h4>Add Food</h4>"; $form.="<form action=\"$self\""; $form.=" method=\"post\">Food name: "; $form.="<input type=\"text\" name=\"food\""; $form.=" value=\"$food\"><br> Amount(g): "; $form.="<input type=\"text\" name=\"amount\""; $form.=" value=\"$amount\"><br> Energy(kcal): "; $form.="<input type=\"text\" name=\"energy\""; $form.=" value=\"$energy\"><br>Protein(g): "; $form.="<input type=\"text\" name=\"protein\""; $form.=" value=\"$protein\"><br>Carbohydrate: "; $form.="<input type=\"text\" name=\"carbs\""; $form.=" value=\"$carbs\"><br> of which sugars: "; $form.="<input type=\"text\" name=\"carbsats\""; $form.=" value=\"$carbsats\"><br> Fat: "; $form.="<input type=\"text\" name=\"fat\""; $form.=" value=\"$fat\"><br> of which saturates: "; $form.="<input type=\"text\" name=\"fatsats\""; $form.=" value=\"$fatsats\"><br> Fibre: "; $form.="<input type=\"text\" name =\"fibre\""; $form.=" value=\"$fibre\"><br> Sodium: "; $form.="<input type=\"text\" name=\"sodium\""; $form.=" value=\"$sodium\"><br> Salt: "; $form.="<input type=\"text\" name=\"salt\""; $form.=" value=\"$salt\"><br><br>"; $form.="<input type=\"submit\" value=\"submit!\">"; $form.="</form>"; echo $form; } else { // MySQL details $mysql_host="localhost"; $mysql_user="test"; $mysql_pass="test"; $mysql_dbname="nutrition_db"; //Connect to MySQL $conn = @mysql_connect( $mysql_host, $mysql_user, $mysql_pass ) or die("Could not connect to MySQL"); //Selects the database $db = @mysql_select_db( $mysql_dbname, $conn ) or die("Could not select database"); //creates the query $sql = "insert into nutrition (food, amount, energy, protein, carbs, carbsats, fat, fatsats, fibre, sodium, salt) values ('".$food."', '".$iron."', '".$energy."', '".$protein."', '".$carbs."', '".$carbsats."', '".$fat."', '".$fatsats."', '".$fibre."', '".$sodium."', '".$salt."')"; $result = @mysql_query( $sql, $conn ) or die("Could not execute query"); if( $result !== FALSE) echo( "$food added" ); } ?> <br> <a href="index.php">Back</a> </body> </html>
  8. On second thought....The box appears...but the brands don't. Any ideas? Thanks
  9. Wow...thanks for the uber speedy responce! The brands don't show in the list though
  10. I've got a database named: nutrition_db I've got a table in there named: brands and inside that I have: brand I've made a script which allows a user to add food to a list, but I'd like a drop down box which has a list of all the brands from my database in, in alphabetical order. I've googled everywhere and searched around on here, but I can't find the solution that suites me. Can anyone help me with this? Thanks!
  11. Thank you for your reply...but all this does is refreshes and makes "Please enter all new user details..." into "Please complete Username and PasswordPlease enter all new user details..." The script that i posted above was 90% copied out of a book...I didn't imagine the book to be wrong =/
  12. I've made a log in script but when I press submit...The script just appears to refresh. Can anyone see what's going on? Thanks <html> <head><title>Register</title></head> <body> <?php $self = $_SERVER['PHP_SELF'];; $username = $_POST['username']; $password = $_POST['password']; if( ( $username == NULL ) or ( $password == NULL ) ) { $form ="Please enter all new user details..."; $form.="<form action=\"$self\""; $form.="method=\"post\">Username: "; $form.="<input type=\"text\" name=\"username\""; $form.=" value=\"$username\"><br>Password: "; $form.="<input type=\"text\" names=\"password\""; $form.=" value=\"$password\"><br>"; $form.="<input type=\"submit\" value=\"Submit!\">"; $form.="</form>"; echo( $form ); }else{ // MySQL details $mysql_host="localhost"; $mysql_user="nikon"; $mysql_pass="lol"; $mysql_dbname="nutrition_db"; //Connect to MySQL $conn = @mysql_connect( "localhost", "nikon", "lol" ) or die("Could not connect to MySQL"); //Selects the database $db = @mysql_select_db( "nutrition_db", $conn ) or die("Could not select database"); //creates the query $sql = "insert into users (username, password) values ('".$username."', '".$password."')"; $result = @mysql_query( $sql, $conn ) or die("Could not execute query"); if( $result !== FALSE) echo( "New user $username added" ); } ?> </body> </html>
×
×
  • 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.