Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. Do you mean it is empty with no drop down options or are there drop down options just empty ones. anyway here is a code fix <select name="userlevel"> <?php $query = "SELECT userlevel FROM user_levels ORDER BY userlevel_id DESC"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo "<option value= \"".$row['userlevel']."\">".$row['userlevel']."</option>"; } echo "</select>"; ?> @Maq, depends on the size of the table and the amount of rows it has.
  2. I don't think they do, try them out ? Read the comments on the is_numeric page From the comments <?php function my_is_numeric($value) { $american = preg_match ("/^(-){0,1}([0-9]+)(,[0-9][0-9][0-9])*([.][0-9]){0,1}([0-9]*)$/" ,$value) == 1; $world = preg_match ("/^(-){0,1}([0-9]+)(.[0-9][0-9][0-9])*([,][0-9]){0,1}([0-9]*)$/" ,$value) == 1; return ($american or $world); } ?>
  3. http://www.google.com/search?hl=en&safe=off&q=php+rss+reader&btnG=Search&aq=1&oq=php+rss+re GOOGLE !
  4. Threads have been locked like this, where it is someone asking us to do your homework for you. Use google, learn php, do the work. When you get a problem with using the PHP then ask us.
  5. Having a look at some more code examples might help you http://djw-webdesign.awardspace.com/snippet.php?cat=1
  6. I didn't know that, nice info. Lucky on my sites i have checked for duplicate usernames on registration.
  7. or is_numeric();? http://uk2.php.net/is_numeric
  8. I already said You will need to rewrite the file using fwrite i believe.
  9. I would say it is best to keep the username as it is that way you can have variety's of the same username.
  10. That shouldn't effect it as the PHP is producing the HTML. It might just be the applet, but as the PHP is solved. Please press the solved link at the bottom left.
  11. No it won't, if it did it wouldn't be very sage. You can't without changing everyone's, also this will limit the amount of usernames available. But if you really want to what you should do is use strtolower(); or strtoupper(); or ucfirst(); and adjust the username on registration before inserting into the database or when reading it from the database and then perform the same on the username entered when logging in.
  12. Is the HTML file saved on your server? If so i think, although am not sure, that you will need to read the page, then get the source and put it in a textarea and then when you save changes rewrite over the page with the new one (changes included)
  13. <?php error_reporting(E_ALL); ini_set('display_errors',true); session_start(); if(!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] != true) { header("Location:main_login.php"); } require_once'header.php'; require_once'mainnav.php'; require_once 'config.php'; // Connect to server and select database. mysql_connect($dbhost, $dbuser, $dbpass)or die("cannot connect"); mysql_select_db("vetmanpc")or die("cannot select DB"); $result = mysql_query("SELECT * FROM $dbname") or die(mysql_error()); // store the record of the "lakestmill" table into $row $current = ''; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { $id = $row['id']; if (!$current) { echo "<center><div><table border='1' width='300'>"; $current = $id; } elseif ($current != $id) { echo "</table></div><br><br><div><table border='1' width='300'>"; $current = $id; } echo $myusername; echo $mypassword; ?> <tr><th width='80' height='3'> Unit No.</th><td><?= $row['unit']; ?></td></tr> <tr><th> Company</th><td><?= $row['company']; ?></td></tr> <tr><th> FirstName</th><td><?= $row['firstname']; ?></td></tr> <tr><th> LastName</th><td><?= $row['lastname']; ?></td></tr> <tr><th> Email</th><td><a href="mailto:<?= $row['email']; ?>"><?= $row['email']; ?></a></td></tr> <tr><th> Address</th><td><?= $row['address']; ?></td></tr> <tr><th> City</th><td><?= $row['city']; ?></td></tr> <tr><th> State</th><td><?= $row['state']; ?></td></tr> <tr><th> Zip Code</th><td><?= $row['zip']; ?></td></tr> <tr><th> Phone</th><td><?= $row['phone']; ?></td></tr> <tr><th>Update</th><td><a href="update_ls.php?id=<? echo $row['id'];?>">update</a></td></tr> <?php } echo "</table></div></center></body></html><br>"; mysql_close(); include('footer.php'); ?> <?php error_reporting(E_ALL); ini_set('display_errors',true); session_start(); if(isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == true) { header("Location:members.php");//the page you go once you have logged in } $host="p41mysql141.secureserver.net"; // Host name $username="rwts_webmaster"; // Mysql username $password="Pfcram1910"; // Mysql password $db_name="rwts_webmaster"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); // Username and password sent from signup form // First we remove all HTML-tags and PHP-tags, then we create a sha1-hash // username and password sent from form $myusername = $_POST['myusername']; $mypassword = $_POST['mypassword']; // To protect MySQL injection $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM members WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql) or die(mysql_error()); // Mysql_num_row is counting table row $count = mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1) { // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['logged_in'] = true; $_session['myusername'] = $myusername; $_session['mypassword'] = $mypassword; header("location:login_success.php"); } else { header("location:login_fail.php"); } ?> Try them , they are untested but look ok.
  14. I have a massive word list if you want it i can email it as the word filters here will prevent it from being visible. Also i use str_ireplace(); and have an array of bad words.
  15. First off welcome to the site, second off please use tags, and third off. What?? Are you trying to say that the form will only work when using <tables> and not when using divs, because if so this is a problem with the form not the php.
  16. $sql = "UPDATE users SET firstname ='$Firstname',surname='$Surname',email='$Email',password='$Password1' WHERE username='$User'"; mysql_query($sql); try that
  17. Although the PHP is working fine now, so i assume it must be the JAVA applet.
  18. On all queries put or die(mysql_error()); like below mysql_query() or die(mysql_error()); //some people like to put a way to reference that query as well and to the top of the page put error_reporting(E_ALL); and edit: ini_set("display_errors",true); I think that is now right^^
  19. You have value written twice <param name="rom" value=value="<?php echo $playrom;?>" /> should be <param name="rom" value="<?php echo $playrom;?>" /> Are you even looking at your code?
  20. Don't expect help before you have even tried debugging. Add die statements to your queries and your connections then tell us if there are any errors.
  21. You use meta tags to set the page encoding or i think it can be done via header();
  22. You need something like <?php session_start(); if(!isset($_session['mypassword'])) { header("Location:NoSession.php"); } ?> Have a look at my example login code http://djw-webdesign.awardspace.com/snippet.php?cat=1#Basic%20Login_9
  23. The variable value is assgined wrong it should be in quotation marks like so <?php $playrom = "http://maverik247.com/vnes/roms/dkong.nes"; ?>
×
×
  • 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.