Jump to content

Mudsaf

Members
  • Posts

    462
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Mudsaf

  1. well how i get this work in this order? any way?

    if ($_SESSION['loginattempt'] > 5) { [1] IF TRIES > 5 CHECKS SECURITY CODECHECK IF THE ROW2 IS CORRECT ELSE SAYS WRONG CODE   if ($rows_check2 == 1) { [2] <-- CHECKS CODE							  } else { [1] <-- SESSION Loginattempt <= 5 LOGIN SCRIPT HERE --- } [1] <-- CLOSES LOGIN SCRIPT } else { [2] <-- CODE = WRONGecho "<p id='red'>Security code was invalid. Try <a href='login.php'>again</a>!</p>"; } [2] <-- CLOSES CODE CHECK

    HAD [1-2] numbers at wrong spot. Need still solution.

  2. Hello again, today im facing this problem.

    if ($_SESSION['loginattempt'] > 5) { <-- THIS IS [1]//REMOVED CODES HERE   if ($rows_check2 == 1) { [2]							  } else { <-- THIS SHOULD CONTINUE [1], BUT CONTINUES[2] //REMOVED CODES HERE} else { <-- THIS SHOULD CONTINUE [2] //REMOVED CODES HERE} <-- ENDS [2]} <-- ENDS [1]

  3. Hello, im trying to make counter that takes 5 seconds and after that runs if script and restarts. so the IF content would be refreshed for every 5 seconds whitout refreshing the webpage. Tried something like this but wont work

    if ($start_time > 5) {$start_time = 0;} else {$start_time = microtime();  }

  4. echo "<center><form name='form9' enctype='multipart/form-data' method='POST' action='" . $_SERVER['PHP_SELF'] . "'>  <label for='png'>Image:</label>  <input type='file' name='png' id='png'>  <input type='submit' name='upimage' id='upimage' value='Upload image'></form></center>";if (isset($_POST['upimage'])) {$target_path = "../security/img/";$target_path = $target_path . basename( $_FILES['png']['name']);if(move_uploaded_file($_FILES['png']['tmp_name'], $target_path)) {    echo "The file ".  basename( $_FILES['png']['name']).    " has been uploaded";} else{echo "There was an error uploading the file, please try again!";}}

    Getting message "There was an error uploading the file, please try again!";

  5. Hello, im wondering how to create php page that can upload all the information with 1 page only. I tried to search at internet but could not find straight answer to my problem. Here is my code so far.

    echo "<center><form name='form9' enctype='multipart/form-data' method='GET' action='" . $_SERVER['PHP_SELF'] . "'>  <label for='png'>Image:</label>  <input type='file' name='png' id='png'>  <input type='submit' name='upimage' id='upimage' value='Upload image'></form></center>"; if (isset($_GET['upimage'])) {$target_path = "../security/img/";$target_path = $target_path . basename( $_FILES['png']['name']);if(move_uploaded_file($_FILES['png']['tmp_name'], $target_path)) {	echo "The file ".  basename( $_FILES['png']['name']).	" has been uploaded";} else{echo "There was an error uploading the file, please try again!";}}

  6. Hello, now im trying to make this code working.

     $number =  rand(0, 5); if ($_GET['code'] == '$c' . $number) {echo "The code was correct.";} else {echo "The code was wrong";}

    So the code below only pastes it as text so it doesn't really use the variable what comes example $c1.

    echo '$c' . $number;

    so i got variables like these.

    $c1 = 12361 $c2 = 26323

    and i wan it go check if get code == $c + number.

  7. Yes but im wondering how i get the statement to be only true when the correct "Remove" button is pressed. It says this if i add it before / after code.

    while ($row2 = mysql_fetch_array($result2)) {echo "Published: " . $row2['PostDate'];if ($_SESSION['AccountID']==$_GET['id']) {$statusid = $row2['StatusID'];}echo " | ";echo "<a href='" . $_SERVER['PHP_SELF'] . "?id=" . $_GET['id'] . "&remove" . $row2['StatusID'] . "'>Remove post</a>";$value1 = $_GET['remove'] . $row2['StatusID'];if (isset($value1)) {$query3 = "DELETE FROM status WHERE OwnerID='{$_SESSION['AccountID']}' AND StatusID='{$row2['StatusID']}'";$result3 = mysql_query($query3);

  8. Okay now my problem is that im trying to make "LINK" that does the GET method that i can use by isset.

    while ($row2 = mysql_fetch_array($result2)) {echo "Published: " . $row2['PostDate'];if ($_SESSION['AccountID']==$_GET['id']) {$statusid = $row2['StatusID'];$value1 = $_GET['remove'] . $row2['StatusID'];if (isset($value1)) {$query3 = "DELETE FROM status WHERE OwnerID='{$_SESSION['AccountID']}' AND StatusID='{$row2['StatusID']}'";$result3 = mysql_query($query3);}echo " | ";echo "<a href='" . $_SERVER['PHP_SELF'] . "?id=" . $_GET['id'] . "&remove" . $row2['StatusID'] . "'>Remove post</a>";

    So that function deletes every single status updates since in while. If out while the $row2['statusid'] will be blank in query.

  9. Im trying to make page that allows to see "comments" 5 at time and if you press next it shows next 5 comments and previous shows previous 5 comments. My code is only working 1 time per way so i get like next 5 comments (this only works once) and previous 5 comments (this only works once).

    $val1 = 0;$val2 = 5; if (isset($_GET['next'])) {$val1 = $val1 + 5;}if (isset($_GET['previous'])) {if ($val1 >= 5) {$val1 = $val1 - 5;} }$query = "SELECT * FROM *TABLE* WHERE *COLUMN* = '{$_GET['id']}' ORDER BY *COLUMN* DESC LIMIT " . $val1 . ", " . $val2; while ($row2 = mysql_fetch_array($result2)) {echo "Published: " . $row2['*COLUMN'];echo "<textarea name=\"text\" cols=\"70\" rows=\"5\" readonly id=\"text\">" . $row2['*COLUMN*t'] . "</textarea>";}  

    So im wondering is it possible to get that working the way i want. (I dont want to use POST method to get another page)

  10. Could some of you tell me the basic protection that PHP & MySQL website needs. For example new stuff to me was SQL injection. Q: How to prevent website from SQL injection?Q: What other protection websites require than SQL injection protect? I know that the password should be crypted but somehow i think its not enough or is it?

  11. Okay im having this problem on my footer that it wont stick bottom of the div element. So im having code like above. So in style css i have tried everything in footer

     footer {bottom:0px; <-- Doesnt workmargin-bottom:0px; <-- Doesnt work}<div><footer>Copyright YEAR ...</footer></div>

  12. Well im having this problem on IE when my div closes and after that starts footer there is space like | | and when mozilla firefox there is no space after div and footer. So end of code goes like this

    </div><footer>© <?php echo $currentyear . " " . $websitename; ?> | Frequently asked questions | Terms of Agreement & Rules | Contact us</footer>

    Works like charm on mozilla but annoying space on ie or Chrome I could get quote from some1 that said "My code works in all decent browsers, ofcourse this means it won't work on IE"

  13. I got this textarea it works when i paste chars asdsakopöosatfsjoqtqpw but it gives error on result when there is öäå Error result

    Incorrect string value: '\xE4as\xF6da...' for column 'Teksti' at row 1

×
×
  • Create New...