Jump to content

BrettHartel

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by BrettHartel

  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".
  16. Thanks for taking the time to help me! What are the pros and cons of letting a user upload an image file to a database vs. folder? Specifically, which one is more secure and safer to use? Thanks, Brett Hartel
  17. figured it out. As long as the function includes the return() then it works
  18. Or there could be another reason Sometimes variables inside functions are only for that function. So when you echo the $Day after the function, it just returns the original string of 1.
  19. Because of $days = $days + 1; Since $days was originally 0, you changed it to 0+1 so in the end you have $Days = 1 in the end. * I think, I am still learning php
  20. Thank you for taking the time to help me I am curious about this function when $salt is created. Will it use the $POST['eMail'] or does it use $eMail? eMail = "test@hotmail.com"; $_POST['eMail'] = "secret@hotmail.com"; $salt = generateSalt($_POST['eMail']); function generateSalt($eMail) { $salt = '$2a$13$'; $salt = $salt . md5(strtolower($eMail)); return $salt; } How could I make it so that any information I request is used in the function? For example: $salt1 = generateSalt($_POST['eMail']); $salt2 = generateSalt($_POST['Username']); $salt3 = generateSalt($_POST['FirstName']); $salt4 = generateSalt($_POST['LastName']); This is just an example I created to ape for future functions. Sincerely, Brett Hartel
  21. Thanks for taking the time to help me I have created a working user/password system with bcrypted passwords! That is called hashtaggin But, how to I encrypt e-mails, usernames, or other information that I want secured, but also want to be able to decrypt? Im not sure what to be searching for. Where do I start? Sincerely, Brett Hartel
  22. OMG! I have been trying to change this code around for hours on end! THANK YOU SO MUCH REQUINIX!!!!!
  23. Thank you for helping me! For some reason $eMail gets set to nothing. I have the results echo and it is completely blank. What am I doing wrong? $eMail = $_Post['eMail']; $eMailResult = mysql_query("SELECT eMail FROM eMail WHERE eMail='$eMail'"); if (mysql_num_rows($eMailResult) == 0){/* eMail is Unique */} else { $Error = "eMail already exists!"; setcookie( "SignUp_Error", "$Error", time()+30, "/", ".diamondbookclub.com" ); setcookie( "LogIn_Error", "$Error", time()-1, "/", ".diamondbookclub.com" ); header('Location: index.php'); exit(0); } Sincerely, Brett Hartel
×
×
  • 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.