-
Posts
462 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Posts posted by Mudsaf
-
-
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]
-
Im trying to make "check server status" that updates every 5 seconds whitout refreshing the page or pressing "refresh" button/text (So it would be automated). Got server status script done already.
-
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(); }
-
Well solved, me idiot had wrong folder name "security" that was "%%_security"
-
Well i added this and echo $_FILES['png']["error"]; result was 0
-
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!";
-
Well how i would get this work with 1 page?
-
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!";}}
-
Thanks, workingsorry, i misunderstood the problem.try it${"c$num"}
-
This pastes only number aswell :/single quote wont evaluate value. double quote willif($_GET['code']=="{$c}{$number}")
-
Tried to echo $$c.$number;Pasted following text c3Like this or not<?PHP//test filename.php?code=3$number = rand(0, 5);$c='c';if ($_GET['code'] == $$c.$number){echo "The code was correct.";} else {echo "The code was wrong";}//echo '<br/>'.$$c.$number;?>
-
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.
-
Thanks man ur god to me!
-
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);
-
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.
-
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)
-
Ill check thanks for information!
-
but if i use positioning it goes out of div?
-
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?
-
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>
-
Actually made fix to it by sending footer inside div, but still having problem that i cannot margin bottom footer.
-
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"
-
dnno whats wrong but htmlentities fix this always O_O
-
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
Problems with } & {
in PHP
Posted · Edited by Mudsaf
well how i get this work in this order? any way?
HAD [1-2] numbers at wrong spot. Need still solution.