Jump to content

ohdang888

Members
  • Posts

    1,285
  • Joined

  • Last visited

    Never

Everything posted by ohdang888

  1. So i pretty much have the homepage done, and before i continue with rest of the site i'd like to get that design and setup just right so its consistent throughout. (i haven't even put it on the domain yet) Check it out here: http://www.dailydealist.com/javascript_projects/blogAPI/site/ Don't register or anything, i've disabled it. But you can try out the form validation, etc. I think i need more graphics but i'm terrible at them. blah And if you could tell me your browser that'd be great, thanks.
  2. assuming it is
  3. I have a RSS url for a blog on another domain (not mine)... something lihe http://www.example.com/blog/feed/ that brings up like the first 10 or 15 posts. How do i manipulate the url to get the next posts? Thanks
  4. ah there is it! thanks!
  5. this is line 1 through 19 <?php require_once("admin_connect.php"); $folder = "../"; require_once("../header.php"); if(is_numeric($_GET['id']) && $_GET['do'] == "approve"){ //put in blog //remove from submmisions //email user //index files ` $res = mysql_query("SELECT s.rss_url AS rss_url, s.blog_url AS blog_url, u.email AS email, u.user_id AS user_id FROM blog_submissions AS s, users AS u WHERE s.submission_id='$id' AND u.user_id = s.user_id LIMIT 1")or die(mysql_error()); $row = mysql_fetch_array($res); $email = $row['email']; $uid = $row['user_id']; $rss = $row['rss_url']; $blog_url = $row['blog_url'];
  6. error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/socialap/public_html/javascript_projects/blogAPI/site/admin/submitted.php on line 16 $res = mysql_query("SELECT s.rss_url AS rss_url, s.blog_url AS blog_url, u.email AS email, u.user_id AS user_id FROM blog_submissions AS s, users AS u WHERE s.submission_id='$id' AND u.user_id = s.user_id LIMIT 1")or die(mysql_error()); $row = mysql_fetch_array($res); $email = $row['email']; $uid = $row['user_id']; $rss = $row['rss_url']; $blog_url = $row['blog_url']; Top line is line 14 Thanks
  7. i think it has to do with your $headers information but i'm not positive
  8. change this: echo "<input type=button value=Button onclick=$val>"; to this: echo "<input type='button' value='Button' onclick=\"$val\">";
  9. and return $new_array; doesn't do anything... you needa use print_r($new_array);
  10. you need to read up on mysql_fetch_array. with the while statement, that will turn $result into (usually) a one dimensional array. so $row[0] or $row[1] doesn't exist... rather its $row['city'] etc
  11. try changing: $to = $email; to: $to = $_POST['email'];
  12. i'm guessing i upload it to home/user/php ? but where i put the commands?
  13. Thank you very much! I'm trying it now, except i'm more of a coder than a computer wiz, so i'm confused about its installation and posted it earlier here: http://www.phpfreaks.com/forums/index.php/topic,299871.0.html thanks again!
  14. i dunno where else to do this so i guess i'll do it here? I am using a cPanel to manage my site, and i want to install the Sphinx Search package on my server... where through cPanel would i go to install it? I've tried pretty much every option and am confused as all getout. Thanks!
  15. Absolutely not. If you want to use open source technology then have a look at Sphinx or Lucene. They are full text search indexes. Just Google or search the forum, i've posted the links up many times. Thanks man. I'll look into it. I mean, just to make sure before i start: the best way (thats feasible w/out a huge R&D budget) to find relevant articles would be a FULL TEXT search engine right? Thanks,
  16. nah, i like wordpress. i dug around the source files and found this function: $myExcerpt = get_the_excerpt(); That should do it for ya
  17. I already had all this done, yet revised it a tad and now its working. Still does not make ANY sense to me but whatever. Thanks!
  18. Ya i already did that. Its back to the file thats posted (except $_GET is now $_POST)
  19. Plus, i've never heard of a <class> tag...which is what you're calling in $xpath->getElementsByTagName("class");
  20. post the error
  21. Ya, do.php is a backend file that has functions that are done and then the user is sent back to the index.php page with the results. I set it up this way cause i thought it'd be nice to have all those types of functions in one folder rather than make like 10 extra files
  22. you need a WHERE clause inbetween the SELECT and ORDER that says something like WHERE date=$today
  23. just tried it. and same redirection. then i added this before the switch statement: if($_POST['do'] == "register"){ echo "gahhhhhhhhhhhh"; } And guess what! IT FREIKING ECHOS gahhhhhhhhhhhh i know the variable in the switch statement is right (and set), and the "case" is right... so WTF! gah. any other ideas?!
  24. heres the file. thanks <?php require_once('connect.php'); function r($url){ header('Location: '.$url); die(); } function pass($pass){ return md5("$39".md5($pass)."*)dP~"); } function validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } return $isValid; } $doit = $_GET['do']; switch($doit){ case "login": if($_SESSION['user_logged_in']){ r("index.php?m=already logged in"); } if(empty($_POST['email']) or empty($_POST['password'])){ r("index.php?login=1&m=missing_field&email=".urlencode($_POST['email'])); } $email = clean($_POST['email']); $pass = pass($_POST['password']); $res = mysql_query("SELECT user_id, token FROM users WHERE lower(email)=lower('$email') AND `password`='$pass' LIMIT 1")or die("LOGIN ERROR"); if(mysql_num_rows($res) == 1){ $row = mysql_fetch_array($res); $_SESSION['user_logged_in'] = true; $_SESSION['user_id'] = $row['user_id']; $_SESSION['user_token'] = $row['token']; r("index.php?logged_in"); }else{ r("index.php?login=1&not_found=1&email=".urlencode($_POST['email'])); } break; //END LOGIN case "logout": if(!$_SESSION['user_logged_in']){ r("index.php?m=not_logged_in_anyways"); } session_destroy(); r("index.php?m=logged_out"); break; //END LOGOUT case "register": if(empty($_POST['email']) or empty($_POST['password'])){ r("index.php?reg=1&m=missing_field&email=".urlencode($_POST['email'])); } if(!validEmail($_POST['email'])){r("?reg=1&m=invalid_email");} if(count($_POST['password']) < 6){r("?reg=1&m=pass must have more than 6 characters&email=".urlencode($_POST['email']));} $email = clean($_POST['email']); $res = mysql_query("SELECT user_id FROM users WHERE lower(email)=lower('$email') LIMIT 1")or die("REGSITER ERROR"); if(mysql_num_rows($res) == 1){ r("?reg=1&m=That+email+already+exists+in+our+system"); } $pass = pass($_POST['password']); $to = $_POST['email']; $from = "[email protected]"; $subject = "Confirm this email to activate your account"; //begin of HTML message $message = "<html> <body bgcolor=\"#DCEEFC\"> <center> Please click <a href='http://www.googe.com/do.php?do=confirm_email&token='>here</a> to confirm your email address.<br/> If you cannot click that link, copy and paste this url into your browser: <br> http://www.googe.com/javascript_projects/blogAPI/site/do.php?do=confirm_email&token= </center> </body> </html>"; //end of message // To send the HTML mail we need to set the Content-type header. $headers = "MIME-Version: 1.0rn"; $headers .= "Content-type: text/html; charset=iso-8859-1rn"; $headers .= "From: [email protected]\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email][email protected][/email]"; //$headers .= "Bcc: [email][email protected][/email]"; // now lets send the email. mail($to, $subject, $message, $headers); r("?reg=confirm"); break; default: r("index.php?m=undefined&do=".$_GET['do']); break; } //FUNCTIONS ?>
×
×
  • 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.