Jump to content

phpnoobie9

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpnoobie9's Achievements

Member

Member (2/5)

0

Reputation

  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 = '';
×
×
  • 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.