Jump to content

chriscloyd

Members
  • Posts

    488
  • Joined

  • Last visited

Everything posted by chriscloyd

  1. you gave me an idea well urs but ya create another table example archive with cols such aid bid month year then when i inster a blog it insterts a new one
  2. thats why i have month in there arg nevermind u dont understand lol
  3. I have the blog system already set up just workin on the archive and asking advice you dont have to do it for me just lead me in the right direction
  4. say you have a database for a blog and you have posted on it 80 times in a three month span so example of database set up cols - header blog timeposted month I want to do a archive type of thing where it searches the data bases for each month example below March April May then it list how many post are from each of those months March (30) April (29) May (21) any help please? and kinda want to add year to so if it goes on for three years so it has years next to the months
  5. and yes i coded this because i made my own code and it was in there generating a new one it was $random = rand(5689,983498); $newname = $random.'_'.$_FILE['userfile']['name'];
  6. did it normal like this <?php // Configuration - Your Options $allowed_filetypes = array('.jpg','.gif','.bmp','.png'); $max_filesize = 524288; $upload_path = 'myphotos/'; $filename = $_FILES['userfile']['name']; $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); if(!in_array($ext,$allowed_filetypes)) die('The file you attempted to upload is not allowed.'); if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize) die('The file you attempted to upload is too large.'); if(!is_writable($upload_path)) die('You cannot upload to the specified directory, please CHMOD it to 777.'); if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)) echo 'Your file upload was successful, view the file <a href="' . $upload_path . $filename . '" title="Your File">here</a>'; // It worked. else echo 'There was an error during the file upload. Please try again.'; ?> and got this error There was an error during the file upload. Please try again.
  7. here u can test it ur self http://chriscloydblog.com/admin/test.php
  8. Checking Theres A Photo: 1 2 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 3 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 4 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 5 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 6 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 7 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 8 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 9 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 10 ✔ Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 23 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 26 Checking Photo Type: 1 2 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 3 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 4 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 5 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 6 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 7 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 8 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 9 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 10 ✔ Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 43 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 46 Checking Photo Size: 1 2 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 3 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 4 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 5 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 6 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 7 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 8 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 9 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 10 ✔ Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 64 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 67 Uploading Photo To My Photos: 1 2 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 3 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 4 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 5 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 6 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 7 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 8 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 9 Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 10 You cannot upload to the specified directory, please CHMOD it to 777.✖ Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in /home/cpc/public_html/admin/upload_photo.php on line 86 Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /home/cpc/public_html/admin/upload_photo.php on line 89 Notice: Undefined index: cpcerror in /home/cpc/public_html/admin/upload_photo.php on line 93
  9. this is my script might be long but all of it works until it gets to the new part where it uploads it wont up load it says folder is not set to 777 but it is i did set it <?php session_start(); $allowed_filetypes = array('.jpg','.gif','.bmp','.png'); $max_filesize = 524288; $upload_path = '/myphotos'; $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension). $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename. echo "Checking Theres A Photo: "; ob_start(); for($i=1;$i<11;$i++) { echo $i.' '; if ($i == 10) { if ($filename != NULL) { $_SESSION['cpcerror'] = 0; echo '&#10004;'; } else { $_SESSION['cpcerror'] = 1; echo '&#10006;'; } } ob_flush(); flush(); usleep(500000); ob_end_flush(); } if ($_SESSION['cpcerror'] == 0) { unset($_SESSION['cpcerror']); echo '<br>Checking Photo Type: '; ob_start(); for($i=1;$i<11;$i++) { echo $i.' '; if ($i == 10) { if(in_array($ext,$allowed_filetypes)) { $_SESSION['cpcerror'] = 0; echo '&#10004;'; } else { $_SESSION['cpcerror'] = 1; echo '&#10006;'; } } ob_flush(); flush(); usleep(500000); ob_end_flush(); } } if ($_SESSION['cpcerror'] == 0) { unset($_SESSION['cpcerror']); echo '<br>Checking Photo Size: '; ob_start(); for($i=1;$i<11;$i++) { echo $i.' '; if ($i == 10) { if(filesize($_FILES['userfile']['tmp_name']) < $max_filesize) { $_SESSION['cpcerror'] = 0; echo '&#10004;'; } else { $_SESSION['cpcerror'] = 1; echo '&#10006;'; } } ob_flush(); flush(); usleep(500000); ob_end_flush(); } } if ($_SESSION['cpcerror'] == 0) { unset($_SESSION['cpcerror']); echo '<br>Generating New File Name: '; ob_start(); for($i=1;$i<11;$i++) { echo $i.' '; if ($i == 10) { $random = rand(5768,983468); $new_name = $random.'_'.$filename; echo '&#10004;'; $_SESSION['cpcerror'] = 0; } ob_flush(); flush(); usleep(500000); ob_end_flush(); } } if ($_SESSION['cpcerror'] == 0) { unset($_SESSION['cpcerror']); echo '<br>Uploading Photo To <a href="../index.php?p=photos">My Photos</a>: '; ob_start(); for($i=1;$i<11;$i++) { echo $i.' '; if ($i == 10) { if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path.'/'.$new_name)) { echo '&#10004;'; } else { if(!is_writable($upload_path)) { echo 'You cannot upload to the specified directory, please CHMOD it to 777.'; } echo '&#10006;'; } } ob_flush(); flush(); usleep(500000); ob_end_flush(); } } if ($_SESSION['cpcerror'] == 1) { echo 'Could No Upload File Try Again'; header("Location: index.php"); } ?>
  10. yes i have an answer? if ur asking why i did it this way just because i wanted to experiment and have fun
  11. <?php echo 'Checking Admin '; ob_start(); for($i=1;$i<6;$i++) { echo $i.' '; if ($i == 1) { $check_user = mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."' "); } if ($i == 2) { $num_users = mysql_num_rows($check_user); if ($num_users > 0) { $error = 0; } else { $error = 1; } } if ($i == 3) { if ($error == 0) { $check_user2 = mysql_fetch_assoc($check_user); } } if ($i == 4) { if ($error == 0) { if ($check_user2['password'] == md5($_POST['password'])) { $error = 0; } else { $error = 1; } } } if ($i == 5) { if($error == 0) { echo '<br>Login Succesful.<br> Being Redirected To Admin Page.'; $_SESSION['ccblog_admin'] = 'Chris Cloyd'; //header("Location: index.php"); } else { echo "<br>Could Not Log In.<br> Incorrect Information.<br> Being Redirected Back To The Home Page."; //header("Location: ../index.php"); } } ob_flush(); flush(); usleep(900000); } ?>
  12. opps lol didnt see that wow i guess i cant spell either ROFL
  13. opps lol didnt see that wow i guess i cant spell either ROFL
  14. im not im making it check right now just testing crap out having fun im a patient person
  15. its just me that waiting its for a blog
  16. nope i got it <?php echo 'Checking Admin ...'; ob_start(); for($i=1;$i<11;$i++) { if ($i == 10) { echo $i; } else { echo $i.'...'; } ob_flush(); flush(); usleep(900000); } ?>
  17. did that it just pops it up right away Checking Admin ...1...2...3...4...5...6...7...8...9...
  18. theres a way in php i dont live javascript
  19. I'm have made a login script and now i have to process it i was trying to make it count to 10 like example Checking Admin 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 10 any one know how to actually make the numbers pop up while its counting to 10?
  20. <?php $query = "INSERT INTO `users` (Username, Password, Userlevel, Email) VALUES ('$username', '$password', '$usr_level', '$email')"; $result = mysql_query($query); if ($result) { $row = mysql_fetch_assoc($result); $_SESSION['username'] = $row['Username']; $_SESSION['userlevel'] = $row['Userlevel']; $_SESSION['uservalid'] = true; echo "registration successful, you are a " . $row['Userlevel'] . "."; } ?>
  21. please show me wear lol i just looked and i dont see 2 elses lined up anywear
  22. this is the error im getting Parse error: syntax error, unexpected T_ELSE in /home/cpc/public_html/process/login.php on line 34 this is my code can someone help me there <?php session_start(); mysql_connect('localhost','*******','*******'); mysql_select_db('*******'); $username = mysql_real_escape_string($_POST['username']); if ($username == NULL) { $error = 1; $_SESSION['*******'] = 'No username entered.'; } $password = mysql_real_escape_string($_POST['password']); $password = md5($password); if ($password == NULL) { $error = 1; $_SESSION['*******'] = 'No password entered.'; } if ($error == 1) { header("Location: ../index.php"); } else { $check_username = mysql_query("SELECT * FROM users WHERE username = '".$username."'"); $num_users = mysql_num_rows($check_users); if ($num_users > 0) { $user_info = mysql_fetch_assoc($check_username); if ($user_info['password'] == $password); $_SESSION['*******'] = $username; $check_admin = mysql_query("SELECT * FROM admins WHERE uid = '".$user_info['uid']."'"); $num_admins = mysql_num_rows($check_admin); if ($num_admins > 0) { $_SESSION['*******'] = 'yes'; } } else { $_SESSION['*******'] = 'Incorrect information.'; header("Location: ../index.php"); } } else { $_SESSION['*******'] = 'No account for that username.'; header("Location: ../index.php"); } } ?>
×
×
  • 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.