Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. So you have the username and password for an account and would like to see if the account exists? I would have to wonder why you'd have the username and password for an account that doesn't exist... But i would say that trying to login is probably the only way of finding out.
  2. You need to name your select box as an array. E.g. If it's called job, name it job[]. You can then cycle through the array like so: foreach($_POST['job'] as $v){ echo $v.'<br /> '; } Of course, you'll be wanting to do something more than echo the values; but that was just by way of an example.
  3. Well, what exactly are you trying to achieve?
  4. Never seen a decent cURL tutorial to be honest. Part of the problem is that it's quite situation specific. If you google, you may find someone else has already written something to login to msn. If not, google for cURL logins to other large sites (e.g. yahoo, myspace). It'll at least give you some ideas to pursue.
  5. I think you'll probably need a slightly more complex cURL request to log in. I wouldn't be at all surprised if the login requies a user agent to be set, possibly a referrer, potentially a token set in the form. You'll need to take a detailed look at the data being send to the server (i'd use the live HTTP headers extension for firefox) and try to replicate that as well as you can. Use the options as detailed in the manual to add in other headers. You may even need to make multiple requests and have a cookie saved at various points (MySpace login via cURL is hideous).
  6. $page is undefined, and your first query is inefficient. Replace this: $limit = 25; $query_count = "SELECT * FROM forum where reply_to='$reply_to' AND post_type='reply' AND deleted='0'"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); if(empty($page)){ $page = 1; } With this: $limit = 25; $query = "SELECT COUNT(*) FROM forum where reply_to='$reply_to' AND post_type='reply' AND deleted='0'"; $result = mysql_query($query) or trigger_error(mysql_error(),E_USER_ERROR); $totalrows = mysql_result($result,0); $totalpages = ceil($totalrows/$limit); if(!isset($_GET['page'])){ $page = 1; }else{ $page = (int) $_GET['page']; } if($page < 1 || $page > $totalpages){//reset $page if the page number does not exist $page = 1; } While you beat me to it ProjectFear, thought i'd post anyway since i included simple validation as well as the change to the query.
  7. If you set the CURLOPT_RETURNTRANSFER option to true, then the returned data will not be echoed. If you use this option, you should assign the return value of curl_exec() to a variable: $data = curl_exec($ch) You can then do whatever you wanted to do with $data.
  8. Assuming your date field is a unix timestamp, then it'll be something like this: $date = time()-60*60*24*30; $sql = "SELECT COUNT(*) as count,id FROM yourtable WHERE datefield > $date GROUP BY id ORDER BY count DESC LIMIT 5";
  9. No, samshel was asking where you call the function generate_standard_text(). What we really need to see is where $adground_array is defined. How are you turning the contents of that textbox (a string) to an array? Incidently, why are you passing your variables by reference?
  10. 1.) Please, use or tags around your code. 2.) Unless you've defined constants in that included file, PNG would be undefined. Depending on your error settings, there might be a notice being issued which could cause the problem. 3.) I don't think you should be printing the output. I would assume that makeChart2 uses the imagepng() function to output the image. 4.) Comment out the header() function and the imagepng() function. You should get error message(s) that'll help identify the problem.
  11. Sorry? I don't really follow what you're asking.
  12. You need to debug your queries. Basic idea: $sql = "SELECT * FROM..." $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); if(mysql_num_rows($result) > 0){ while($row = mysql_fetch_assoc($result)){ //loop through results } }else{ echo 'No results found'; } Also, please try to use tags when you post.
  13. Perhaps. I just took a look at MySpace (eugh, i'd forgotten what a truly awful site it is) and it does indeed seem that they now require you to login back at microsoft's website and then it somehow transfers the contact list. I'd really not call that an API though. Looks like it's a similar thing with facebook too. Looks far more user friendly on facebook though. Nothing new there i suppose.
  14. CSS question, not PHP. But since you're new, i wont complain too much Wrap it up in a span tag and give it some styling. If you're using this style often, make it a class and give the span tag a class instead. if(!isset($_GET['err'])) { $message = '<span style="color:red;font-family:Verdana">You\'ve just logged out. To go back to the Customer Information page, please re-login.</span>'; }
  15. i.e. Speed is a scalar; velocity a vector.
  16. Yeah, i was aware of that. According to that article, Jordan has signed the relative treaties in any case. I was more commenting on the fact that copyright infringement happens all over the place.
  17. I agree; very strange. My only thought is that it might be something to do with the fact that gifs are limited to 256 colours. I'm not sure if that could possibly cause a problem though. I wonder if you could perhaps supply the image you're working with so I could test it with that. Also, what version of PHP and GD are you using?
  18. What, you mean like every other country on the planet?
  19. I don't think so. All they do is require your email username and password and they grab your contact list from that (e.g. by logging in as you.)
  20. Sure, something's relative velocity could be more than the speed of light; all that would be required is two objects moving away from each other at half the speed of light. But it's impossible for an object's speed - as opposed to velocity - to hit the speed of light as it requires an infinite amount of energy (assuming that object has mass). You're right about the fact that an object travelling away from you has it's light shifted towards the red - it's called doppler shift. And yeah red light has a lower frequency.
  21. I'm not sure i follow? You wish to redirect to www.google.com (in your example) at the end of control.php? header("location:http://".$_GET['link']);
  22. Are you familiar with Einstein? Asuming he is correct, we won't be achieving light speed ever.
  23. Add it in with the other options. It doesn't matter on the order: curl_setopt($ch,CURLOPT_RETURNTRANSFRE,TRUE); By default, the reponse to the cURL request will be echoed to the screen. This prevents that. If you do assign the return value of curl_exec() to a variable, the response will be stored there. E.g. $reponse = curl_exec($ch); //check to see if form was submitted successfully. e.g. with regex Incidently, you might also need to set the submit button's value with your request. It is not uncommon for the submission of a form to be detected by checking the submit button has been set. If you don't do this and the site requires it, the form wont get posted.
×
×
  • 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.