Jump to content

w32

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by w32

  1. w32

    preg_match_all

    Hello I'm having some trouble trying to get some matches of this text [b] James Gosling[/b], Ph.D (born May 19, 1955 near Calgary, Alberta, Canada) is a famous software developer, best known as the father of the Java programming language. If I was looking in a string for "James Gosling" how can I do to get that match with preg_match_all?
  2. Hello, I am in the need of making a parser. Basically I want a script to parse text, and do something when it finds keywords. How could I parse for a certain word. And then could I keep track of what's already been parsed, so it doesnt do the same thing over and over?
  3. It works somehow like my previous SQL, it brings only the first category, and all of its forums...but hang on I'm thinking on a use of FOR..
  4. Hello guys, me again  :D This time around I'm trying to figure out how to organize some stuff...I've been pulling my hair out for a couple of hours.. (or at least what is left of it).. Crazy as it may sound, I'm trying to make some very, very simple forums for, umm, shall we say for self-learning purposes. And I am in a bit of a trouble you see, I have managed to make scripts to create/delete/edit/ categories & forums but I can't seem to be able to order them correctly :( on the forum home it should be something like Category1 -Forum1 -Forum2 Category2 -Forum1 -Forum2 I have made this SQL query, but it doesnt work entirely, how could I manage this? I mean pulling out all the categories from a dbase, and then displaying all the forums that correspond to a category id, below that category? here's my sql : $category = $db->query('SELECT * FROM forum_categories LEFT JOIN forums ON forum_categories.catid=forums.catid ORDER BY forum_categories.cat_position, forums.position ASC '); It kinda worked but while it showed all the forums, it repeated categories, should I make separate queries to get the categories and the forums?
  5. <?php //##your db script## include("config.php"); if($_GET['uid']) { $id = $_GET['uid']; $get['userdata'] = mysql_query("SELECT * FROM pokebash_users WHERE id='$id'"); $get['userdata'] = mysql_fetch_array($get['userdata']); echo 'Username: ' .$get['userdata']['username'] .'<br />'; echo 'E-mail: ' .$get['userdata']['email'] .'<br />'; echo 'fullname: ' .$get['userdata']['fullname']; } else { //########REDIRECTS TO YOUR HOME PAGE IF UID IS NOT PRESENT IN THE URL######### echo '<meta http-equiv="refresh" content="0;URL=index.php" />'; } ?> That'd work I think :) you should now use something like user.php?id=1  or any id you want
  6. yep though I think it's not impossible, wanted to know if someone knew how to do it :)
  7. better yet give me allllll the fields in your database and info of what they contain, and I'll make you a working script :)
  8. questions the 'maaking_users' field contains the users id or their username?? if it does contain the userid  browsing user.php?uid=1  or any id that's actually in the dbase should bring out your user's info :)
  9. I figured that bit, but how do you would a comparison to the value in the database would work out? in your example I would have to do something like SELECT * FROM news WHERE dateint='$day' and that wouldn't work out, would it?
  10. ooohh should've said that...well show me how you're using post in your script, and I'll try to use file_get_content() (should work just as GET) because fsockopen to my knowledge wouldnt help ya
  11. yip :) you'll still need a form if using POST, lol ;) actually no...wouldnt work in the exact same way... kinda troublesome u know...
  12. mmm as I told you, personally I dont' know any other way to POST information to the server without the use of a form...  :D
  13. No prob ;) Btw there are loads of useful attributes you could use like loop, hidden, and width & height (if hidden is set false) :)
  14. Do it exactly as you'd have done it using the GET method, just use a form like this one: <form action="your-script.php" method="post" enctype="application/x-www-form-urlencoded"> </form>
  15. wouldn't this go in the html help area? you can embed audio/video with the <embed> tag example: <embed src="your-file.mp3" autostart="true" />
  16. I did not write the script for you lol...it was an example for you to work upon ...I did comment it, thought you'd modify it :D
  17. I thought that function worked with Post as well....try it...with application/x-www-form-urlencoded on your enctype...if not I wouldnt know... :(
  18. question, are those special characters in your php code, or are they in html bits. If in the html bits they should render just fine...and if they are in your php coding why would you be using special chars there?? I am confused..
  19. check for unclosed/wrongfully used <form> tags in both forms, and check that the script you're specifying in the action attribute is the correct one :)
  20. yup it must be sumething else, just adapted your code to test, and couldn't reproduce the error.. Maybe showing the complete script would help.
  21. If you're trying to see user's info you'll normall have a page like this  user.php?uid=1 And then...you can get the info with something like this <?php //########################################################### if($_GET['uid'])   {   $sql['userdata'] = mysql_query("SELECT * FROM users WHERE userid='".$_GET['uid']."' ");     //########IF USERID EXISTS#####     if(mysql_num_rows($sql['userdata'])>0)       {       $sql['userdata'] = mysql_fetch_array($sql['userdata']);         //######GET & DISPLAY SOME USER DATA#####         $username = $sql['userdata']['username'];         $email = $sql['userdata']['email'];         echo $username .'<br />'. $email;       }     //#####USER DOESN'T EXIST######   else     {     echo 'This user is not in our database';     }   } //#########REDIRECT IF UID IS NOT IN THE URL######### else {   echo '<meta http-equiv="refresh" content="0;URL=any_url_you_choose" />'; } ?> That's what I'd do to fetch user data hope it helps you
  22. Yip it inserts something like this =  1157230857 And I can format that date to my likings to get day/month/etc... that's why I use it. But I only need to compare the day...and I can't figure out how to make a query like that one.. thanks for your help ;)
  23. Hello guys I wondered whether you could help me with a mysql query..  :) So...I have a field in a table, with a date int. It's a script that groups news elements by day. Then all the news for that specific day must be displayed. And I'm having trouble with that... The int in the database field contains the info of the day, year, month etc (basically date("U") ) But I only need to get the day, to get all the news of a specific day...how could I make a query like that  ???
  24. the result I was trying to echo didn't show up, when it was like this: <?php echo $_COOKIE['val1']; ?> however this worked: <?php echo $_COOKIE[val1]; ?> thanks btw :)
×
×
  • 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.