Jump to content

chriscloyd

Members
  • Posts

    488
  • Joined

  • Last visited

Everything posted by chriscloyd

  1. <script language="javascript"  type="text/javascript"> var url = "register.php?param="; // The server-side script function updateName() {   // display a quick message while the script is being processed   document.getElementById('un').innerHTML = "...checking database...";   var name = document.getElementById("username").value;   http.open("GET", url + escape(name), true);   http.onreadystatechange = handleHttpResponse;   http.send(null); } function handleHttpResponse() {   if (http.readyState == 4) {     results = http.responseText;     var name = document.getElementById("username").value;     if(results == "") results = "Username <i>"+name+"</i> Is Available...";     // the div in which the message appears     document.getElementById('un').innerHTML = results;   } } function getHTTPObject() {   var xmlhttp;   /*@cc_on   @if (@_jscript_version >= 5)     try {       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");     } catch (e) {       try {         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");       } catch (E) {         xmlhttp = false;       }     }   @else   xmlhttp = false;   @end @*/   if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {     try {       xmlhttp = new XMLHttpRequest();     } catch (e) {       xmlhttp = false;     }   }   return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object </script> </head> The form is as follows. <form method="post" action="signup.php" name="theForm" id="theForm"> Desired Username:<br/> <input type="text" name="username" onblur="updateName();" id="username"/> <div style="background: #eee;" name="un" id="un"></div> <input type="submit" name="submit"/> </form> The text input field calls javascript function 'updateName()' when the user removes focus on the input field. The script returns the resulting message into the div with id 'un' <?php include('DB_Connect.php'); $connect = new DB_Connect2(); $u = addslashes($param); // change to reflect your database info $sql = "select userName from user where userName = \"$u\""; $r = $connect->query_db($sql); while ($row = mysql_fetch_array ($r)) {     $un = $row['userName']; } if($u == $un) echo "<font color=\"red\">Username $u already in use</font>"; ?>
  2. thanks if u find out i will do anything for u lol my new company depeneds on this lol
  3. okay i have looked on some websites as the person is filling out the registration form it checks it automaticaly as they r finished. like they fill out the username textbox and as soon as they move on it checks the password and shows if its avaible or not right next to the text box can anyone tell me how to do that?
  4. ya i read that but im still confused to how it works and how to do it
  5. okay i have links for my members like [b]www.myaddresshere.com?users=chriscloyd[/b] how could i make it show up like [b]www.myaddresshere.com/users/chriscloyd[/b] ?? please help me
  6. it does but im trying to make it how it shows whos going to accecpt the live support request refresh every 5 seconds and what not you know what i mean?
  7. Please help me right now im creating a support script i have the ticket part all worked out i just need an idea on how to make the live support part work like what tables would i need in my database i dont need someone to make it for me i just need help like little bits and pieces i can do the coding.
  8. and it wont redirect them to the index.php
  9. <? include("db_config.php"); $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_POST['username'])) {   $username = $_POST['username'];   $password = md5($_POST['password']); $Login = mysql_query("SELECT username, password  FROM users WHERE username='$username' AND password='$password'");           $LoginRS = mysql_query($Login) or die(mysql_error());   $loginFoundUser = mysql_num_rows($LoginRS);   if ($loginFoundUser) {     $Loginadmin = mysql_query("SELECT username FROM admin WHERE username='$username'"); $LoginRSadmin = mysql_query($Loginadmin) or die(mysql_error()); $loginFoundadmin = mysql_num_rows($LoginRSadmin); if ($loginFoundadmin) { $GLOBALS['admin'] = $username; session_register("admin"); } $GLOBALS['username'] = $username; session_register("username"); header("../index.php"); } else { header("../index.php?p=sorry"); } } ?> thats my code but i get this error 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 'Resource id #4' at line 1
  10. hey i wanna kinda do the thing myspace does when someone signs up it gives u a link like this www.myspace.com/chriscloyd how would i be able to do that in php?
  11. how could i make it alternate rows like this when it quires a table [a href=\"http://www.chris.ac/test.html\" target=\"_blank\"]http://www.chris.ac/test.html[/a]
  12. i get this error when i ahve this code Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/index.php on line 199 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 Warning: in_array(): Wrong datatype for second argument in /home/chris/public_html/index.php on line 253 [code] <? mysql_select_db($database_localhost, $localhost); $query_archives = "SELECT date_format(date, '%Y-%c-%e') as ArticleDate FROM articles"; $archives = mysql_query($query_archives, $localhost) or die(mysql_error()); $row_archives = mysql_fetch_assoc($archives); $totalRows_archives = mysql_num_rows($archives); ?> <?php             function build_calendar($month,$year,$day) {                 /* Declaring the variables */                 $daysOfWeek = array('Su','Mo','Tu','We','Th','Fr','Sa');                 $firstDayOfMonth = mktime(0,0,0,$month,1,$year);                 $noDays = date('t',$firstDayOfMonth);                 $dateComponents = getdate($firstDayOfMonth);                 $dayOfWeek = $dateComponents['wday'];                 $monthName = date('F',mktime(0,0,0,$month,1,$year));                                  global $rsArticleDates;                 global $_GET;                                  if (mysql_num_rows($archives) > 0){                     mysql_data_seek($archives,0);                     while($row_archives = mysql_fetch_assoc($archives)){                         $dates[] = $row_archivess['date'];                     }                 }                      /* Computing the previous month. */                 if($month == 1) {                      $mn=12;                      $yn=$year-1;                  } else {                          $mn=$month-1;                          $yn=$year;                 }                                  /* Computing the next month. */                 if($month == 12) {                     $mn2=1;                     $yn2=$year+1;                 } else {                     $mn2=$month+1;                     $yn2=$year;                 }                                  /* Calendar header: next and previous month links */                 $calendar = "<table>";                 $calendar .= "<tr><td><a href=day.php?m=$mn&y=$yn&d=$day>&lt;</a></td>";                 $calendar .="<td colspan=5 align=center>$monthName, $year</td>";                 $calendar .="<td><a href=day.php?m=$mn2&y=$yn2&d=$day>&gt;</a></td></tr>";                 $calendar .="<tr>";                                           /* Calendar header: Display the days of the week */                 foreach($daysOfWeek as $day) {                       $calendar .= "<td>$day</td>";                 }                 $calendar .= "</tr>";                 $calendar .= "<tr>";               $currentDay = 1;                            /* Fill in the beginning of the calendar    body */                   if ($dayOfWeek > 0) {                    $calendar .= "<td  colspan='$dayOfWeek'>&nbsp;</td>";                 }                            /* Generate the calendar body */                       while ($currentDay <= $noDays) {                     if ($dayOfWeek == 7) {                        $dayOfWeek = 0;                        $calendar .= "</tr><tr>";                     }                     $date = $year."-".$month."-".$currentDay;                     if (in_array($date,$dates)) {                         $calendar .= "<td><a href='day.php?m=$month&y=$year&d=$currentDay'>$currentDay</a></td>";                     } else {                         $calendar .= "<td>$currentDay</td>";                     }                    $currentDay++;                    $dayOfWeek++;               }             /* Filling in the end of the calendar body */             if ($dayOfWeek != 7) {                     $remainingDays = 7 - $dayOfWeek;                   $calendar .= "<td colspan='$remainingDays'>&nbsp;</td>";               }                  $calendar .= "</table>";             return $calendar; } if (isset($_GET['m']) && isset($_GET['y']) && isset($_GET['d'])){         $month = $_GET['m'];     $year = $_GET['y'];     $day = $_GET['d']; } else {     $dateComponents = getdate();     $month = $dateComponents['mon'];     $year = $dateComponents['year'];     $day = $dateComponents['mday']; } echo build_calendar($month,$year,$day);         ?>[/code]
  13. Okay im making a news post script it all works and enters it into the database when it displays the text it doenst come out how i put it in there unless i use html in it like <strong> HELLO </strong><br> How are you guys doing today?<br> thats what it comes out as if i do it that way but i just want to be able to hit enter with out putting html into it and haveing it add the html any easy way of doing this?
  14. okay say i got 40 teams i wanna learn how to write the script where it randomly pairs two teams up to eachother 8 times but 8 dif teams not the same team as it paired up to b4 can someone help me? and then i want it to post into a table or file
  15. I need help with the planning first!
  16. Okay i need help with a bracket system where when a team logs into the report match area when they report the clan match if they won they automatically bump up to the next step in the bracket can any one help me?
  17. whats content supposed to =?
  18. Could someone please help me creat the thumbnails and giving them a random name?
  19. i got an upload working were it stores it into the database but im working on giving them random names and creating thumbnails
  20. okay i need help it uploads the file and enters it into the directory heres the actual part that uploads it works fine but i want to give the image a random name using numberand letters can u help me? [code]<? //other code above not shown for personal reasons $target_path = "userimages/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $filename = $_FILES['uploadedfile']['name']; $fileaddress = "userimages/".$_FILES['uploadedfile']['name']; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {     echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";     mysql_query("INSERT INTO `pictures` (`pid`, `uid`, `file`, `description`, `filename`) VALUES ('', '$userid', '$fileaddress', NULL, '$filename')") or die(mysql_error()); } else{     echo "There was an error uploading the file, please try again!"; } ?>[/code]
  21. chriscloyd@cox.net is my email
  22. okay i have a table already in mysql and all i need help is with creating a upload script that upload images to a folder called userimages and i need it to insert the information to the mysql table such as a description ,file address, filename,and uid = userid and i need it to also make a copy of the image and resize it and make the name the same but at the end make it name_resized
  23. somethign happened to my script now whne i eneter an event into the database it causes the whol calendar dates to be the one i made an event for if thats making sense okay lets say i made one for 2006/04/06 as my bday ok, i would make everynumber on the calendar after the 6th the number 6 how could i fix that?
  24. okay i made a drop down and all the events are birthdays aniversities and other how would i make the color like the css for it?
×
×
  • 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.