Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. please post the code you already have along with whatever errors you're getting.
  2. We cannot guess what's wrong without seeing what you've done. please post your code.
  3. you didn't add login=yes, your script only runs based on this condition: if($login == "yes"){
  4. because your script expects two POSTed variables and one from the url ($_GET): $username = trim($_POST["user"]); $password = trim($_POST["pass"]); $login = trim($_GET["login"]); to test, just use: $username = 'Admin'; $password = 'oliver'; $login = 'yes';
  5. missing semicolon after: echo "Login Successful" should be: echo "Login Successful";
  6. see? first typo: session_start should be session_start();
  7. typing it is not a good idea... it will be very easy for you to get a typo.
  8. then switch the array around.. instead of: $ent = array( 'Ć'=>'Ć', do this: $ent = array( 'Ć'=>'Ć',
  9. try this: <?php session_start(); $username = trim($_POST["user"]); $password = trim($_POST["pass"]); $login = trim($_GET["login"]); setcookie("username","$username",time()+86400); if($login == "yes"){ $con = mysql_connect("localhost","root","arceye") or die('Cannot connect to server...'); mysql_select_db("login",$con) or die('Cannot select that database...'); $get = mysql_query("SELECT count(`id`) as total FROM `login` WHERE `user`='$username' and `pass`='$password'",$con) or die(mysql_error()); $res = mysql_fetch_assoc($get); @mysql_close($con); $result = $res['total']; if($result !=1 ){ echo "Invalid Username Or Password"; exit(); }else{ echo "Login Successful" $_SESSION["username"] = $username; } } ?>
  10. That code gives me the following output: ĆćČčĐ𩹮ž (printed on screen) &#262;&#263;&#268;&#269;&#272&#273&#352&#353&#381&#382 (source view) So it seems its working. your problem must be somewhere else.
  11. should be something like: $data = array_slice(file('data.txt'), 0, -5, true));
  12. check your logs and post the error here please.
  13. if you know how to get the last five lines, do the reverse, get all the lines except the last five, and write the whole thing to the file (replacing all content)
  14. This should work. (Because I'm combining two types of quotes, there's no need to escape the double quotes here) <?php echo '<a href="'.$r['feedusername'].'"><img src="'.getUserAvatar($r['feedusername']).'" class="avatar mediumsmall newspadding f_left mrl" title="'.$r['associate_name'].'" alt="'.$r['associate_name'].'" /></a>'; ?>
  15. Something like this? preg_match_all('/\<div id=web\>(.*?)\<\/div\>/is', $page, $matches); where $page contains the whole page's code. $matches will be created as an array containing the results. (not sure if you also need to escape the = sign).
  16. date("W"); will return the week's number. Since your page is based on weeks, it could make sense to store the week along with the meeting date. You could run a script, to check the week number of each meeting date: $weekNr = date("W",strtotime($meetingDate)); and add a WeekNr field to your database to store the returned values, then slightly change you original script to also include the week number when inserting new meetings. That way all you'll need to do in the future is something like: select * from `table_name` where `weekNr` = '$week' (weekNr should be defined as an index, so speed up searches)
  17. what is the objective of this? $text = $_POST["post_desc"]; $text = stripslashes($text); $text = stripslashes($text); $text = stripslashes($text); $text = stripslashes($text); $text = stripslashes($text);
  18. this line if(!isset($_POST["post_desc"]) || $_POST["post_desc"] = ""){ should be if(!isset($_POST["post_desc"]) || $_POST["post_desc"] == ""){ (two equal signs) * I didn't check the rest, since this was the first bug I found and may solve your problem.
  19. there's yet another option, which is a variation of one of the previous. As the182guy said: you could do this, but call a script on the server and send it the url of where the file resides at the moment. This way, when users visit you site, they will see ALL uploads available, even though some of them have not yet been moved to the server, they can still be downloaded. then when the cron job finally executes, you also change the url to the appropriate path.
  20. Just a comment: "page 10 after 1 click"? I would expect page 2. You seem to be counting articles/posts and not pages, but even then, if you display 10 at each time, then the next page would start with article 11, and not 10... Having the correct page number in the url is sometimes useful for users to jump between pages just by changing the number (I know I do that a lot on other sites). Having page 10, 20, 30, 40 will mislead the user into thinking there are a lot of pages in between that he's not seeing. Also, if you mean 'article' instead of page, you should probably rename your variables so that they make sense.
  21. had to look that up... Advanced Dungeons and Dragons? lol. Nope, never played it. Man I'm from the days of the spectrum, I used to play Chuckie Egg and Manic Miner... No dice involved, just mad skills!
  22. Once again: I cannot tell you if you'll need to join two tables or not without seeing your database structure. If your structure is properly built, you might have a table dedicated to file uploads, and in that case all you need is something like: select `fileId`,`filePath`,`fileDescription` from `uploads` where `userId` = $_SESSION['userId']
  23. that is your html code, I asked for the code that stores files, so I can see the database field names.
  24. it's the same thing... imagine everything inside the () is an echo.
×
×
  • 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.