rakuenso Posted December 25, 2005 Posted December 25, 2005 ... here's what im trying to do, there's a popular website called facebook, and its features for inviting members to join a group are quite bulky. I plan to make a script that automatically executes the following: http://utoronto.facebook.com/groupuser.php?gid=2954&invite=1&uid=(INSERT_USER_ID_HERE) where INSERT_USER_ID will be read from a list of numbers in another file. I also plan to to make another script that extracts user id's from a list of search queries. Any idea as to how to accomplish this?
RyanJ Posted December 26, 2005 Posted December 26, 2005 ... here's what im trying to do' date=' there's a popular website called facebook, and its features for inviting members to join a group are quite bulky. I plan to make a script that automatically executes the following: http://utoronto.facebook.com/groupuser.php?gid=2954&invite=1&uid=(INSERT_USER_ID_HERE) where INSERT_USER_ID will be read from a list of numbers in another file. I also plan to to make another script that extracts user id's from a list of search queries. Any idea as to how to accomplish this?[/quote'] Are the numbers in a regula sequece in the file, e.g. xx,,xy,xz,xa,xb etc.? If they are in that type of format or any repeating format then you could just read the file, use explode too get it seperated out then grab the part you want Cheers, Ryan Jones
rakuenso Posted December 27, 2005 Author Posted December 27, 2005 hmm yeah they are in numbers, what script? um preferabbly javascript or php
RyanJ Posted December 27, 2005 Posted December 27, 2005 hmm yeah they are in numbers' date=' what script? um preferabbly javascript or php[/quote'] PHP can do it for you with no problems Reading the file array (Presuming that ', ' is the delimiter): <?php $FileName = '/home/ryanjone/public_html/SomeFile.txt'; $Dilimiter = ', '; # ^ This needs to be changed. $FileContents = explode($Dilimiter, implode('', file($FileName))); $Contents = $FileContents[23]; #Returns the 24th element in the array. ?> Then you cnsa just extract the valuew as was done in the last line then using the Header() function you can redirect them too another page Cheers, Ryan Jones
the tree Posted December 28, 2005 Posted December 28, 2005 Ryans script takes a file and looks at is as if it were a string. The explode function then breaks that string up into an easilly manageable array using a delimeter of ', '.
RyanJ Posted December 28, 2005 Posted December 28, 2005 Ryans script takes a file and looks at is as if it were a string. The explode function then breaks that string up into an easilly manageable array using a delimeter of ', '. Yup, then you can easily make a reference to any required element in the array buy using an array reference instead Cheers, Ryan Jones
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now