Jump to content
Larry Ullman's Book Forums

leo

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

1 Neutral

About leo

  • Rank
    Member
  1. i figure the problem out, windows localhost doesn't have the php image library, thanks for you input anyway
  2. here is my image query echoing an image.... but how do i pass this image path into the getimagesize() Function to retrieve my width and height values ive tried getimagesize($img) and getimagesize('uploads/$img') can anybody help $cquery = "SELECT * FROM img_uploaded"; $test2 = mysqli_query($dbc, $cquery); while ($comm = mysqli_fetch_array($test2, MYSQLI_ASSOC)){ $img = $comm['img_name']; $imgsize = $comm['img_size']; echo "<img class=\"blogpic\" src=\"uploads/$img\" />";
  3. i have been looking through the book and i am struggling to find were this INDEX login (username, pass) being used within the php, i think i am expecting to see some form of combination of some sort.
  4. Hi i have a slight problem, i understand how to create and index tables in mysql, but i have this table creation here below... yes the user_id is primary and the username and email are unique, but i do not understand the last line the, INDEX login (username, pass), how will this be used? is login even a column in this database table once this key has been assigned, will taking this off give me a less secure login? what does is actually do? Kind regards CREATE TABLE users ( user_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, lang_id TINYINT UNSIGNED NOT NULL, time_zone VARCHAR(30) NO
  5. it has cleared things up a little but what about this random ID, how is everyones unique, i thought the "user_id" would be = to the user_id within the database, and that defines the sessions user! i have also seen code like $_SESSION['user_id'] = 1; lets say the sesssion user id is "12458" why you make this equal to one this also means that every users session will be 1, why do they do this?
  6. with sessions i am completly lost... so with this code here i can redirect a user if the user_id is not set right? so is this making my data on the file secury so the only people who can access it are users that are logged in? so can i use this code for pages that i wish to hide from unregistered users? session_start(); if (!isset($_SESSION['user_id'])) { require_once ('includes/login_functions. inc.php'); $url = absolute_url(); header("Location: $url"); exit(); }
  7. thats great paul il take alook, im glad you all could help. Kind regards
  8. and i get this error message... Timestamp: 12/11/2012 14:26:48 Error: [Exception... "'Javascript component does not have a method named: "onStatusChange"' when calling method: [nsIWebProgressListener::onStatusChange]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "<unknown>" data: no]
  9. Its saying create_window is not defined, i copied the code directly from you book, is there any syntax errors here? thanks
  10. im having problems trying to load the new images into another window, the image link will not open. i do not understand how the show_image.php file works with this and how the creat_window javascript function works with this. Please take a look at my code below... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <title>Images</title> <
  11. Im geting through the book gradualy but i am have problems with image section. ive come to a halt... i can up load the images into the dir put can not diplay then in the images.php file, when i click the links nothing happens. ive copied this example exactly out the book, and the show_image.php also comes up with these two warnings: Warning: Header may not contain more than a single header, new line detected. Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\show_image.php:43) the images.php file links do not load the images up in
  12. Ok, im new to php and trying to develop an app that allows me to upload image then resize them only on the output, i managed to save the image on the server in a folder, now i want to be able to display this images on the site in different sizes depending on what part of the site. like thumbnails and a bigger scale ect... so far i have this code $image_properties = getimagesize("uploads/orders.jpg"); $image_width = $image_properties[0]; $image_height = $image_properties[1]; $image_ratio = $image_width / $image_height; echo"<img src=\"$image_ratio\">"
  13. Thanks guys you have been great help, makes a lot more sence now thanks margaux thanks antonio.. i think i will go back to the debugging chapter, also how do i print this should i just echo? print_r($r)
×
×
  • Create New...