Jump to content

Unseeeen

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Unseeeen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That's awesome. Thanks for all the help
  2. I get an error with that... Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' I don't really understand what that's trying to do anyways. But what I mean by it annoys me, the result is in an array. I don't want it in an array.
  3. There can only be one match per person, but there will be multiple people. My code works exactly how I'd like it. The result just annoys me though.
  4. Thanks guys, that helps a lot. Here's my code... <form action="" method="post"> <textarea name="first"></textarea><br> <textarea name="second"></textarea> <input value="Submit" type="submit"> </form> <? $first = $_POST['first']; $second = $_POST['second']; $blah = explode(" ", $first); $blahtwo = explode(" ", $second); $result = array_intersect($blah, $blahtwo); print_r($result); ?> It's simple, the way I like it. Anyways, how would I echo the info without having that "Array ( [0] => joe )" thing at the end?
  5. So basically I have 2 lists of information. ex: list 1- bob, joe, dan, billy list 2- paul, joe, jim, mike After putting both of those lists into 2 text boxes, how would I make it so only the common ones show up? In this case joe would be the only name that should show up. Thanks.
  6. read up on mod_rewrite in .htaccess files.
  7. Haha wow, I would of never saw that. Thanks! That's what fixed it. :)
  8. v3x: That didn't fix the error. phpstuck: the reason why I have that if there is because that's not all of it...I made it so if there's a post, basically send it to the database, else post the form. I didn't bother posting the form because I didn't feel it was needed and would just make my post longer.
  9. I honestly cant find anything wrong with this script, other than it's extremely insecure (and I'll fix that later [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]) [code]<?php $dbconnect = mysql_connect ("localhost", "***", "***") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("***"); $title = $_POST['title']; $author = $_POST['author']; $news = $_POST['news']; $submit = $_POST['submit']; $time = date('D M j'); if(isset($submit)) $sql = "INSERT INTO news ( id, title, newsbody, username, time ) values ( 'NULL', '$title', '$news', '$author', '$time' )"; mysql_query ($sql) or die(mysql_error(); echo "News successfully submitted!"; } else { ?>[/code] I get a unexpected ';' error on line 12, and thats [code]if(isset($submit))[/code] I'm pretty sure I used isset() correctly? I was thinking there could be an error on the next line...but I've been trying everything I can think of and it just won't work Can anyone see what's wrong with it? Thanks.
  10. Bingo! Thanks a lot. Also, how common is it for php short tags to NOT be useable? Just seems like all the hosts I've been on have had short tags enabled.
  11. Can anyone see what's possibly wrong? I've been stuck for a while now.
  12. Yeah I can show you, but only after I finish it up.
  13. Yes and yes. The part where the query result should be showing up is empty.
  14. Maybe try putting the [code] $a = '1234.txt';[/code] before the first if? I think this is what you're trying to do...if id == 1, then display a link with a in it.
  15. Thanks, but I don't think I quite understand. I tried: [code]$query = "SELECT * FROM news ORDER BY id DESC LIMIT $frontpagelimit"; $result = mysql_query($query); $row = mysql_fetch_object($result); while ($row = mysql_fetch_assoc($result)) { ?> <center><table class="news"> <tr><td><b>Title</b>:<i><? echo $row->title; ?></i></td></tr> <tr><td><? echo $row->newsbody;?></td></tr> <tr><td><b>Posted by:</b> <i><? echo $row->username; ?></i> <b>on</b> <i>Jan 1st, 2006</i> <b>at</b> <i><? echo $row->time; ?></i></td></tr> </table> <? } ?>[/code] But nothing shows up? What's wrong?
×
×
  • 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.