Jump to content

Mudsaf

Members
  • Posts

    462
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mudsaf

  1. Misunderstood the problem, my bad.
  2. Thankyou, .htaccess file fixed the problem and thanks for other hints too.
  3. Hello, im not sure should i add this to "SQL" category since this is bit more sql-related but any fix to this. I have timestamp field in my database and it has worder ORDER BY Desc so far from oldest to newest and now at 2013 it doesn't work like that. SELECT * FROM ms_news ORDER BY newsDate DESC LIMIT 0, 1 Last 2 values Code displays this 2013-01-03 01:48:05 Should display this 2013-01-04 01:03:53 At year 2012 it worked from oldest to newest so im not sure does the 2013 year mess the desc somehow. Blargh fixed, had taken the value from Date and not Datetime
  4. Hello everybody, so im wondering how to make "Download" that is secured and users cannot go just with direct link like /downloads/file1.rar. I'd like that no SQL-storing would be there.
  5. Mudsaf

    Type safety in PHP

    I would do the survey but it takes about 30s to load page after each question.
  6. Hello, Im just wondering does it strain website server if i check if port is open and server is running. So basically i have 1 php page that is has selection for example "Sitefriends" and then when user refreshes the webpage check if the website port is open and server is up (This is because my sitefriend server isn't on always) and im wondering does it make their server slower or something if test their port openings?
  7. Alright, thanks because the latest way would be best choice for me. Because if i would do the other way anyone could just try connecting with my account and neither i or anyone else could try to login to my account.
  8. OH CMON IE, now i added link there and the box goed like from [ ] to 50x that... SRSLY IE! Now having 2 problems with ie.1st as i mentioned on first post What it looks in IE (Only IE problem)HomeInfoForumsDownloads What it should look in IE (Only IE problem) Home Info Forums Downloads 2nd IE messes the news box the width is about 100% for no reason (should be automated depending text length). Note: This works perfectly on Google Chrome browser. Problem fixed by hating ie <![if !IE]>//If browser is not IE//Script here<![endif]>
  9. Thank you for your reply it was helpful for me , but i'm still wondering if brute-force attacks are possible to prevent with ip-adress blocking & not account blocking?
  10. Note: Position:relative kind of doesn't work + Ie adds random space after something so it will be like this HomeInfoGames In Google chrome Home Info Games So i want the "Home, Info & Games" to stay in their position when im revealing the code under it and remove the random enter space that internet explorer gives. Css file * {margin:0;}.info, .home, .games {text-decoration:none; margin:0; list-style-image:none; list-style:none; list-style-type:none; font-weight:bold; font-size:14px; display:block;}#naviCont {margin:0;padding:0;display:inline-block; } .naviHome, .naviInfo, .naviGames {vertical-align:text-top;font-size:18px;font-weight:bold;display:inline-block;margin-top:0px; } Html code <div id="naviCont"><ul class="naviHome">Home<li class="home">This is not homepage</li><li class="home">Neither is this</li></ul></div> <div id="naviCont"><ul class="naviInfo">Info<li class="info">Introduce</li><li class="info">Server machine</li><li class="info">Sitefriends</li></ul></div><div id="naviCont"><ul class="naviGames">Games<li class="games">Top-Games</li><li class="games">Most-Views</li><li class="games">Search games</li><li class="games">Download games</li></ul></div> Fixed the positions by myself, but there is still space in IE.
  11. Working > Coding > Learning

  12. Hello, im wondering can i prevent brute-force attacks from my webpage example creating this. This should work if the user doesn't close and re-open the page after attempts are out, but i have no idea how brute-force does it. Login page <?php session_start();if(isset($_SESSION['login_attempt']) && $_SESSION['login_attempt'] < 6) {} else {//Form here}?> Login confirm page <?phpsession_start();if (isset($_SESSION['Rights']) && $_SESSION['login_attempt'] < 6) {header("Location: index.php");} elseif (isset($_POST['password']) && isset($_POST['username']) && $_SESSION['login_attempt'] < 6) {//LOGIN SCRIPT HERE} elseif ($rows > 0) { //user has logged in correctly//FEW SESSIONS TO STORE DATA} else { if (!isset($_SESSION['login_attempt'])) {$_SESSION['login_attempt'] = 1;} else {$_SESSION['login_attempt'] = $_SESSION['login_attempt'] + 1;}if ($_SESSION['login_attempt'] < 6) {echo (5 - $_SESSION['login_attempt']) . " attempts left";}}}?> Read more about brute-force here http://en.wikipedia.org/wiki/Brute-force_attack Read more about SQL-injections here (This prevention is MUST-have to SQL-based webpage) http://en.wikipedia.org/wiki/SQL_injection
  13. ö in another page and ö in another. The both pages are UTF-8 and data comes from same query.
  14. Hello, im wondering how to re-name or add example 1064 after the uploaded_filename. Does it work like $_FILES['file']['name' + 1935]?
  15. Yea you're right, i though the server php maxfilesize was 5mb but it was only 2mb, thx anyways.
  16. Hello, i have problem with my website upload system. Example if i upload game through the php This game success http://www.mochimedia.com/games/play/boat-racing-challenge But this game fails http://www.mochimedia.com/games/play/magnet-ninja Here is my form code <p> <label> <input type="radio" name="Upload" value="radbo" checked="checked" id="Upload_0" /> Upload files and do query (Not working untill beta 0.3)</label> <br /> <label> <input type="radio" name="Upload" value="radqu" id="Upload_1" /> Do query only (Not working untill beta 0.3)</label> <br /> <label> <input type="radio" name="Upload" value="radup" id="Upload_2" /> Upload files only (Not working untill beta 0.3)</label> <br /> </p> if (isset($_POST["Upload"]) && $_POST["Upload"] == "radup") { $target_path_img = "../games/img/";$target_path_swf = "../games/swf/";$mysql_path_img = "img/" . $_FILES['imagefile']['name'];$mysql_path_swf = "swf/" . $_FILES['flashfile']['name'];if (!empty($_FILES["imagefile"]) && ($_FILES['imagefile']['error'] == 0) && !empty($_FILES["flashfile"]) && ($_FILES['flashfile']['error'] == 0)) {if ($_FILES["flashfile"]["size"] <= 5000000 && $_FILES["imagefile"]["size"] <= 3000000) {if ($_FILES["flashfile"]["type"] == 'application/x-shockwave-flash' && $_FILES["imagefile"]["type"] == 'image/jpeg') {if(move_uploaded_file($_FILES['imagefile']['tmp_name'], $target_path_img . $_FILES['imagefile']['name']) && move_uploaded_file($_FILES['flashfile']['tmp_name'], $target_path_swf . $_FILES['flashfile']['name'])) {echo "<p>You have sussefully uploaded the 2 files.</p>";} else{echo "There was an error uploading the files, please try again!";}} else {echo "<p>You tried to upload files with wrong fileformat, only (.JPG) allowed on image field and (.SWF) allowed on flash file field.</p>";}} else {echo "The filesize you tried to upload was too big";}} else {echo $_FILES['imagefile']['error'] . $_FILES['flashfile']['error'];}} else { //This comes with MAGNET AND NOT WITH BOATecho "<p>No radio button selections detected, please go back and confirm that you have selected some radio button.</p>";echo $_POST["Upload"]; //This returns as empty} With boat racing the code success
  17. Thankyou it was magic_quote_gpc that was enabled & fixed now.
  18. What is best way to protect data from html form to database and still preventing mysql injections. So far i've used mysql_real_escape_string(); but it adds \ to every '.
  19. Thankyou birbal, worked perfectly.
  20. Example i have data in database, i just want to display value from JOB (Not the same value twice) ID | JOB | NAME 1 | Engineer | OH LONG JOHNSON2 | Engineer | Peter3 | Cleaner | Katy So how i do query that takes only 1 times same job example 1 | Engineer | OH LONG JOHNSON3 | Cleaner | Katy :ifyouknowwhatimean: PS: This example have nothing to do with my database.
  21. Mudsaf

    FILE Display ERROR

    Thanks for reply, copyed ur form code + removed the double ID what was added 2 times (form_addgame) and somehow now it works
  22. Mudsaf

    FILE Display ERROR

    Hello everybody, i got form with 2x file upload fields. <form action='Proceed.php' method='post' enctype='multipart/form-data'> <label for='imagefile'>Image (.JPG):</label> <input id='form_addgame' type='file' name='imagefile' id='imagefile' /><input type="hidden" name="MAX_FILE_SIZE_IMG" value="3000000" /> <!-- 3000 KB --> <label for='flashfile'>Flash (.SWF):</label> <input id='form_addgame' type='file' name='flashfile' id='flashfile' /><input type="hidden" name="MAX_FILE_SIZE_SWF" value="5000000" /> <!-- 5000 KB --></form> When i proceed to confirmation page i get this error echo "Image file format: " . $_FILES['imagefile']['type']; //PASTES image/jpegecho "Flash file format: " . $_FILES['flashfile']['type']; //DOESNT PASTE ANYTHING Im not sure howto fix this problem O_o
  23. Mudsaf

    Problems with } & {

    Well ur right im kind a idiot, i can do the query if the loginattempt isnt even 5, fixed my problem
×
×
  • Create New...