
BrettHartel
Members-
Posts
54 -
Joined
-
Last visited
Everything posted by BrettHartel
-
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
-
PHP beginner- Want to redirect to top of page
BrettHartel replied to PHP_CHILD's topic in PHP Coding Help
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. -
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
-
I have never worked with sessions, but you should upgrade your code to mysqli instead of mysql.
-
Php Code Not Working After Hosting Transfer
BrettHartel replied to mdeppa's topic in PHP Coding Help
Please post your php code between the [code] [/code] tags. Nobody wants to download random files from the internet. -
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.
-
(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?
-
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
-
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.
-
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
-
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' />" ;}
-
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.
-
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 }
-
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".
-
Php Hashtag Password Help, Returned Two Different Values!
BrettHartel replied to BrettHartel's topic in PHP Coding Help
Thank you guys! -
figured it out. As long as the function includes the return() then it works
-
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.
-
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
-
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 = "[email protected]"; $_POST['eMail'] = "[email protected]"; $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
-
What Is It Called When I Want To Encrypt A User Input.
BrettHartel replied to BrettHartel's topic in PHP Coding Help
Thank you -
What Is It Called When I Want To Encrypt A User Input.
BrettHartel posted a topic in PHP Coding Help
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 -
After Selecting Form Database How To I Preserve The Variable?
BrettHartel replied to BrettHartel's topic in PHP Coding Help
OMG! I have been trying to change this code around for hours on end! THANK YOU SO MUCH REQUINIX!!!!! -
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