Jump to content

elias

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

About elias

  • Birthday 04/06/1964

Profile Information

  • Gender
    Male
  • Location
    Spain

elias's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi leute I am trying to use file_get_contents() to download and analyse a website. But it seems not to work for all webs. When I try a basic html page, the page is reproduces with the below code. But, particularly, for this web, it does not work - to try pls remove -remove- : $handle = file_get_contents("http://www.hisp-remove-anianet.tv/index.html"); print "number = $number<br />"; any guidance, welcomed :-) thanks elias
  2. Thanks guys khr2003: if that is the case, that you cannot include "parts of a for loop", then the application of include() here is worthless, as the for loop is 446 lines, and the point of the exercise was that as 400 of the 446 lines where common, I would have only like a "header" included depending on which application I needed. so, is there another neat way of achieving the same effect?: I have three or more pages of code, where, say 40 lines are page specific (and contain the beginnings of teh for loop) and 400 are common (html tables showing the results, etc). How can I use the same page for the three pages, where an if() statement sorts out which code-header I need. I am not sure if that was clear - I hope so. TIA elias
  3. ...where line 446 is the closing "}" of the for loop
  4. Hi guys and gals! I have various pages with slightly different code inside a for() loop: for ($i = 0; $i < $sn; $i = $i + 1){//first loop... $detailsp = array(); $detailsp = explode(" ", $lines[$xn]); //lots of code here..... } for ($i = 0; $i < $sn; $i = $i + 1){ //first loop... $detailsp = array(); ; $detailsp = explode(" ", $lines[$xn]); $dummy2 = array_shift($detailsp); //lots of code here..... } I would like to just make one page with an include() statement to "include" the part of the code that changes. include 'compGlob_chnk1.txt' ; //lots of code here..... } where: compGlob_chnk1.txt, contains: <?php for ($i = 0; $i < $sn; $i = $i + 1){ //first loop... $detailsp = array(); $detailsp = explode(" ", $lines[$xn]); ?> but I get an error, it seems the code "included" is not parsed as part of the for loop. any help greatfully welcome :-) cheers!! elias
  5. thanks msinternet. but is there no *more elegant* way to do this, or have I explained myself awfully? cheers elias ps. or is it the Bruce Willis avatar putting ppl off :-)
  6. Hi guys and gals! Lets see if I can explain the problem.... I have collated data from various tables to arrive a something like this: CompetitionRankShortLongTotal Barcelona2101525 Madrid1151530 Valencia3121022 I would like to sort this data by "Rank", "Short", "Long" or "Total". To that effect I have managed to introduce the data in to a multidimensional array with the keys values such as: $results[$competition]["elements"] - where $results is the multi-array $competition are teh sub arrays (madrid, barcelona, valencia) "elements" are the values of "rank", "short", "long" and "total" so, echo $results["madrid"]["total"]; // yields 30 //sorry to go on, but I need //to get my head around this still now to the question, how can I sort by "rank", say. have tried array_multisort() but found it only sorts by "row" so to speak. I can sort "Rank", "Short", "Long", "Total" or "2", "10", "15", "25" but not as I want by "column": "25, "30", "22" I have considered dumping everything back into a dummy db table, but thought "there must be a better way". also, thought of "flipping" teh table so teh rows are columns and vice-versa, but cant even begin to think how to do it, apart from creating a function() which would be a last resort. thoughts, leads, suggestions - welcome! thx and keep up the good work! elias
  7. HI Alex Yes, from teh "wayback machine", but there is so little on this topic, that your post seemed the most promising... To put you in the picture, what I am trying to do is analyse Sporting Results Data that is issued in PDF format after every competition - see attached: InfantilFemenina_FS_Scores.pdf I have copy/pasted it into a TXT document - see attached: InfantilFemenina_FS_Scores.txt I can do this every time, just create a text file and the parse through this one, and that is my current line of attack, but generally, my rule of thumb is "if it can be done manually, it should be possible to automate it", but how? :-) Anyhow, I look forward to your reply, in the meantime, I shall start on the still necessary job of parsing through the data. Cheers and TIA Elias [attachment deleted by admin]
  8. Hi Alex I know this is a little old now, but I have been searching this forum and the web for this sort of thing for ages, and there is still no clear solution. Most of the suggestions you make are to convert text/html INTO pdf, but not the other way around. Have you manipulated pdf files as you suggest? If so, I would be *really* interested to know how you've done it, as I cant find any way of doing it to date. Cheers elias
  9. excellent guys/gals! thanks, that gives me a few options to work on. take care and have a nice weekend! elias
  10. hi jesirose Thanks for your input, but how do you think I could achieve the desired effect - it must be possible. I want to have a template sitting in domain A with a database linked to it, and then I want 20 other domains, B, C, D, etc. elsewhere to all be able to call on this template so I dont have to have 20 pages and 20 data bases - there must be a way, right? cheers elias
  11. hi guys and gals! I have 20 domains which (to make life simpler) all share the same template pages and data base which reside in another domain. Since changing server, I have found that my pages that used to load at normal speeds are now taking 20-40 seconds (completely unacceptable ) I have narrowed down the problem to this one line: include("http://www.mydomain.com/template.php?site_id=$site_id"); where $site_id are my 20 domains - eg: ItemA, ItemB, etc. Basically my 20 index pages sit in their own domains and call my templates which reside in www.mydomain.com It used to work, but now as I said, it takes forever to load, and I know this is the culprit because if I just call http://www.mydomain.com/template.php?site_id=ItemA from my browser it comes back instantly. Any ideas...... I have tried include and require, but it does not seem to make a difference (and by the way, what are the difference between these two commands) Anyhow, any pointers would be greatly appreciated!!! cheers and have a nice weekend elias
  12. Hi guys long time no speak... I have a code which allows (well it is supposed to) let you upload photos, but I get this error code everytime I try it: and the mentioned line is this one: anyhow, th funny thing is that the data is recorded in the database, as if the photo has been loaded and afterwards the gallery shows as if it has a photo loaded, but there is nothing there. I have upgraded the permissions in the /temp and /images folder, but this had little effect. Can anyone point where I could look for some solutions TIA elias
  13. Hi Ray Thanks a bunch for the explanation, I will do some further studying to make sure I undestand it thoroughly. I just did not know where to turn. Thanks again and have a good one!! tahiche
  14. Hi guys and gals I am baffled by the inability to send variables accross two pages through a form... This is a little experiment I set up to see exactly what was going on: Form Page: [code]                     <form action="test_print.php" method="post">                                <input type="text" name="site_id" value="something" size="30">                     <input type="submit" value="Send">                      </form> [/code] Print Page (test_print.php): [code]             $site_id = $_GET["site_id"];             print "$site_id"; [/code] And the result is a blank page. Then I tried directly on the browser: [code]http://www.domain.com/test_print.php?site_id=something[/code] and that worked - I got the word "something" printed. I have to add that I have moved server and all these pages worked before. Also, someone has already suggested the use of $_GET["site_id"]; - which I dont know exactly what it does, but it does seem to make it work when variables are passed from one page to the other via the URL. Can someone shed some light as to what is going on and how to fix it. TIA tahiche
×
×
  • 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.