Jump to content

fapapfap

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by fapapfap

  1. I want to create a site which is a mix between a service provider and a blog/tutorial site. The visitor is met with a page which is split into 3. The first third is a simple user input bar which once they enter their site address into it the Alexa records are queried and some process results in them then choosing options and proceeding to checkout. The next third of the main page is a sort of cross-section of blog entries. The final third is a spot for all the propritory tools and things that the site produced for download. At the very top I would have some options menus for |what is it|how to use|background|contact| etc.. Someone told me to do it with Joomla, another with wordpress- I think they are crazy and would love to learn PHP as an exciting project at the same time, although I am concerned about biting off more than I can chew. What you think?
  2. Sorry just to add, there shouldn't be a gap between the main body of code
  3. Within this page source: <tr> <td><font size="-1">12.34.56.78</font></td> <td><font size="-1">GB</font></td> <td><font size="-1">random things</font></td> <td><font size="-1">randomthings</font></td> <td><font size="-1">random things</font></td> <td><font size="-1">random things</font></td> <td><font size="-1"></font></td> <td><font size="-1">30.9500</font></td> <td><font size="-1">-2.2000</font></td> <td><font size="-1">random things</font></td> <td><font size="-1">random things</font></td> <td><font size="-1"></font></td> <td><font size="-1"></font></td> </tr> I want to save what is in the space of 30.9500, and -2.2000. It will always be this structure, but random things will be strings of different lengths, and the numbers will change but be in the same floating point format. I cant get it because the tags are all so alike!
  4. Wow what a fantastic thorough response! I like it. Shall start looking into wordpress and plugins. Out of interest, does anyone have any further suggestions for me to checkout?
  5. Hi everyone, first thanks for caring to read my post! I am very very new to php but have a really good idea for a site so thought this could be a good chance to finally learn. The site is basically going to be a simple yet very well structured and organised repository for articles with the ability for users to post comments at the bottom of each article (logged in users). The users can also post articles and select which sections they want to put them in. The admin could then review all submissions and accept and then put them in the order in which they best fit (since the articles will usually be relevant to different stages and should be placed in order of assumed knowledge, if that makes sense) Kind of like a tutorials site with content being submitted. I imagine a really uncluttered site that looks more old school than web 2.0. From the first page is just like a simple search engine and underneath a kind of sitemap with each topic showing how many articles are in each. Then as you click into the topic area you are shown another sitemap like display of the articles in this which are perhaps some sectioning to define the type of article it is. As I say, I am quite new so I wondered if you had some suggestions of the top 'aids' to achieving this, and how you would suggest I progress to get it all setup? Or indeed any frameworks already that fit my needs? I hope to be active here and look forward to being to give something back some day. Edit: after reading this through,, I realise I just described a kind of wiki, but thats not really what I had in mind- more just how the old school basic but very clean and functional sites were back in the day (meaning no disrespect to any of the newer ones!). Thank you for reading.
  6. Hi thanks for replying but it is slighly more complex because of the full search string: $pattern = '~\<a href="http:\/\/www\.site\.net\/page\.php\?action=p\&uid=[0-9]+">[^ ]+<\/a>~i'; This will successfully extract the TEXT in the following HTML: <a href="http://www.site.net/page.php?action=p&uid=29">TEXT</a> But not instances where the format changes slightly: <a href="http://www.site.net/page.php?action=p&uid=29"><span style="color:#ffcc00">TEXT</span></a> An adjustment to the pattern regex is what I am looking for so to still extract the TEXT given either of these formats (NOTE: THE COLOUR HEX IS VARIABLE!)
  7. The following regex looks for the pattern including </a>. I would like to add in an OR condition which also includes patterns which include </span>, which somestimes is shown in results in place of </a>, is that possible? Regex: $pattern = '~">[^ ]+<\/a>~i'; I thought I could do '~">[^ ]+(<\/a>|<\/span>)~i'; But doesn't work
  8. Another question please: Some of the data will be fortmatted in the following form, how to deal with this in the context of the answer above? <a href="http://www.site.com/page.php?action=p&uid=448"><span style="color:#0066FF;">TEXT</span></a>
  9. I would like to spoof the useragent as googlebot through the implementation of file_get_contents, or curl (which ever is easiest). How to do this? Googlebot useragent = Googlebot/2.1 (+http://www.google.com/bot.html)
  10. So I would like to scrape a page to make a list of URLs. The source has lots of URLs in the following format: <a href="http://www.site.com/page.php?action=p&id=99">TEXT</a>, <a href="http://www.site.com/page.php?action=p&id=97">TEXT</a>, <a href="http://www.site.com/page.php?action=p&id=98">TEXT</a> and carries on in exactly the same format. Can someone help me with the code I need to scrape the page and extract just the links into a list using regex?
  11. Hi sorry last attempt to see if anyone could come up with a solution to this, i am still struggling. OR maybe point me in the direction of some good resources?
  12. Hello! I know it seems daft, but I have a larger project in mind for these skills and thought I would take the time to implement some simpler stuff now as a learning exercise.
  13. Hi thanks for answering, I had to edit it as didn't realise that you couldnt highlight things within code brackets. Basically yes I understand what you are saying, but as i say the only things that change in the string are the UID, name and color code. On that basis I was thinking of something like: if (preg_match("/\b >**</span>"><span style="color:#**">**</span></a>\b /i", $content)) So that it would find the pattern accepting anything inbetween the stars as being variable, if you know what I mean.
  14. Hi everyone, I am making a screen scraper in php which scrapes the usernames from forum posts and stores them in an SQL database. I need some help with part of the preg_match code if possible please? The code and also the pseudo code I have so far is:(the pseudocode I am having trouble with but will try to solve my self if possible). Edit: sorry, editted the page as was confusing to read. Please ask for clarificaiton if there is anything I have failed to explain properly. thank you. //I will be placing the following php in the confirmation page people see after making a new post, so for this example lets say the referrer header says: http://www.mysite.com/showthread.php?tid=1' $threadurl=$_SERVER['HTTP_REFERER']; // scrape the page $content = file_get_contents($threadurl); // find the pattern in source which makes it easy to find the username- the only things that change are the uid and the color if (preg_match("/\b uid=792"><span style="color:#ffcc00">fapafap</span></a>\b /i", $content)) { //extract username from this string search Don't know! //copy the username (in this case 'fapafap') to the database along with the referral ID $query_insert="INSERT INTO newpostersdatabase(username,referrerurl) VALUES('$username','$threadurl')" ; $result=mysql_query ( $query_insert); if(!$result){ die(mysql_error()); } Thank you so much for any guidance, I know that I have totally messed up with the string search also but my brain is too small it seems!
×
×
  • 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.