Jump to content

phpnoobie9

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Everything posted by phpnoobie9

  1. I have a bunch of if statements that I want to echo a form inside...how can I do it I seem to keep getting blanks. if () { if () { } if () { } if all the ifs are true echo the form here?? } else { echo 'error'; }
  2. My admin directory had a htaccess with htpasswd and was working fine. I then add the openx directory inside my admin directory and now when I view any part of my website the htaccess password prompt pops up. I just keep pressing cancel and it goes away without inserting any username or password. Openxdotorg Any clue?
  3. Got it...missed the name on $_FILES. Thanks for looking.
  4. I'm trying to get image2 to have the same name as the first image but be placed in a different directory. I can get the first image to upload and have the name be md5 randomly, but can't get the second image to upload. //Directory paths $absolutepath = ABSOLUTE_PATH; $absolutepath2 = ABSOLUTE_PATH2; echo "Main 150x150 screenshot path: ".$absolutepath."<br /> Secondary 200x200 screenshot path: ".$absolutepath2; //Start image upload //Check for an image $newname = md5(time()*rand(1,99999).$_FILES['image']['name']); $newname2 = $newname.'.jpg'; if (move_uploaded_file ($_FILES['image']['tmp_name'], ABSOLUTE_PATH."$newname2")) { echo '<p>Image uploaded</p>'; } else { echo '<p>Problem uploading image</p>'; } //Check for image2 if (move_uploaded_file ($_FILES['image']['tmp_name'], ABSOLUTE_PATH2."$newname2")) { echo '<p>Image2 uploaded</p>'; } else { echo '<p>Problem uploading image2</p>'; }
  5. Got it...sorry. My varchar was set too low.
  6. My upload form was doing fine and all of a sudden it doesn't upload information to the database. The form still uploads my pictures, but it doesn't upload the information from the form to the database..?
  7. Anyone know a good picture sharing script, where people register and upload pictures and other people can comment it?
  8. Can't seem to get it to show $question in the form section after submission correct or wrong answer.
  9. Trying to make a simple captcha from simple math questions. Can't seem to echo $question in the form if I don't take the if (isset post submit) part out. If I do take out the isset and view the page I automatically get else echo 'Wrong' displayed, but if I fill in the correct answer it'll say yeah! like it should. Just wondering why it automatically shows else. I eventually want to add this to my form. <?php $captchaquery = "SELECT * FROM captcha ORDER BY RAND() LIMIT 1"; if (isset ($_POST['submit'])) { if ($captcharesult = mysql_query ($captchaquery)) { while ($captcharow = mysql_fetch_array ($captcharesult)) { $question = $captcharow['questions']; $answers = $captcharow['answers']; $answer = $_POST['answer']; } if ($answers == $answer) { echo 'Yeah'; } else { echo 'Wrong'; } } } ?> <form action="test.php" method="post"> <?php echo $question ?> <input type="text" name="answer" size="1" maxlength="2" /> <br /> <br /> <input type="submit" name="submit" value="Submit" /> </form>
  10. oh that's because I had an insert for the ip.. I'm wondering why it works if it is negate.... if i have a banned ip with !== 0 it does the if statement which should be done if it == 0... if i change it to just ==0 like you said it does the else statement which should be done if ip !==0 It works like I wanted to if I negate it, but looking at the code it should do the opposite..?
  11. Still doesn't seem to work. Escaping the remote_addr inserts a blank in the table.
  12. I have a table "banned" which has ips of banned ips. I don't want the banned ip to submit the form...but it doesn't seem to work. I just keep getting my else statement. Not all the code but this is pretty much what it looks like if (isset ($_POST['submit'])) { $ip = $_SERVER['REMOTE_ADDR']; $banquery = mysql_query("SELECT ip FROM banned"); if($ip !== $banquery) {//Check for banned ip not banned do this.... } else { if banned do this.. } }
  13. This is a server configuration issue not a phpMyAdmin configuration issue. I had the same issue with wamp2 on my computer and I changed it to blank and fixed it. It's not allowing the user to enter the phpmyadmin area.
  14. You have to go to wamp/apps/phpmyadmin2.10.1 and open config.inc.php look for: $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'password'; Change the root and password (your's may be different, but should be able to find it by just typing in 'user') to = '';
  15. I did tried the code BlueSkyIs posted, but it's counting everything in the description textarea. So if I have several words with a few characters..that adds up to 10 or more it'll echo else.
  16. So " " is equal to space what about ""? Isn't this telling space to replace $description? then...if $description is <= 20 do if.. Just need a little explaining so I'll understand the code. Thanks.
  17. So if I use strlen($description) won't that count every character in $description including space? My goal is to not let the form submit if a there was a word found that has more than 20 characters without a space. and use str_replace() for the spaces. EDIT: beat me to it I don't want to replace the word.. I want to echo the else which will say something along the lines of error.
  18. Install this on your computer: www.wampserver.com
  19. Is this correct...it seems like I just keep getting my else statement when I insert in words into a form. $longtext should check for words that are longer that 20 characters without any space from the description which is the textarea of the form. $description is the textarea name on the form. $longtext = preg_match('/^\S{20,}$/', $description); if($description != $longtext) { if word is not longer than 20 characters do this else { if a word has more than 20 characters without any blank space do this }
  20. Where will I start if I want to make a script that deletes images in a certain directory older than x amount of time...as far as using a function?
  21. I have a form for people to submit images. Is it possible to select a directory and delete images after x amount of time?
  22. Am I able to disable form submition if the user inserts a certain amount of characters without a space? Like some kind of ereg?
  23. I forgot to add. When the user submits the data it shows on a different page. So..if a user just keeps doing this..llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll it'll stretch the page. How do I stop that?
×
×
  • 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.