Jump to content

esahp

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by esahp

  1. Yeah, I know about that. I spent a few days trying to get that right, and so far so good. My question is can I do either of these two things with htaccess: 1) Can I make it so certain rules inside the HTACCESS apply to a specificed directory (no more no less)? OR 2) Can I make it so the entire HTACCESS applies to a certain directory (no more no less)? * Sorry if that was blunt, trying to make it clear :)
  2. How would I restrict the entire HTACCESS file (or just certain rules *in* it), to the directory it's in? For example: /home/blah/public_html/.htaccess - works in /home/blah/public_html but does not work in /home/blah/public_html/boo My HTACCESS consists of: [code] RewriteEngine on RewriteRule ^id/([^/\.]+)/?$ index.php?id=$1 [/code]
  3. bump [b]again[/b] I tried without encoding it and it's still not decrypting right.
  4. SOLVED, no thanks to the [s]great[/s] folks at phpfreaks.
  5. I'm not quite sure how to do this or exactly how to explain it. There is a peice of code I want dynamically placed around a certin menu item when that menu item is clicked. The layout is setup where the navigation looks like tabs at the top, and <li id="first" class="active"></li> will make that tab look like its the 'active' one. I have the navigation in nav.php which is included with include();. I'd like for the tab I click on to appear active on that page. Hope I've made this clear enough.. [i]nav.php[/i] [code] <li id="first" class="active"><a href="index.php">Main</a></li> <li><a href="staff.php">Staff/Servers</a></li> <li><a href="tos.php">TOS</a></li> <li><a href="aup.php">AUP</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> [/code]
  6. I'm looking to keep the information in my database unreadable to the human eye. Pref. using a long password to 'decrypt' it and make it viewable to the admins in the admin panel. I know of some encryption methods that can do this such as Blowfish. However, I'm not sure where to go about using encryption in this manner with PHP. Basically: Someone signs up > data is encrypted with a password and inserted into the mysql database > an admin logs into the admin panel and goes to the Pending page > the data is selected from the database, decrypted, and displayed. I already have it working in plain text, so it's just the matter of sticking encryption on it.
  7. Actually, with the power of ctrl+v it was quite easy :P I noticed you have mysql_real_escape_string(); whereas I have mysql_escape_string(). From the looks of the php manual mysql_real_escape_string(); is better. Is that true?
  8. Thankyou for giving me a straight answer.
  9. That still didn't answer my question. First post: "Is there anything further I can do? Or is what I already have done it." Also, quoting my second post "I was told I didn't need addslashes(); if I had both mysql_escape_string(); and strip_tags();" is this true that I don't need addslashes(); if I have both of the following, or do I still need to include it somewhere? And whats the deal with magic_quotes_gpc?
  10. I was told I didn't need addslashes(); if I had both mysql_escape_string(); and strip_tags();
  11. I have a signup form, and the data on it will get inserted into a MySQL database. Now as far as I know I've taken the proper steps in the following code to prevent SQL, javascript, and html source injections. Is there anything further I can do? Or is what I already have done it. I have the signup form action go to another page, and the contents of said page are: [code] <?   $firstname = mysql_escape_string(strip_tags($_POST['firstname']));   $lastname = mysql_escape_string(strip_tags($_POST['lastname']));   $email = mysql_escape_string(strip_tags($_POST['email']));   $phonenumber = mysql_escape_string(strip_tags($_POST['phonenumber']));   $homeaddress = mysql_escape_string(strip_tags($_POST['homeaddress']));   $citystate = mysql_escape_string(strip_tags($_POST['citystate']));   $country = mysql_escape_string(strip_tags($_POST['country']));   $domainname = mysql_escape_string(strip_tags($_POST['domainname']));   $username = mysql_escape_string(strip_tags($_POST['username']));   $password1 = mysql_escape_string(strip_tags($_POST['password1']));   $password2 = mysql_escape_string(strip_tags($_POST['password2']));   $rules = mysql_escape_string(strip_tags($_POST['rules']));   $legalinfo = mysql_escape_string(strip_tags($_POST['legalinfo']));   $age = mysql_escape_string(strip_tags($_POST['age']));   $sitedetails = mysql_escape_string(strip_tags($_POST['sitedetails']));   $aboutus = mysql_escape_string(strip_tags($_POST['aboutus']));   if ($firstname == "") { $errors .= "First Name field was left blank.<br />"; }   if ($lastname == "") { $errors .= "Last Name field was left blank.<br />"; }   if ($email == "") { $errors .= "Email Address field was left blank.<br />"; }   if ($phonenumber == "") { $errors .= "Phone Number field was left blank.<br />"; }   if ($homeaddress == "") { $errors .= "Home Address Field was left blank.<br />"; }   if ($citystate == "") { $errors .= "City&State field was left blank.<br />"; }   if ($country == "") { $errors .= "Country field was left blank.<br />"; }   if ($domainname == "") { $errors .= "Your Domain field was left blank.<br />"; }   if ($username == "") { $errors .= "Desired Username field was left blank.<br />"; }   if (($password1 == "") || ($password2 == "") || ($password1 != $password2)) { $errors .= "Password fields were left blank or do not match.<br />"; }   if ($rules == "") { $errors .= "You didn't agree to the rules.<br />"; }   if ($legalinfo == "") { $errors .= "You didnt agree to the legal information.<br />"; }   if ($age == "") { $errors .= "You didnt state you were over the age of 18.<br />"; }   if ($sitedetails == "") { $errors .= "Site Details field was left blank.<br />"; }   if ($aboutus == "") { $errors .= "About Us field was left blank.<br />"; }   if (isset($errors)) {     echo $errors;   }   else {     // SQL Query stuff here     echo "Works!";   } ?> [/code]
  12. I don't understand how to tell the rows apart. I've added a new part in the table for the Accept/Reject button, and the buttons themselves, I just have no clue how to make the buttons update the row that it sits on. [code] <?PHP   include "db.php";   $query = "SELECT `fname`, `lname`, `email`, `phone`, `address`, `citystate`, `country`, `domain`, `username`, `password`, `rules`, `legal`, `atleast18`, `details`, `aboutus`, `ip` FROM users WHERE `status` = '1'";   $result = mysql_query($query) or die('Query failed: ' . mysql_error());   echo "<table border='1'>";   echo "<tr><th>Full Name</th><th>Last Name</th><th>Email</th><th>Phone</th><th>Address</th><th>City/State</th><th>Country</th><th>Domain</th><th>Username</th><th>Password</th><th>Rules</th><th>Legal</th><th>18?</th><th>Details</th><th>About us?</th><th>IP</th><th>A/R</th></tr>";   while ($data = mysql_fetch_array($result)) {     echo "<tr><td>";     echo $data['fname'];     echo "</td><td>";     echo $data['lname'];     echo "</td><td>";     echo $data['email'];     echo "</td><td>";     echo $data['phone'];     echo "</td><td>";     echo $data['address'];     echo "</td><td>";     echo $data['citystate'];     echo "</td><td>";     echo $data['country'];     echo "</td><td>";     echo $data['domain'];     echo "</td><td>";     echo $data['username'];     echo "</td><td>";     echo $data['password'];     echo "</td><td>";     echo $data['rules'];     echo "</td><td>";     echo $data['legal'];     echo "</td><td>";     echo $data['atleast18'];     echo "</td><td>";     echo $data['details'];     echo "</td><td>";     echo $data['aboutus'];     echo "</td><td>";     echo $data['ip'];     echo "</td><td>";     echo "<form action=\"blah.php\" method=\"post\"><input type=\"submit\" value=\"A\">";     echo "<input type=\"submit\" value=\"R\"></form>";     echo "</td></tr>";   }   echo "</table>";   mysql_free_result($result);   mysql_close($mlink); ?> [/code]
  13. I'm creating a script that will let me accept/reject signups. I'm stuck on how to make a button to Accept/Reject each signup. Each signup is a row in a mysql table, and it's also displayed like that in html using tables. My question is how would I perform an action on the row the button is near. MySQL is still very new to me so I'm having a hard time figuring out if I need to focus more on the PHP side or SQL side. Heres how its setup now: http://i10.tinypic.com/2qcngk5.png [code] <?PHP   include "db.php";   $query = "SELECT `fname`, `lname`, `email`, `phone`, `address`, `citystate`, `country`, `domain`, `username`, `password`, `rules`, `legal`, `atleast18`, `details`, `aboutus`, `ip` FROM users WHERE `status` = '1'";   $result = mysql_query($query) or die('Query failed: ' . mysql_error());   echo "<table border='1'>";   echo "<tr><th>Full Name</th><th>Last Name</th><th>Email</th><th>Phone</th><th>Address</th><th>City/State</th><th>Country</th><th>Domain</th><th>Username</th><th>Password</th><th>Rules</th><th>Legal</th><th>18?</th><th>Details</th><th>About us?</th><th>IP</th></tr>";   while ($data = mysql_fetch_array($result)) {     echo "<tr><td>";     echo $data['fname'];     echo "</td><td>";     echo $data['lname'];     echo "</td><td>";     echo $data['email'];     echo "</td><td>";     echo $data['phone'];     echo "</td><td>";     echo $data['address'];     echo "</td><td>";     echo $data['citystate'];     echo "</td><td>";     echo $data['country'];     echo "</td><td>";     echo $data['domain'];     echo "</td><td>";     echo $data['username'];     echo "</td><td>";     echo $data['password'];     echo "</td><td>";     echo $data['rules'];     echo "</td><td>";     echo $data['legal'];     echo "</td><td>";     echo $data['atleast18'];     echo "</td><td>";     echo $data['details'];     echo "</td><td>";     echo $data['aboutus'];     echo "</td><td>";     echo $data['ip'];     echo "</td></tr>";   }   echo "</table>";   mysql_free_result($result);   mysql_close($mlink); ?> [/code]
  14. I can't figure out how to change the font size of the text inside of a table. Tried sticking font tags inside of <table> and </table> and tried an external css style sheet. Neither worked.
  15. I see, thanks guys. That line without [b]WHERE 1 AND[/b] also worked, thankyou.
  16. Well, I'm completely new to the SQL language, and I was told [b]WHERE 1[/b] lists all of the data in the table and I was looking around and found [b]WHERE `blah` = 'blah'[/b] Which I assumed to mean [b]WHERE [u]field[/u] equals [u]blah[/u][/b]. So basically, I'm wanting to to list all of the data in the table [b]users[/b] where the field [b]status[/b] is equal to [b]1[/b]
  17. I basically call it Image Verification, and using that term on hotscripts.com I found: http://www.hotscripts.com/Detailed/55697.html http://www.hotscripts.com/Detailed/58022.html http://www.hotscripts.com/Detailed/56010.html http://www.hotscripts.com/Detailed/59280.html You can use PHP, and I assume also Perl and ASP to create scripts such as these.
  18. I have: [code] $query = "SELECT * FROM users WHERE 1 AND WHERE `status` = '1'"; [/code] and get the error: [quote] Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `status` = '1'' at line 1 [/quote] How do I get this working correctly?
  19. What mail clients do you guys use? I use Mozilla Thunderbird.
  20. So I'm trying to learn MySQL, I'm in phpmyadmin, got my database created, now I'm at tables and fields. What does it mean by fields? I'm very new to MySQL. (i'll be doing the coding in PHP, by the way.) Basically, I'm creating a signup system. Users will signup with a form, and that data will get stored in a MySQL database, for later viewing and sorting. The signup system has 3 key pages. Pending: All new signups will be shown here. With the option to Accept/Reject each one. Accepted: All accepted signups will be shown here. If the Accept button is hit on a signup on the Pending page, it will be moved from Pending to this page. Rejected: All rejected signups will be shown here. If the Reject button is hot on a signup on the Pending page, it will be moved from Pending to this page. The form seeks the following information: [list] First Name (textbox) Last Name (textbox) Email (textbox) Phone Number (textbox) City/State (textbox) Country (textbox) Domain (textbox) Username (textbox) Password (textbox) I agree with the rules (checkbox) I agree with the legal information (checkbox) I am atleast 18 years old (checkbox) Site Details (textbox) Where did you hear about us? (textbox) [/list] I think after I can get past how many fields and columns or whatnot I need I can handle it, but concept of how MySQL works is still confusing for me. (how it stores the data, tables, fields, etc)
  21. Recently I have been wanting to better my skills in PHP, and this project I am working on requires MySQL. I looked around here and other places but couldn't find one that explained this: You have a form, and data the user submits will be stored in a MySQL db for later viewing/editing in an admin area. To explain further: it's a signup system, which you can check pending, accepted, and rejected signups. (In the pending area you can accept/reject them.)
×
×
  • 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.