Jump to content

paulman888888

Members
  • Posts

    332
  • Joined

  • Last visited

    Never

Everything posted by paulman888888

  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
  16. You learn something new everyday. I try yours and i get . When i try my moddifyed version of yours i get, // the code used " SELECT table_id, table_name, SUM(IF(vote=1,1,0)) AS dodlike, SUM(IF(vote=2,1,0)) AS dontLike FROM votes WHERE table_name = \"lyrics\" GROUP BY table_id ORDER BY (dodlike - dontLike) DESC"
  17. I would add another table maybe prefix_attending and have these colomns; id, event_id, user_id, status id = every table needs one event_id = the event of the id you are adding user_id = the user id or username if you dont use id's. status = I would use codes. For example, 1 = attends,2 = not attending etc. But if you want you could have text. Now for the button. Point to your same page or process page and just enter the information into the database. INSERT INTO prefix_attending SET event_id = $_GET['eid'] and so on Hope i helped abit Paul
  18. I always thought the number in the brackets for INT(n) is the length. With INT(1) i can have 1-9 and with INT(2) i can have from 1-99. I might be wrong and if i am i would like to be corrected. I also think that INT(-1) is infinity. Anyways... The error; I get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like, SUM(IF(vote = 2,1,0)) AS dontLike FROM votes WHERE table_name = "lyrics' at line 3 I just don't no what's up with it. I can normally sort this error when it happens. Please help Thank-you all again Paul
  19. Thank-you Mchl, I've edited it and its still not working :: Hmm... $result=mysql_query(" SELECT table_id, table_name, SUM(IF(vote = 1,1,0)) AS like, SUM(IF(vote = 2,1,0)) AS dontLike FROM votes WHERE table_name = \"lyrics\" GROUP BY table_id ORDER BY (like - dontLike) DESC")or die(mysql_error()); ////// And below is the creation code for the table CREATE TABLE IF NOT EXISTS `votes` ( `id` int(100) NOT NULL auto_increment, `table_name` varchar(100) NOT NULL, `user_id` int(100) NOT NULL, `table_id` int(100) NOT NULL, `vote` int(1) NOT NULL default '0', `date_voted` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1453 ;
  20. Hello Hello, I'm trying to get a rank from a voteing table. My table holds the vote in a coloum which is 1 for a like and 2 for a dislike. What i want to do is get rank of an id. I know what i need to do but i dont no how. I need to; Count the amount of 1's in the column vote Count the amount of 2's in the colomn vote Take the amount of 2's away from the amount of 1's then order it by the amount left. Can some please help me? Paul P.S Am sorry for the (really) bad words but i couldn't get it out of my head
  21. it looks like what i want but i just want to use http and ftp not a new fsync protocol as i dont have access to the servers to install new stuff. Thank-you all the same but do you have any more ideas? Paul
  22. Is there a script out there that can create a "mirror" of a folder? I have created one thats in two halfs. On the host it index all files and stored information in a mysql database The other server then contacted my index.php file which returned files that where not synced The other server then starting downloading files via index.php which logged every file the other server downloaded which was then updated the database. It works ok but I would like to know if there is any "proper" scripts out there?
  23. There was too much information there, i couldnt read though it all and find the things i would of needed. Having you tryed useing jQuery? Its really simple to use and theres lots of plugins to help with things like rss feeds and such. Google it. it helped me so might help you. Sorry i didnt answer your querstion to the full extent but an answer non-of-the-less Paul
  24. Hi, I've been stuck for awhile now; Want to see what the lowest group a variable can fit under. $my_var=8;// example my array (Using print_r) Array ( [0] => 7 [1] => 9 [2] => 11 ) First part of the array is just an id the second one is the one am after. I want to loop though and find the lowest number by variable can fit under so in this case my_var is 8 so the lowest number it can go under is 9. And i would like to be able to store the answer in a variable. Thankyou for your time Paul P.S Sorry if this is a newbie question. I've got back from a holiday (Spain) and i've seem to forgot alot of things
  25. Hi, First off thankyou for reading my post. I being trying to use open ssl functions so i can output my site / files via https:// My site works fine without it and i used ob_start(); // my site stuff $my_site_now_in_a_very_big_variable=ob_get_contents(); ob_end_clean(); What i want to know is; Is there a simple class / function that i can use to output my site via https without getting errors like "The site's security certificate is not trusted!" Thank you Paul P.S sorry if im not very clear. Am new to all the encryption stuff. Thanks again.
×
×
  • 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.