Jump to content

compguru910

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by compguru910

  1. You have to edit your php.ini file, there is a setting in there like MAX_UPLOAD or something along those lines that has to be overridden to get uploads larger than 8mb.
  2. Can you post up here your table layout in your MySQL database? Check it for typos. And should USERS be capitalized? Its generally good practice for your table names to be lowercased because SQL syntax is generally capitalized so its easy to distinguish between Syntax and values.
  3. Hello, im a php programmer that hasnt programmed in a few years, and I need a refresher. Im putting a WYSIWYG editor on my website, and when I post the html, I know I need to strip the slashes from the content, but I also need to add slashes for the content when it goes to display. I saw that in the PHP manual the magic_quotes has been depricated as of 5.3, so im wondering what is the best way to do this? Thanks in advance for the help.
  4. That was the issue that I didnt have == as opposed to =. Somehow the bot made it past that, when I couldnt. The sessions are working fine (I know sessions pretty well, and I did put in the code at the end of the page <? print $_Session['check'] ?> to make sure that the session was being set. The problem seems to be solved now as I have added the = sign, and in the send function for the email, I made it check to make sure that 'check' form was not blank. No more spam emails, good thing cause that was getting obnoxious. Thanks for the help guys
  5. Ok, I have specifically checked to make sure the session has a value. If you go to the page I posted, and try to submit without the captcha in there (hence NULL) then it comes back saying the captcha hasnt been inserted and wont go through. I dont check to see if the field is left empty, I simply check to see if the captcha matches the session value. So, in order to submit this page, CAPTCHA has to be filled out. The bot is getting past that without putting anything in there when my code specifically checks to see if the session has been filled. If you dont believe me, get in firefox, and change the settings so that when a new cookie is created, to notify you. When you go to that page, it will notify you that a new cookie is being created (because most sessions are stored in cookies). The issue is not the bot cracking the captcha, or even the fact that the session is empty, hes getting past without even messing with that, and im just confused on how.
  6. The thing is, its not even going through the captcha. The captcha field on the page is not even being posted.
  7. In the header of the page (not included there) I have session_start(); and ob_start(); . The captcha works, I cant get past it, somehow this bot is without entering a captcha at all. The webs link is www.cookshackbarbq.com/contact.php
  8. Hello, im having a weird issue with this captcha script that I learned from a tutorial. It seems like this ia problem that is very slight and im overlooking it. So, to test, I made it submit the actual CAPTCHA text when it sends the form, and everytime its submitted its blank. So, this bot is spamming my page without putting in the CAPTCHA. Can anyone look at the code and possibly tell me why? and how <form name="form1" method="post" action="contact.php"> <div align="justify"> <p><span style="font-weight: bold; font-size: 16px; color: #000000">Email Address:</span><br /> <input type="text" name="email" id="email"> <br> <span style="font-size: 16px; color: #000000; font-weight: bold">Comments</span> <br> <textarea name="comments" id="comments" cols="45" rows="5"></textarea> </p> <p>Captcha (Stop Spamming Bots)<br /> <img src="captcha.php" /> <input name="check" type="text" id="textfield" size="15" /> </p> <p> <input type="submit" name="submit" id="submit" value="Talk To Us!"> </p> </div> </form> <p style="font-size: 18px; color: #CCCCCC"></p> <? if (isset($_POST['submit'])) { //Checks to see if th CAPTCHA validated, if it does, then proceed with validating forms if ($_POST['check'] == ($_SESSION['check'] / ) { // Lets the user know if the email and comments have been filled out $captcha_correct = TRUE; if (empty($_POST['email'])) { print 'You have not entered your email address'; } if (empty($_POST['comments'])) { print 'You have not entered any comments'; } // If the email and comments section have been filled out then proceed with SQL // This section adds the comments into the comments database for records if ($_POST['email'] && $_POST['comments'] && $captcha_correct = TRUE) { $dbc = mysql_connect('localhost','breadcorn','wat1964') ; mysql_select_db('cookshack'); $query = "INSERT INTO comments (date, comment, email) VALUES (NOW(), '{$_POST['comments']}','{$_POST['email']}');"; // If the query ran fine, then print thank you if (@mysql_query($query) ) { print "<p align=\"left\" style=\" font-family: Verdana, Arial, Helvetica, sans-serif\">Thank you for your comments</p>"; //Set up the format so that the comment can be emailed $date = date('g:i a l F j Y'); $body = "Comment Sent By $email at $date\nComment: $comments\n '{$_POST['check']}'"; mail('[email protected]','Comments',$body); mail('[email protected]','Comment',$body); $query = "INSERT INTO mailinglist VALUES ('{$_POST['email']}');"; @mysql_query($query); //If the query fails on the first query, then display why } else { print '<p>The comment could not be added because: ' . mysql_error() . '</p>'; } //Check to see if the email is already in the database, if not, add it include('includes/dbconnect.php'); $query = "SELECT email FROM phplist_user_user WHERE (email = '{$_POST['email']}');"; $returned = mysql_query($query); if (mysql_num_rows($returned) > 0 ) { print "<p align=\"left\" style=\"color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif\"></p>"; } else { $uniqid = md5($_POST['email']); $query = "INSERT INTO phplist_user_user (id, email, confirmed, blacklisted, bouncecount, uniqid, htmlemail) VALUES (0, '{$_POST['email']}', '1', '0', '0', '$uniqid', '1');"; if (mysql_query($query)) { $query = "SELECT id FROM phplist_user_user WHERE (email = '{$_POST['email']}') LIMIT 1;"; $returned = mysql_query($query); $id = mysql_fetch_array($returned); $query2 = "INSERT INTO phplist_listuser (userid,listid,entered) VALUES ('$id[0]','2',NOW());"; $returned = mysql_query($query2); } } } } else { print "The CAPTCHA you have entered is incorrect, please try again"; } } Here is the captcha.php code. <?php session_start(); //imagecreatefrompng :: create a new image //from file or URL $img = imagecreatefrompng('black.png'); //displaying the random text on the captcha $numero = rand(100, 999); $_SESSION['check'] = ($numero * ; //The function imagecolorallocate creates a //color using RGB (red,green,blue) format. $white = imagecolorallocate($img, 255, 255, 255); imagestring($img, 10, 8, 3, $numero, $white); header ("Content-type: image/png"); imagepng($img); ?> So, the number that is generated by the captcha is multiplied by 8 and stored in the session, then divided by 8 on the page. Its still getting past it. Im stumped...
  9. You are on the right track, but I do not see where you added the $next_page variable. You might want to try that.
  10. No, its possible to insert two different statements into one table, but you cannot insert into two different tables at the same time.
  11. Your code is very hard to read, so its hard to inerpuret the flow. Even the lack of detail in your explanation of the problem is not helping. What I gathered from what you said is, your searching for states by member ID, then searching for counties in that state, ok. What seams to be the problem. Or, give an example of the step by step of your code so that we can think about how we would write it out and address your problem that way. Dont just give 4 lines of text for a problem your having with an obviously complex script, especially when it comes to mysql
  12. To make your life a little easier make a variable everytime the pag is called like this $next_page = $_GET['thispage']++; This will give your next page index so that you can make this for the next page link <a href=\"page.php?page={$next_page}\">
  13. group by is a mySQL function. I cant really explain it in detail because I never use it as I preffer to do it your way, but if you google mySQL group by, it will bring up a tutorial
  14. With the include function, if the file cannot be loaded for whatever reason, the page will continue to load as well as the script. The include once will include the file (if it can be found, and only ran once [incase of functions]). Require, is pretty much self explanatory. With the require function, if the file cannot be loaded, the page will cease to write, and you will get an error. Hope this helps.
  15. The ob_Start and ob_end_flush are object bufferes, meaning it gives you the ability to set and unset session variables after headers have been sent. The ob_start() and ob_end_flush() are not affecting your code negatively, they are doing what they are supposed to do.
  16. Thanks, I figured it would be something simple along those lines. Anyone have any suggestions for the image type problem I am running into?
  17. There is a way that if you could put some kind of braces around the words you wanted to use, then you could extract it with a string function. I do not know off hand what it is, but if you look up PHP string in google, it will take to you the PHP guide, and they will have soemthing on it there.
  18. Ok, im having a slight problem. This is probably something really simple that I am overlooking, but bare with me. I have made a web app that a bodyshop is going to use to manage their customers vehicles. Well, its all working great until this. When you add a new vehicle to the website, it makes directories to keep the pictures seperated so that customers and insurance companies can download them, that all works (except for a little part thats kinda odd). So, the problem arises when you try to add a vehicle a second time for a second incident. Now, it still works, but I can see it would become a nuisance later. Since the folder has already been created for that license plate number (thats how the vehicles are tracked) it gives me an error, but all the other folders inside of that one (if they dont exist already) are created fine. This is the heirarchy of the folders License plate Make-Model-Year Incident Title So, if I try to add the vehicle again for another incident, it pops up an error saying directory already exists. Now, how do I keep that from happening. I know I should probably call a script to see if the directory exists, but I dont know the syntax. Secondly, I made it so that you dont have to track the images for the cars with a database by using this folder system. Pretty cool. It also assigns each image with its own unique name (timestamp). Well, this is all good until it comes down to determining the file type. Here is my code for that $file_type = $_FILES['pic']['type']; if ($file_type == "image/png") { $file_ext = ".png"; } elseif ($file_type == "image/jpeg") { $file_ext = ".jpg"; } elseif ($file_type == "image/gif") { $file_ext = ".gif"; } elseif ($file_type == "image/bmp") { $file_ext = ".bmp"; } else { print "File Type Not Supported"; exit(); } This works fine, most of the time. But I noticed that if I do it from different computers than mine it doesnt work sometimes, other times it will. Can anyone suggest a better, more error free way of detecting the file type? Thanks in advance.
  19. Did you loose your form tags? Is your submit button named correctly so that you can check to see if it has posted? Did you change the username/password to your database? Its normally the really simple stuff
  20. What you would want to to is create a table in PHPmyAdmin, that has something like id, page_name, title for the rows. Then, you would want to run a query that searches for only that page name, like this (mind the shorthand) <? //Code to connect to database here $query = "SELECT title FROM table WHERE page_name = '{$_SERVER['self']}';"; $returned = mysql_query($query); $rows = mysql_fetch_array($returned) print "<title>{$rows[0]}</title>"; mysql_close(); ?> Thats the gist of it. Hope it helps. Hope someone else that reads this gets what I wrote that that they can help him if mine doesnt
  21. I dont know what the exact line in the php.ini file is that restricts that as I have never had that problem, but you want to add to the header of the page that your trying to do that on (this means before and HTML is printed) set_ini(0,0); Replace the 0's with whatever settings need to be changed. And remember, the set_ini has to be called before any other code except for PHP. Always do at the top of your page. I believe the code that you would want to change is post_max_size so the code would be set_ini('post_max_size','24M'); That should fix your problem
  22. Try echo "<table id=\"board\">";
  23. If your new to coding in PHP, I would recommend staying away from MIME mail for a while, and stick with the regular mail() function until you get the hang of coding. You code doesnt seem to be structured very well either. Just a heads up. If you need some tips on how to do the regular mail(), let me know. Be glad to help
  24. Tahnk you, I will give that one a try.
×
×
  • 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.