Jump to content

Walker33

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Everything posted by Walker33

  1. Found the answer and just wanted to get it here for other people if they ever run across a similar problem. Yes, it was a setting in the php.ini file, the memory_limit parameter. I found in the server log that the allowed memory size was exhausted, so by moving the memory_limit up to 20, the problem was resolved. Hope that helps someone else down the road.
  2. No, I've never heard of a script being too large to process, either. It's 8,000 lines, though, which is larger than any other single page I've ever constructed. I know it's not the code, because I kept cutting parts of it out to see where the failure was (figuring it was the code, even though I couldn't find my mistake), and when it failed, I took that code at the failure point, put it back in, and pulled other code. Worked fine, then when adding the previously "working" code, it failed there. I did that several times with several different pieces of the code, and all was fine until I hit a certain level. So to answer the other question, no, I can't really post it. It's enormous, and there's an awful lot of sensitive data there. But I can say with certainty that it's not the code, so I'm assuming it's the size. But maybe it's not the size? Maybe it's the memory limit? I'm not sure.
  3. I've got an enormous page for a pretty complex process. I just posted some changes, and it stopped functioning. Through multiple tests, I determined there was no problem with the code; it was just becomes too large at a certain point. I've read about changing settings in the php.ini file, but I'm not exactly sure what to change or what to bump it up to to allow for this huge page. Here are some current settings that I'm guessing control this problem: max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) ; Maximum size of POST data that PHP will accept. post_max_size = 8M ; Maximum allowed size for uploaded files. upload_max_filesize = 2M Does anyone have any insight into what to change or what settings might allow for a larger page? Not sure which one of these settings controls my problem. Thanks, as always, for any help.
  4. Okay, thanks. I didn't think so, but I wanted to be sure, and I couldn't find a definitive answer anywhere. Appreciate it.
  5. I think I know the answer to this, but it would make things easier if I could do what I think I can't. Can I use LIKE and NOT LIKE in an if statement? Doesn't seem to be working for me. <?php //$rightlic is a twelve character string ending either P00, P01, V00, or V01. I want to do different things based on V or P if ($rightlic not like '%V00' AND $rightlic not like '%V01'){ echo "<br>purchaser ran demo as public but is now trying to purchase a private account. Stop the process."; exit; } ?> Can I do something like this or do I have to separate the string and look for the last characters that way? Thanks in advance for any help.
  6. Well, I didn't put that in there, but the $Email variable is gained from the form they fill out, so $Email = dave@dave.com or whatever they put in.
  7. Okay, thanks. I researched quite a bit and didn't find much. Some stuff about using the host, user and pass, but nothing is working. Thanks for your input.
  8. I have a form on my web page on a Windows server. I'm trying to send a simple email. My email server is on a different Linux server. That Linux server has seven different email accounts tied into into it. Whenever the "to" address resovles to one of the addresses on the Linux server, I receive the email just fine, but if it tries to send it to any other email address outside that Linux server (gmail or yahoo or whatever), I never recieve it. Not sure what to do. <?php // Sending email to person requesting free trial $to = $Email; $headers = "From: support@company.net\r\n" . ""; $subject = "Your Trial"; $body = "$Name, Thank you for requesting a free, 15-day trial!"; mail($to, $subject, $body, $headers); ?> Thanks for any help!
  9. Yes, that helps quite a bit. Thanks for taking the time to explain it to me. Appreciate it.
  10. Explain why ($_POST['memlname']) didn't work, but ($memlname) does work? When I used the same trim code, but $memlname = mysql_real_escape_string($_POST['memlname']); the $memlname variable would not allow whitespace. When I took your suggestion and used: $memlname = mysql_real_escape_string($memlname); instead, then $memlname variable would allow the whitespace at beginning and end. Why is that? Thanks.
  11. thanks. Came across ltrim and rtrim befor trim. You're right, cleaner with trim. I was using mysql_real_escape_string to stop a single quote ' from breaking up the input query and causing the error, as in O'Malley, O'Sullivan, etc. To this point, it seems to have worked. Am I misunderstanding something? I took your advice and changed ($_POST['memlname'] to simply ($memlname) and now all is working as it should. If you care to explain why this is, I'm always eager to learn. Thanks for the help! New code: //this allows for accidental extra spaces at beginning and end of name $memfname = trim($memfname); $memlname = trim($memlname); $mememail = trim($mememail); $mempass = trim($mempass); //this allows for Irish names like O'Sullivan, O'Donnell, etc. $memlname = mysql_real_escape_string($memlname);
  12. I've been using mysql_real_escape_string to allow for Irish names for a login, and I just added ltrim and rtrim to the code to eliminate accidental spaces at the beginning and end. Everything worked except the $memlname variable. When I pulled the mysql_real_escape_string snippet from the code, the ltrim and rtrim worked for $memlname variable. Not sure what I'm doing wrong. Any help would be greatly appreciated. <?php //this allows for accidental extra spaces at beginning and end of name $memfname = ltrim($memfname); $memlname = ltrim($memlname); $mememail = ltrim($mememail); $mempass = ltrim($mempass); $memfname = rtrim($memfname); $memlname = rtrim($memlname); $mememail = rtrim($mememail); $mempass = rtrim($mempass); //this allows for Irish names like O'Sullivan, O'Donnell, etc. $memlname = mysql_real_escape_string($_POST['memlname']); ?>
  13. Beautiful! Thanks a ton, that was what I was looking for. Really appreciate the help.
  14. let me clarify, which I should have done from the start. A standard echo WILL give both names. But when I echo it in a form for them to change, it does not. So: <form name="profileupdate" method="post" action="/memberupdate.php"> <strong>First:</strong> <input type="text" name="newfirst" size="30" value=<?php echo $userfirst; ?>><br> <strong>Last:</strong> <input type="text" name="newlast" size="30" value=<?php echo $userlast; ?>><br> <strong>Email:</strong> <input type="text" name="newemail" size="30" value=<?php echo $useremail; ?>><br> Does that help?
  15. Hello! Sorry if this is incredibly simplistic. Scenario is: User logs in with their account name, pass, etc. Script lets them in if name is 'like', since many users have last name changes, nicknames (sue for sue ann, etc.). So if they are Sue but database has Sue Ann, I want them to see Sue Ann in their profile so that they can change their profile accordingly. Currently, that doesn't happen when there's a space between names. If they are SueAnn, all one word, they can log in as Sue, and the echo in profile shows SueAnn, but if there's a space as in Sue Ann, it will only show Sue in the profile echo. Ideas? <?php $scoquery1 = mysql_query("SELECT License_Num, FirstName, LastName, Email FROM customer_details WHERE FirstName like '%$memfname%' AND LastName like '%$memlname%' AND status like '%active%' AND Email = '$mememail' AND Password = '$mempass' AND activate = 'yes'"); $findit = mysql_fetch_assoc($scoquery1); $masterlic = $findit ['License_Num']; $userfirst = $findit ['FirstName']; $userlast = $findit ['LastName']; $useremail = $findit ['Email']; echo $userfirst; ?> Thanks in advance!
  16. Yep, that makes sense....probably should have thought of that. Thank you! You were a ton of help!
  17. Sorry, one thing I didn't see right. Your code(s) work fine so long as $final3 doesn't end the string, where there is no comma. Reversing ."," to the front of $final3, of course, works fine unless $final3 occurs at the beginning of the string. Any ideas? <?php $final3 = 'R07'; $revokedrow = 'R11,S12,S13,A05,R07,A07,A10,S03'; $newrow = str_replace($final3.",", "", $revokedrow); ?>
  18. Thanks! both worked. 2nd one seems simpler. Is there something else to consider in using mattal's instead of flyhoney's? Something I may not be seeing? Really appreciate the help.
  19. Hello again! Not sure I'm even going about this in the right way. Trying to delete characters from a string. String could be any length, characters could be anywhere, characters will always be 3 digits, followed by a comma. My code deletes everything following the variable, but I only want the variable $final3 deleted. <?php $final3 = 'R07'; $revokedrow = 'R11,S12,S13,A05,R07,A07,A10,S03'; $start = strpos($revokedrow, $final3); $newrevoked = substr_replace($revokedrow, '', $start, $start+2); echo "this is the new revoked line: $newrevoked<br>"; //getting R11,S12,S13,A05, instead of what I want, which is R11,S12,S13,A05,A07,A10,S03 ?> Any help is, as always, greatly appreciated!
  20. Beautiful! (and yes, I missed your update, sorry 'bout that) Works like a champ. Thanks a ton!
  21. It's always just one letter followed by two numbers. The first code you gave me does work for the 09, 29, etc., issue. However, it also changes S07 into S8 instead of what I need, which would be S08. I always need it to be three digits. Further thoughts?
  22. I have a three digit alphanumeric value that I'm adding 1 to, for instance S07. My code works fine for all situations except 09, 19, 29, etc. For instance, S09 becomes S010 instead of what I want, which is S10, S19 becomes S110 instead of S20, etc. Not sure what to do, and I also need to avoid S11 becoming S22, S22 becoming S33, etc. <?php //$res is S09 in this case $number = (int) $res[2]; $new_number = $number+1; $reso = substr_replace($res, $new_number, 2); //$reso becomes S010 instead of S10 ?> Really appreciate any help!
  23. hmm, looked at both those. Couldn't figure how to use them. in_array(search,array,type) where search specifies what to look for....could be anything. array_search seems to ask the same thing, meaning I pre-define what I'm searching for. Maybe I'm just misunderstanding, though.
  24. Hello. I'm trying to echo a single value from an array. Below displays all within a while loop, but what if I only want to display, say, the fourth value of the array? Sorry, this seems so simple, but I just can't seem to find the right answer anywhere. <?php $scoquery = mysql_query ("SELECT FirstName, LastName FROM customer_details WHERE License_Num like '3RF6%' "); while ($scoarray = mysql_fetch_array($scoquery)){ $scofirst = $scoarray['FirstName']; $scolast = $scoarray['LastName']; $scolics = $scofirst." ".$scolast; echo "$scolics<br><br>"; } ?> Always appreciate the help!
×
×
  • 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.