Jump to content

c-o-d-e

Members
  • Posts

    127
  • Joined

  • Last visited

    Never

Everything posted by c-o-d-e

  1. What is your error, and what are you trying to do with the code.
  2. I know how I would set this up, and delete the user roughly. I'll create a table called "Users Status" with ID, Username, date registered, and last logged in collumns. Last Logged in will be recorded as years, and will be set on every page. I will then be checking in admin control panel, if the user has not been logged in since whatever year. Delete them. I was wondering if this is the best way to do it? or would there be an easier way. Thanks
  3. Remember what I said "= is" "== is equal to" Otherwords "username is equal to password" and "username is password" Slight difference, might help you remember Mark the topic as Solved. Which you find near the quick reply at the bottom. Glad we helped you
  4. If your trying to compare and check, you'd use "==" == is "Equal To" = is "Is" Thats how I learn with them. else if ($_SESSION['username'] = $username && $_SESSION['sid'] = session_id()) //Above code sets username as $username and session sid as session_id. //To compare if there correct.. use the above code to set the variables, though I wouldn't keep it there.. I'd move it to the top of the code .. in an non if place. Then do this else if ($username == session_id){ do whatever here if corect } else { do whatever here if incorrect }
  5. Ok, thanks for explaining I checked where the problem was in the website file which uses <? include 'mcommands.php' ?> Which mcommands was where it uses the style.css I changed it to <?php .. I couldn't believe this was the problem considering I found out this was a problem on another thread. Thanks for trying to help.
  6. I checked CSS Validator, and it comes up as: Congratulations! No Error Found. All the pages except CSS are found - C:\xampp\htdocs And for CSS - C:\xampp\htdocs\styles Exactly as it is on the production server - Which works I tried it as "/styles/style.css" which never worked either. Any other possibilities? What sensitivities are there in XAMPP. EG: <? and <?= aren't recognised in XAMPP. What about for div's who use a style sheet. If I have <div class="whatever" id="table"> And <div class="style" id="table"> Would that be overided?
  7. The problem is though.. I can access the CSS here.. http://localhost/styles/style.css It works on here too.. www.developers-community.com/styles/style.css
  8. I have two CSS Files needed for some pages <link href="styles/twoColLiqRtHdr.css" rel="stylesheet" type="text/css" /> <link href="styles/style.css" rel="stylesheet" type="text/css" /> twoColLiqRtHdr.css works fine, but style.css doesn't actually.. work. It looks like XAMPP can only use 1 css file. Any ideas?
  9. Well, I installed XAMPP as it is, I'm not sure if it comes with a Mail Server. I'll install one, where would I install it? in XAMPP htdocs (where my site files is) or where?
  10. Sorted the problem. Most of my tags were <?php Just the odd few I have not changed yet. Thank you.
  11. Parse error: syntax error, unexpected $end in C:\xampp\htdocs\resend.php on line 245 You can see the hosted page on.. http://www.developers-community.com/resend.php Yet on Localhost (XAMPP) I recieve the Parse error. Why does this happen? I've tried an extra "}" and taking a bracket away, and nothing helps, I've checked for open brackets, and none were open.
  12. I run the server on localhost, as its not on the net yet. (development server)
  13. I posted in origional post as Edit, the mail settings. How do I find out my default settings for it?
  14. I recieve this error on Localhost - XAMPP. Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\register.php on line 205 I would rather set the mailserver in php.ini Can you give me some help on what to do? EDIT: [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = no-reply@developers-community.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path ;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = Off ; Log all mail() calls including the full path of the script, line #, to address and headers ;mail.log = "C:\xampp\apache\logs\php_mail.log" This is in php.ini, by default.
  15. I know the difference between Production and Development. EG: If I made a notepad file = file.html Double click the file in my docs, it opens up with my files in the browser, this is what I mean. Dreamweaver is not connected to FTP, I use a seperate client for that. I often do the piece of code I need to do, upload it and check for errors that way. However, if I saved a file = file.php, double click it, it opens up but just prints the PHP as text. It doesn't recognise it. Which Is what I need the help with to get it to recognise PHP.
  16. I do my work on dreamweaver, and if I cannot find an error, and I dont get a display, I use notepad++ and check for syntax What would I use to test it live, if I use it as it is now, I dont have a php server for it, because it doesn't recognise PHP. I tried this. Can you provide a link to a cron script? I tried looking but I'm not sure what I'm looking for
  17. I understand. what would I use to do development on? Whats the best option.
  18. I dont use or die no more. Don't store password in cookies? I have a "Keep my logged in feature" which uses username, password and activate cookies.. What should I use instead?
  19. I was told that Trim gets rid of HTML text? I use mysql_real_escape_string for posting to a database, I just included it with everything. Passwords are md5. What do you mean about Encoding your files? Also, what do you mean by Don't perform development and production on the same "box" ? Explain a bit more about hashmap, or provide a link to it. Maq, That link is what I meant, not thread. Thanks.
  20. I have read through PHPFreaks security thread, never understood some bits. However, this is what I've done. Put all $_POST and $_GET's to mysql_real_escape_string For errors, I put error reporting on via php.ini, at the moment its set for off, as I'm not doing development at the moment. For error reporting, I have removed all "Or die(mysqlerror());" and had it set so that it gives an error but doesn't kill the code. Same for methods like "die("message here");" I'm on a shared hosting, but I have changed the session folder to my own page. (Is it safe in public_html?) I have put in form validation too, and I've used Trim, and addslashes. Is there anything else I could do, and please could you suscribe it too just incase I don't understand. I'd like to protect my php as much as possible.
  21. I changed the first query to $query = mysql_query("SELECT * FROM Users WHERE Username LIKE '$letter%'")or die(mysql_error()); And the second query to $query = mysql_query("SELECT * FROM Users WHERE Username LIKE '$letter%' DESC LIMIT $currentpage, 10 ")or die(mysql_error()); I think it's wrong.. though I replaced the queries with what you said, and filled in the rest of it. Though I'm guessing im not very good at SQL. I've only learnt about inserting, selecting, and changing. I'd obviously create the alphabet links. <a href=" ... ">A</a> and so on. If I create the link as a get or post. So I was able to set it as something like this $letter% = $_GET['letter']; Etc.
  22. Well, here is what I have at this current moment. include("config.php"); echo('<p><strong>Registered Users Table</strong></p>'); $query = mysql_query("SELECT * FROM Users ORDER BY Username")or die(mysql_error()); $totalrows = mysql_num_rows($query); $numberofpages = $totalrows / '10'; if(isset($_GET['page'])) { $currentpage = $_GET['page'] * '10'; } else { $currentpage = 0 * '10'; }; $query = mysql_query("SELECT * FROM Users ORDER BY Username DESC LIMIT $currentpage, 10 ")or die(mysql_error()); $pages=0; while($pages < $numberofpages) { if($pages == $_GET['page']){echo $pages.' '; $pages ++; } else { echo'<a href="admin.php?user=$username&change=regusers&page='.$pages.'">'.$pages.'</a> '; $pages ++; }; echo'<table border=1><center><tr<td><strong>User</strong></td><td><strong>Email</strong></td><td><strong>Admin</strong></td><td><strong>Active</strong></td></tr>'; while($row = mysql_fetch_array($query)) { echo('<tr><td>'.$row['Username'].'</td><td>'.$row['Email'].'</td><td><center>'.$row['Admin'].'</center></td><td><center>'.$row['Activated'].'</center></td></tr>'); }; echo('</center></table>');
  23. Do you mean.. If I edit the pagination I have, have it using the same sort of query as you stated. Then when I click on a letter, it'll set $letter to that letter clicked, then it'll go to the pagination part, search the database for $letter, then display the results etc?
×
×
  • 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.