Jump to content

dadamssg

Members
  • Posts

    729
  • Joined

  • Last visited

    Never

Everything posted by dadamssg

  1. I want to have bloggers write content for my website. I want to compensate them by allowing them to have their own adsense code on the page. BUT i want to take like 25% of the earnings their adsense gets and give them the other 75%. Pretty much the exact same thing as infobarrel.com. Sort of like ehow. Anybody have a clue how this is done?
  2. if i have a column title category. How would i query for multiple categories? i know that this will pull up only 'sports'. SELECT * FROM test WHERE event = 'sports' ORDER BY start ASC LIMIT 5 whats the correct syntax for doing something like this SELECT * FROM test WHERE event = 'sports','performance','random' ORDER BY start ASC LIMIT 5 ??
  3. just tried that, not workin...this seems to work though if(!preg_match('/[.](jpg)|(gif)|(png)|(jpeg)|(GIF)|(PNG)|(JPG)|(JPEG)$/', $_FILES['fupload']['name'])) { $_SESSION['mess'] = "Images must be JPG, GIF, or PNG."; extract($_POST); header("location: picupload.php?id={$_GET['id']}"); exit(); }
  4. I wrote an upload script and now my regex to check the extension(.jpg .gif .png) isn't working. This is the part thats throwing my error and telling me i don't have a valid file if(!preg_match('/[.](jpg)|(gif)|(png)$/', $_FILES['fupload']['name'])) { $_SESSION['mess'] = "Images must be JPG, GIF, or PNG."; extract($_POST); header("location: picupload.php?id={$_GET['id']}"); exit(); } help?
  5. yeah i just downloaded the plug in...i have no idea what i'm looking for though
  6. does anyone know how to do this? i've googled it for a bit but only found one re-occurring script that doesn't work. it's as follows <?PHP /******************************* * Facebook Status Updater * Christian Flickinger * http://nexdot.net/blog * April 20, 2007 *******************************/ $status = 'my_status'; $first_name = 'your_first_name'; $login_email = 'your_email'; $login_pass = 'your_password'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php'); curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&login=Login'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_exec($ch); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_URL, 'http://m.facebook.com/home.php'); $page = curl_exec($ch); curl_setopt($ch, CURLOPT_POST, 1); preg_match('/name="post_form_id" value="(.*)" \/>'.ucfirst($first_name).'/', $page, $form_id); curl_setopt($ch, CURLOPT_POSTFIELDS,'post_form_id='.$form_id[1].'&status='.urlencode($status).'&update=Update'); curl_setopt($ch, CURLOPT_URL, 'http://m.facebook.com/home.php'); curl_exec($ch); ?>
  7. would i put that on every page? or just my index page?
  8. do you have any idea how to use it? i don't want to set any other parameter besides the domain one.
  9. i'm completely new to RSS feeds. Been ignoring the little logo for years now and now trying to understand how to use them. I think i want to use feeds from other sites to my site just to add a little content. Can you subscribe to multiple feeds and have them all list out intertwined into one feed on my site? or can you only subscribe and view one in a single feed?
  10. how would i condense this into ONE query? i know its simple but i just don't know how <?php $sql = "UPDATE test SET start = '$store' WHERE eventid={$postid}"; $result = mysqli_query($cxn,$sql) or die (mysqli_error($cxn)); $sqe = "UPDATE test SET end = '$erl' WHERE eventid={$postid}"; $reslt = mysqli_query($cxn,$sqe) or die (mysqli_error($cxn)); $tql = "UPDATE test SET title = '$title' WHERE eventid={$postid}"; $teslt = mysqli_query($cxn,$tql) or die (mysqli_error($cxn)); $rql = "UPDATE test SET description = '$description' WHERE eventid={$postid}"; $reslt = mysqli_query($cxn,$rql) or die (mysqli_error($cxn)); $vql = "UPDATE test SET location = '$location' WHERE eventid={$postid}"; $veslt = mysqli_query($cxn,$vql) or die (mysqli_error($cxn)); $cql = "UPDATE test SET event = '$event' WHERE eventid={$postid}"; $veslt = mysqli_query($cxn,$cql) or die (mysqli_error($cxn));
  11. how would i create an empty array? $array[0]; while ($list = mysqli_fetch_assoc($result)) { $array = $list['topic_id']; }
  12. now if you could help me construct an array using the while loop that would be MUCH appreciated
  13. hey thanks for the responses. I'm going to be using the array i'm trying to get in a query. So if i use it with the while loop i'll make a BUNCH of queries whereas if i have one array that just holds topic_id numbers i can implode it and add commas and use one query
  14. k disregard the post above...that was accidentally posted to this thread..ooops...still have no clue about combing the queries!
  15. ok, maybe mysqli_fetch_assoc() isn't the function i need to use. Which one is and how would i use it to get what i want?
  16. I thought i could get an array from a query. When i run the query and then use a while loop to echo stuff out it works and i get 3 rows, which is right. But then when i var_dump or print_r the array i only get one result, not right. some exampe code $ble = "SELECT topic_id FROM newreplies WHERE user = 'admin' and viewed = '0' "; $res = mysqli_query($cxn,$ble) or die (mysqli_error($cxn)); $list = mysqli_fetch_assoc($res); then how do i get all the ROWS of $list? i only seem to get the first row pulled up
  17. i have an array ($topic_ids) that i want to combine with a simple query like this SELECT * FROM Topics WHERE topic_id = $topic_ids how do i got about doing this?
  18. that seems like what i need but sometimes my arrays won't have values...that sounds really weird. I'm using the results of two different queries to then use in another query. Sometimes the results of the queries pulls up nothing so i get an error with this function saying that arrays i inputted aren't arrays....
  19. i think thats what i want but heres my test script thats not working... <?php session_start(); include("caneck.inc"); $cxn = mysqli_connect($host,$user,$passwd,$dbname) or die ("Couldn't connect"); $sql = "SELECT topic_id FROM Topics WHERE topic_id IN (SELECT DISTINCT a.topic_id FROM Responses a INNER JOIN ( SELECT topic_id, MAX(create_date) AS maxCreateDate FROM Responses WHERE created_by = 'admin' GROUP BY topic_id ) b ON a.topic_id = b.topic_id AND a.create_date > b.maxCreateDate)"; $result = mysqli_query($cxn,$sql) or die (mysqli_error($result)); // while there are rows to be fetched... $list = mysqli_fetch_assoc($result); $ble = "SELECT topic_id FROM newreplies WHERE user = 'admin' and viewed = '0' "; $res = mysqli_query($cxn,$ble) or die (mysqli_error($cxn)); $ult = mysqli_fetch_assoc($res); $ret = array_intersect($list, $ult); print_r($list); echo "<br>"; print_r($ult); ?> it gives me this however Warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in /home//public_html/main/tester.php on line 29 Array ( [topic_id] => 33 ) why isn't my second "array"($ult) not an array?
  20. i have two arrays that hold numerical values. I want to end up with one array that only has values that BOTH arrays have in common. How would i go about doing this?
  21. ok....both these queries pull up topic_id numbers. How would i combine them to where the one combined super query, if you will, will only pull up the ones that BOTH have the same topic_id numbers? SELECT topic_id FROM Topics WHERE topic_id IN (SELECT DISTINCT a.topic_id FROM Responses a INNER JOIN ( SELECT topic_id, MAX(create_date) AS maxCreateDate FROM Responses WHERE created_by = '$userr' GROUP BY topic_id ) b ON a.topic_id = b.topic_id AND a.create_date > b.maxCreateDate) and SELECT topic_id FROM newreplies WHERE user = '$username' and viewed = '0' "
  22. I have a forum with a db table for Topics and one for the Responses. I'm trying to figure out the most efficient way to, like this forum, "Show new replies to your posts." right now i have a query that pulls up all topics that one has replied to...but i just realized that i will have an ever growing list because you have to be the last person to reply for it to not show up. What i want to do is exactly like this forum. It will show you the new replies to your posts but once you view the thread it doesn't show up on the list again. how should i go about organizing this? i know im going to have to have a new table for this but i'm just not sure how to achieve this
×
×
  • 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.