Jump to content

muppet77

Members
  • Posts

    142
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

muppet77's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

1

Community Answers

  1. Hi, I am trying to grab some data from a site, but my blocker at the moment is that the site has a button near the end of the page, that opens up more data. It's th ebutton that says "Show All" Using file get contents, I don't get this "hidden data". Any ideas please? I'm a novice and am using this code: echo strip_tags(file_get_contents("http://www.sportinglife.com/football/live/vidiprinter")); Thank you.
  2. ignore my post above - all sorted. Barand - your solution works perfectly. Thank you Barand and everyone else.
  3. Thanks Barand. Had a quick go but couldn't get it going. Should there be some php in there? Eg rather than your <input type="hidden" name="goalie1" value="<?=$goalie?>"> <!-- store the goalie value in a hidden field --> Should it be <input type="hidden" name="goalie1" value="<?php echo $goalie ?>"> <!-- store the goalie value in a hidden field -->
  4. The complication in my head is that $angle has to be a user input but $goaly1 is calculated in the php code above. Both need to be sent to penalty.php
  5. Thanks. So what would it look like please?
  6. $angle comes from the checkbox entry. (I'm a novice please be gentle!)
  7. I am trying to send a php variable called $angle to another script called penalty.php along with an already establish variable called $goaly1 in a URL send method but can't get it going. I have the $goaly1 variable working on its own and I've added in the $angle form so it's probably that bit of the script that doesn't gel. Do I need the penalty.php instruction twice for example? Any suggestions would be appreciated. <html> <body> <form method="post" action="penalty.php"> <input type="checkbox" name="angle" value="1">Angle?</input> <?php $angle = $_POST['angle']; ?> <a href='penalty.php? angle=<?php echo $angle ?>& goaly1=<?php echo $goaly1 ?> '> draw it</a> </html>
  8. ok, i then printed the absolute path and then put this path back into the original script to get <?php const FETCH_URL = 'https://www.whoscored.com/Matches/829839/Live'; $curl = curl_init(FETCH_URL); curl_setopt($curl, CURLOPT_CAINFO, '/home/content/m/u/p/muppet77/html/footballstatistics.co/gd_bundle-g2.cer'); if (!$curl) { trigger_error('Failed to initialize cURL.', E_USER_ERROR); } if (!curl_setopt($curl, CURLOPT_RETURNTRANSFER, true)) { trigger_error('Failed to set cURL option.', E_USER_ERROR); } if (!curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true)) { trigger_error('Failed to set cURL option.', E_USER_ERROR); } $curl_response = curl_exec($curl); if ($curl_response === false) { trigger_error('cURL error: '.curl_error($curl), E_USER_ERROR); } echo $curl_response; curl_close($curl); ?> which output the same output error as post #19 Fatal error: cURL error: Unknown SSL protocol error in connection to www.whoscored.com:443 in /home/content/m/u/p/muppet77/html/footballstatistics.co/test.php on line 26
  9. just realised it is a .cer not .crt changed that part of the code and got this: Certificate chain OK. whoopeee!!
  10. Parse error: syntax error, unexpected '.', expecting ',' or ';' in /home/content/m/u/p/muppet77/html/footballstatistics.co/test3.php on line 3 which is this line const CERTIFICATE_CHAIN_PATH = __DIR__.'/gd_bundle-g2.crt';
  11. thank you for your help Jacques, I feel that we are close now. This scipt <?php const FETCH_URL = 'https://www.whoscored.com/Matches/829839/Live'; $curl = curl_init(FETCH_URL); curl_setopt($curl, CURLOPT_CAINFO, 'gd_bundle-g2.crt'); if (!$curl) { trigger_error('Failed to initialize cURL.', E_USER_ERROR); } if (!curl_setopt($curl, CURLOPT_RETURNTRANSFER, true)) { trigger_error('Failed to set cURL option.', E_USER_ERROR); } if (!curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true)) { trigger_error('Failed to set cURL option.', E_USER_ERROR); } $curl_response = curl_exec($curl); if ($curl_response === false) { trigger_error('cURL error: '.curl_error($curl), E_USER_ERROR); } echo $curl_response; curl_close($curl); ?> now gives this as you can see i added the certificate to the same folder as the script called test.php
  12. Please could a volunteer run the code in post 18 and see if it returns the page or gets an error code? Wondering if it is just me?
  13. line 26 is trigger_error('cURL error: '.curl_error($curl), E_USER_ERROR);
  14. thanks Jacques you mean to this? $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, "https://www.facebook.com/"); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); $text = curl_exec ($curl); echo $text; curl_close ($curl); yes! this works fine! but alas not for https://www.whoscored.com/Matches/829839/Live still a blank page?
×
×
  • 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.