Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by floridaflatlander

  1. Thanks for the reply ginerjm, no the conditions on the member page worked, the redirect also worked. The problem was on the login page if there was a session member id it would redirect back to the member page, the page the first redirect came from. I added ($_SESSION['agent'] == md5($_SERVER['HTTP_USER_AGENT'])) to the condition on the login page and it worked. Thanks again
  2. I can't get this simple redirect to work I put it at the beginning of a page to make sure all the needed session are present. I think the problem is in the user agent, I take that out and it works Say it's on website/member/index.php?id=1 and I change the user agent it doesn't redirect. It gives me a "This page can't be displayed" error on the same page website/member/index.php?id=1. function user_loggedin($home){ //if ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT'])) echo 'NO Match'; else echo 'Match'; // for testing // If not fully logged in with required Sessions redirect if (!isset($_SESSION['id_member']) OR !isset($_SESSION['id_group']) OR !isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT']))) { header("Location: $home/members/login.php"); exit(); // Quit the script. } } Thanks
  3. I would think so, are you sure your provider used a photo that was large enough for the test upload?
  4. What do you or they have your php.ini memory limit set to? Two interesting links I found last week were http://forums.devshed.com/php-development-5/imagecreatefromjpeg-causes-memory-error-667236.html & http://www.webdeveloper.com/forum/showthread.php?182328-imagecreatefromjpeg-is-eating-memory If I remember correctly and did it correctly my 2.91mb photo took up almost 71mb. As a poster noted you definitely want to use imagedestroy
  5. Thanks Barand & Requinix, this is I was looking for. I'm saving a little processing taking the thumb from the resized photo and because it's a thumb quality doesn't have to be perfect. Thanks again
  6. Thanks for the reply requinix, I really don't know how it works but I'm assuming that the image is already loaded to make the larger 450*400 picture so it wouldn't be loading twice(I think)
  7. http://php.net/manual/en/function.htmlentities.php note the flags constants, I use ENT_QUOTES
  8. I'm saving two photos from an upload. One is a larger photo and the other is a thumb. I was wondering if i used less resources to create the thumb copy of a photo from the reduced larger photo say 450*400 or create the thumb from the original that can be say 3mb and say 2500px * whatever or is it 6 one way or a half dozen another? imagecopyresampled($photo, $source, 0, 0, 0, 0, $photo_width, $photo_height, $width, $height); // imagecopyresampled($thumb_photo, $source, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height); // OLD WAY imagecopyresampled($thumb_photo, $photo, 0, 0, 0, 0, $thumb_width, $thumb_height, $photo_width, $photo_height);
  9. Has anyone had this problem that I solved(I hope) with bleepingcomputer.com Whenever I tried to upload a photo here or at several other sites from my computer the picture folders wouldn't shown on this or several other sites in ie10, they worked fine with firefox. And yes I was always in the right folder and none of the folders were hidden. On one of several searches ... "not all the picture folders are showing in ie10 upload" I got this http://answers.microsoft.com/en-us/ie/forum/ie10-windows_7/not-all-the-folders-are-showing-ie10/36835c45-afd9-4573-8ea1-658df0dd4368 then this http://www.bleepingcomputer.com/download/unhide/ This link said ... "Unhide is a program that reverts back the changes made to your files and Windows Registry by the rogue.FakeHDD family of rogue anti-spyware program. This family of malware pretends to be a hard disk repair and system optimization program for Windows. In reality, though, these programs are computer infections that deliberately hide your files and change certain settings in the Windows Registry to make it appear that you have lost data on your hard drive. It will then prompt you to purchase the program to restore the data" Running a full scan with Norton Security Suite did not help. Now a week or so ago I did click a link to a site that said I need to run their software to clean my computer of viruses so maybe I got something there. I ran the above from bleepingcomputer.com and ie upload now reads the photo folders. So my question is Has anyone had this problem or heard of it and how it you solve it? Thanks
  10. I have a mysql table of items and was wondering if it would be to confusing to combine the columns used for the different “non-repeating info” that items had. Instead of having columns for the number of bathrooms, boat length, rv length and camper length have one column called something like num1. I've always heard that you should name columns in a way that associates with the column info, but if I combine columns I just have to add 18 columns, if I don't combine them I have to add 50 plus columns. Or .. even though the data is non repeating go ahead and make tables for the info for realestate, boats, autos, rv's and on and on. Just looking for some ideas Thanks
  11. Are php user defined functions defined/redefined every time a page loads? I have a functions page and function_exist() tells me the function is redefined every time I load a page. Is this correct, is this the nature of the beast that the functions will be redefined each time the function.inc file is used? When they(books) say remember, are they taking about a page that uses the function.inc file 2,3,4 5 times? Thanks
  12. Yes,I just copied and pasted and should use mysqli if at all posssible.
  13. Well you already have this "$num=mysql_num_rows($results);" with the LIMIT 4 and because the data is returned in rows I use $row = mysql_fetch_array($results); Then $sql = "SELECT * FROM cards ORDER BY RAND() LIMIT 4"; $results = mysql_query($sql); if ($r && (mysqli_num_rows($r) >= 1)) { // run if there is data while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<a href="card.php?cardid=' . $row['id'] . '">' .$row['name'].'</a>'; echo "</br>"; } } else {echo 'Something or nothing here';}
  14. This is common, where do you define subject & detail at? You could do something like if (isset($detail) {$message = "$detail";} which looks better or up at the beginning of the file put something like $subject = $detail = FALSE;
  15. The single quotes may be his issue, I just copied and pasted his code, changed the title & message and did't see that. But as I under stand it, $meil2 is a variable like $to so it should be ... mail("$meil2","VELEC 2012, Resgister succced! $datav","From: info@velec.com"); or mail("$meil2","Test Title", "Test Body", "From: info@velec.com"); Hey Katyna, before you do all this change your code to mail("$meil2","VELEC 2012, Resgister succced!","{$datav}","From: info@velec.com"); mail("$jobmeil2","VELEC 2012, Register succed!","{$datav}","From: info@velec.com"); and see what happens
  16. I don't understand what this is "UID - This is auto increment UID UserId Name Time" Anyway, I usually run a query and if a certain value is already present in a column or in a column with a user id of xx I wont enter the data. Also if you verify your data and your form wont process with out the info being filled out you maybe able to reset a value to false after the info is entered. Then it wont be entered again.
  17. "php mail function dont accept variable names in the '$to' parameter??" Yes it does, I use it. For testing, try hard coding dummy values and/or get rid of one of the parameters. If the simple hard code works it may mean that your format is wrong. mail('$meil2',"VELEC 2012, Resgister succced! $datav","From: info@velec.com"); or mail('$meil2',"Test Title", "Test Body", "From: info@velec.com");
  18. You don't define it until you click submit then the value is POSTED to $myTextbox = $_POST['myTextbox']; Also put your php code in if (isset($_POST['submit'])) { // this name must match your form input name at <input type = 'submit' name = 'submit'/> $myTextbox = $_POST['myTextbox']; if(isset($myTextbox)&&!empty($myTextbox)){ echo 'You Typed: '.$myTextbox; } } as you play more put the footer under the echo and under the footer place exit() to stop the script.
  19. I must be missing something, your form is sending it to send_mail.php Do you have exit()'s on redirects in send_mail.php
  20. Also it's a good habit to use exit() after all your redirects, this stops the script from running. header( "Location: $feedback_page" ); exit; header( "Location: $thankyou_page" ); exit; and on and on
  21. Either enter your URL here http://validator.w3.org/ or copy and paste the source code and if there is an issue it will tell you. If you don't get an answer do the same with your css here http://jigsaw.w3.org/css-validator/ Be careful of extra brackets left in your css while editing. Is this with ie 7/8 or 9?
  22. Here's a quick poor mans way to do what I think you're doing. if(isset($_POST['submitted'])){ $error = FALSE; // Check for a name: if (empty($_POST['name'])) { $error [] = 1; // Or $error [] = '<h5 style="color: red;">* You forgot to enter a name.</h5>'; and then print this array } else { $name= $_POST['name']; $name = mysqli_real_escape_string($dbc, trim($name)); } // Check for a something: if (empty($_POST['somethnig'])) { $error [] = 1; } else { $something= $_POST['something']; $something = mysqli_real_escape_string($dbc, trim($something)); } if (!$error) { $sqlinsert = "INSERT INTO Users (name) VALUES ('$name')"; $r = mysqli_query($dbc, $sqlinsert); // or die("Error: ".mysqli_error($dbc)); if ($r) {$newrecord = "Name created";} } }
×
×
  • 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.