Jump to content

BrettHartel

Members
  • Posts

    54
  • Joined

  • Last visited

BrettHartel's Achievements

Member

Member (2/5)

0

Reputation

  1. I want to display an image after using imagefilter() to add color to it. But, do I need to save the file or can I display it directly on the webpage without saving it? Thanks for your time, Brett Hartel
  2. When using a form action to send the form input to another page you do not need a header that redirects. Clicking the form button will automatically redirect you.
  3. Thanks for taking the time to help me. I am not sure where to start with the effect I would like. There will be a dropdown list and I would like a picture next to it. Then, as the user selects different inputs from the dropdown list the picture will change accordingly. I appreciate any help I can receive. Thank you, Brett Hartel
  4. I have never worked with sessions, but you should upgrade your code to mysqli instead of mysql.
  5. Please post your php code between the [code] [/code] tags. Nobody wants to download random files from the internet.
  6. Or, every time the client chooses another client, you could have it set a cookie value that would set the missing value on reload. depends on what you want really.
  7. Not entirely certain, but I believe there is a default max_file_size that you need to set higher. This is only a guess as I have never used the resize code.
  8. (after connecting to a database using mysqli)... mysqli_query($link, "UPDATE Picture SET PictureName='$_FILES["product_image1"]["name"]' is that what you are looking for?
  9. Thank you for taking the time to help me. I am trying to optimize my php code to work for speed. Even though my code doesn't contain a lot of information, I would like to learn properly. Currently, this is the code I am using. $sql="INSERT INTO eMail (User_ID, eMail) VALUES ('$User_ID','$_POST[eMail]')"; if (!mysqli_query($link,$sql)) { die('Error: ' . mysqli_error()); } Is there a better code I could use or is this optimized php already? Thank you, Brett Hartel
  10. I cant help you with this, but if the image exists on the web already, you could just store the url in a table then display the url when you want to display the image.
  11. Thank you for taking the time to help me! I cannot figure out why these two lines of code are not updating my mysql database. I am deleting a user picture, if it exists, and then setting the picture back to default. No errors are coming back to me and my mysql database is not updating. mysql_query("UPDATE ProfilePicture SET PictureName='$default' WHERE User_ID='$_COOKIE[user_ID]'"); mysql_query("UPDATE ProfilePicture SET PictureType='$default_extension' WHERE User_ID='$_COOKIE[user_ID]'"); This is my full code. <?php $con = mysql_connect("******","******","******"); if (!$con){ die('Could not connect: . mysql_error()'); } mysql_select_db("******", $con); $Server = $_SERVER["DOCUMENT_ROOT"]; $target_path = "images/profile_picture/"; $default = "default.gif"; $default_extension = "gif"; $Result_PictureType = mysql_query("SELECT PictureType FROM ProfilePicture WHERE User_ID='$_COOKIE[user_ID]'"); while ($row = mysql_fetch_assoc($Result_PictureType)) { $User_Picture = $Server . "/images/profile_picture/" . $User_ID . "." . $row["PictureType"]; } $Result_PictureName = mysql_query("SELECT PictureName FROM ProfilePicture WHERE User_ID='$_COOKIE[user_ID]'"); while ($row = mysql_fetch_assoc($Result_PictureName)) { $Data_Picture = $row["PictureName"]; } if ($Data_Picture != "default.gif") { unlink($User_Picture); } mysql_query("UPDATE ProfilePicture SET PictureName='$default' WHERE User_ID='$_COOKIE[user_ID]'"); mysql_query("UPDATE ProfilePicture SET PictureType='$default_extension' WHERE User_ID='$_COOKIE[user_ID]'"); header('Location: profile.php'); mysql_close($con); ?> Thanks, Brett Hartel
  12. I think this code would also work if you wanted to echo the html. if($session->logged_in){ $hiddenemail = $session->userinfo['username']; }else{ echo "Email: <input name='email' maxlength='50' size='25' type='text' />" ;}
  13. I would suggest learning about php (www.w3schools.com) because developing a webcrawler takes a lot of knowledge. I don't think a newbie could undertake such a huge project.
  14. OR! I just thought of this. You could do this inside your form! It will get the users email if logged in, otherwise it will ask the person to enter an e-mail. if($session->logged_in){ $hiddenemail = $session->userinfo['username']; }else{ ?> Email: <input name="email" maxlength="50" size="25" type="text" /> <?php }
  15. Im still learning php but I think this is what you can do: Before the form code: if($session->logged_in){ $hiddenemail = $session->userinfo['username']; }else{ $hiddenemail = '0'; } If there is no session, i believe the value becomes 0 and that will be displayed. You could change it to anything you want really. like "User has no e-mail" or "N/A".
×
×
  • 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.