Jump to content

paulman888888

Members
  • Posts

    332
  • Joined

  • Last visited

    Never

Contact Methods

  • MSN
    ginger@runningbackwards.co.uk
  • Website URL
    http://RunningBackwards.co.uk/?ref=PHPf

Profile Information

  • Gender
    Male
  • Location
    England

paulman888888's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hello their, I'm wanting to use PHP to check to see if a username and password match a remote RDP server. The reason I ask is because I want to verify that the information the user is giving is correct. I'm looking though LDAP but I have no idea what I'm looking for. To recap, I would like to login to a RDP server and return a result based on if it completed. Thank-you for reading Paul P.S Sorry for the bad English, I seemed to forgot how to spell some words and have had to replace them with longer sentences
  2. Thank-you for your answer. What language do you personally think will be best? Preferably a web based language like, ASP, JSP or Ruby. (There the languages I know but It can be completed in another language I will be more than happy to starting learning (again)) Thank-you for your answer, it really does help Paul
  3. Lots of acroyms in the subject. What I would like to know is how to send a Short Message Service using "PHP: Hypertext Preprocessor" or Personal Homepage In Real Life? I've looked at Email to SMS using a gateway but can't seem to get it work. For example; number@mobile-vendor.tlc but to do luck. I've also looked at some APIs where you have to use CURL to contact there server. I've given up on this for now because I have only found hosts where you have to pay. So, a recap; How do I use PHP to send (a very short) message to a mobile phone in UK (but International would be better but not necessary)? Any free method will be great accepted. Thank-you for reading Paul
  4. I couldn't get it to work so I got it to point to an external server for it to point right back. Bandwidth thrashing i know but it works
  5. Hello there, The error i have is that my server can't find itself and it gives me this nice error. You maybe thinking why don't i just include the file or use its relative location (./file.php) but the answer is simple. It doesn't fit in with my framework and its too hard to expand. How else can I execute a file on the same domain using PHP? Thank-you Paul
  6. Hello there, I've been having problems with this query and i can't understand why i am getting this MySQL server has gone away error. I managed to find out the line and where about in the script this is error is happening. Here is the query that is used and causes the error INSERT INTO stats_user (userid,name,friendcount,gender,likecount,picturecount,groupcount,wallcount,birthday, update_time) VALUES(100000325560036,"Paul Happy Hutchinson",325,"male",509,116,197,402,19920914, NOW()); Please can someone point me in the right direction. I have never had this error before where a query is causeing the server to go away. I have done some more checking and i can comfirm that it is this query causeing the problem because i have used other querys in its place just to check its not a server or network issue. Please please can you help me Thank-you all Paul Hutchinson
  7. Hello there, Ill get straight to the point I want to copy part of an image with a set height and width with as little aspect ratio losing as possible. I tried just copying the size i wanted onto the destination image but when a large image was being used i lost quite alot of the picture. So then I just copied it all across but that compacted the image and I didnt want to do that (well not to that degree although some were funny because they were people.) So what have i got so far; Below is the important function which is doing the job. function copy_crop_image($width, $height, $new_width, $new_height, $dest, $source, $dx=55, $dy=19){ $top_x=0;// The x location on the source image $top_y=0;// Same as above but for the y // $dx and $dy are the destination x y of where to paste the image imagecopyresampled($dest, $source, $dx, $dy, $top_x, $top_y, $new_width, $new_height, $width, $height)===false; } Please can you help me out with guidance on how to resize the image then crop it in one go if possible to save resources. I know it can be done but I just can't think. Thank-you all Paul Hutchinson
  8. Hello, Am looking for a partner who can create the Flash side of projects. I have completed most of the PHP, HTML & JavaScript stuff but without the game is seems abit pointless. If you think you can create this Flash game please do send me a PM. Thank-you Paul
  9. Hello I think I include everything that i would like in the title. I hate using cURL because am not good at understanding all the option you can send. What I want to do is login to a page say http://login.com/login.php then navigate to http://login.com/protectedstuff.php and return the contents of that file. If there is any guidelines or sites that might be able to help me and not php manual because ive already tryied that. That would be great Thank-you all Paul
  10. Hello, I didn't know where to put this so I'll add it here in the hope of it getting move to the tutorials page on the homepage. Getting Started What do I need? [*]A server with PHP - Here [*]The latest version of PHP - Here [*]Developers Application on Facebook - Here I've got the files now what? We need to make our config.php file $app_id = '***************'; // Get this from facebook.com/developers/ $application_secret = '******************************'; // Same as above $facebook = new Facebook(array( // This will used to call all of Facebook's API 'appId' => $app_id, 'secret' => $application_secret, 'cookie' => true // This allows cookies to be used. Note: Problems with IE6 and below. Ill talk about it later. )); $session = $facebook->getSession();// Recover a session if there is one Now we have made a connection to Facebook. We just need to do some checks; try { // We use try and catch because it is the easy way to do things. Always use try and catch when doing a Facebook API request $uid = $facebook->getUser(); // This will throw an error if they are not logged in $me = get_user_info('me'); // This will throw an error if they dont allow this application $friends = $facebook ->api('/me/friends'); // Now we know they are logged in we can get there information like friends $useFacebook=true; // Now do what you want. You got all there details held in $me array }catch(FacebookApiException $e){ // O no, we got an error $url = $facebook->getLoginUrl(array( // This will generate a URL to point the user to allow our application 'canvas' => 1, // I don't no why but yes 'fbconnect' => 0, // I don't no why but yes otherwise you get a weird redirect loop 'req_perms' => 'publish_stream' // Now this is where you can get the user to allow your application to do stuff like posting )); $useFacebook=false; // Do what you want but remember there not logged in so you wont be able to get all there details } And that is mostly it. If you want to force them to loggin put this before $useFacebook=false; and put echo '<script type="text/javascript">top.location.href = "'.$url.'";</script>';die;exit; This will redirect the user when he gets to your page straight away. All in one now; $app_id = 'id'; $application_secret = 'pass'; $facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $application_secret, 'cookie' => true )); $accessToken = $facebook->getAccessToken(); $session = $facebook->getSession(); try { $uid = $facebook->getUser(); $me = get_user_info('me'); $friends = $facebook ->api('/me/friends'); }catch (FacebookApiException $e){ $url = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 0, 'req_perms' => 'publish_stream' )); echo '<script type="text/javascript">top.location.href = "'.$url.'";</script>';die;exit; } Now just have to read the Facebook Terms of Service. I had an application on Facebook that got taken down because it broke one rule. They didn't put it back up so I had to recreate the game then put it back under a different name. The application got 4000 plays an hour but since it's been put back up its not getting that much. Clicky Click Game It gave me an important lesson. Always read the Terms & Conditions. Well, I hope I helped you get started. I almost forgot about that issue with IE6 and below. IE6 blocks the cookies for some reason but you can allow them by having a P3P header or by telling your user to change the Privacy settings to low or Off. And thats about it. If you ever get stuck go to the Facebook Developers site and look there. If that fails there is always trusty PHPFreaks here. Thank-you for reading Paul
  11. To comfirm that the page does exist try; put this at the TOP of your code function shutdown() { echo 'This script exists but i am giveing out a 404!'; } register_shutdown_function('shutdown'); If you page does exist it should show you that message if you use cURL otherwise your file doesnt exists and your server is just uber slow!
  12. Hello again, I got a problem with one of my pages that uses MySql. I didn't expect my site to shoot up into the 1000's per hour but it has but has destroyed the loading time of one of my pages. Below is the function that is super slow! function get_top($timeframe='today', $time=10, $friends=true, $limit=5, $unique=true, $me_only=false){ if($friends===false){$q='';}else{ $q=' AND (username IN ('; // This array can have upto 500 items in it. global $friend_id_array, $me;$tarray=$friend_id_array; $tarray[]=$me['id']; $x= implode(',',$tarray);$q.=$x; $q.= '))'; } if($me_only){ $q=' AND username = \''.$me['id'].'\' '; } if($timeframe=='today'){ $q_timeframe='AND DATE(thedate) = DATE(NOW()) AND YEAR(thedate) = YEAR(NOW())'; // Checking the date could be slow }else if($timeframe=='week'){ $q_timeframe='AND WEEK(thedate) = WEEK(NOW()) AND YEAR(thedate) = YEAR(NOW())'; }else if($timeframe=='month'){ $q_timeframe='AND MONTH(thedate) = MONTH(NOW()) AND YEAR(thedate) = YEAR(NOW())'; }else if($timeframe=='all'){ $q_timeframe=''; } if($unique){$q_unique='GROUP BY username';} $query="SELECT MAX(score) as highscore, username, timeframe, thedate FROM other_click WHERE (timeframe = '$time') $q $q_timeframe $q_unique ORDER BY highscore DESC LIMIT 0, $limit"; // A very long query $result=@mysql_query($query)or die(mysql_error()); if(@mysql_num_rows($result)>0){ while($row=@mysql_fetch_array($result)){ // Maybe resorting the array makes it super slow $id_array[]=$row; } return $id_array;}else{return false;} } I've commented the lines which I think maybe making this page load slowly. I also thought the way the page is loaded. The page is called 6 times per user but with different settings eg, Friends only and only scores added today. Please help because this is crippling my site. Thank-you all Paul
  13. Hello; I know there is a way but I just can't get it out of my head. I have my code that i want to show to the user and then i have code i want to execute but not show anything to user. I no am not making my self clear which i am sorry for so ill give you an example. <? show_my_site(true); // Now i have code which will never output anything but the webbrowser will always wait for it to complete my_function_that_takes_time(true, 'Very Long'); ?> So what i want is some code to tell the browser thats it! You have everything. I cant use die; or exit; because i want to execute the code. Thank-you Paul
  14. Hello; Am looking for a flash file that can play MP3. But thats not the main part. The main part is I want to be able to pass it an 2 arrays. 1 array will be a list of images i want to go though 2 will be a timeframe of when to show the next image. If anyone knows of such an script then please let me know. I would create it myself but am on Linux - Ubuntu and haven't found any working software for flash creation. Thank-you all Paul
  15. Hello there; I have a table that holds lyrics submitted from users but now i want to allow my users to edit other people lyrics. My table is like this; id - lyrics_title - the_lyrics My question is what is the most efficant why of allowing revivsions to be made? My ideas; 1) Edit all the current lyrics - I would update each lyric by selecting it then storing in a new array then serializing and finaley put it back in. - For every new revision i would simply unserialize add the new revision the serialize and store it again 2) Add a new coloumn - I would add a new coloumn called parent - For new lyrics it would have a value of 0 - If a revision is made then i would set the value of parent to the id of parent and keep track of the revisions by using order by - This would also allow me to see who made what changes If you have any ideas please let me know as this is a big change I am going to be making and I want it to be the right one. Thank-you for your time Paul
×
×
  • 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.