PHP - Grab Some Server-side Data
Hello,
I want to grab some data using a script from this site.
But I am stuck right at the beginning. If you make a selection with the drop down boxes you get some output. For example you select:
Selecteer competitienaam: Najaarscompetitie 2014
Selecteer competitiegroep: Eredivisie dames Selecteer weergave: Programma (incl. uitslagen en stand) Optioneel poule filter: De Treffers R Selecteer poule(s): Eredivisie - Poule A I want to grab this output. When I look at the page source it is inside an iframe: <iframe src="http://www.nttb-competitie.nl/" width="100%" height="1200" scrolling="yes" frameborder="0" name="NTTB_Competitie"></iframe>I figured out: The script on the site first it gets url: http://www.nttb-competitie.nl/selectie.php?anr=0And after last selection it gets url: http://www.nttb-competitie.nl/web_programma.php?reset=0&pidString=1009267&sc=0&vastgesteldeAfdelingsnr=0&cnid=10085&cid=10704&view=programma&pf=1269&pid=1009267My problem is when I copy those URL's in a webbroser I get a page with only the words: Ongeldige aanroep!Which means "Invalid Call!" So my question is: How can I grab the data instead of this stupid message. Is it even possible or is it somehow protected? Please help! Similar TutorialsHello,
I want to grab some data from this site, using a script.
But I am stuck right at the beginning. If you go to the site, you can make a selection with the drop-down-boxes and get some output. For example if you select (left side: text on page in dutch / right side: translation in english):
Selecteer competitienaam: Najaarscompetitie 2014 Select league name: Autumn League 2014 Selecteer competitiegroep: Eredivisie dames Select league group: Eredivisie ladies Selecteer weergave: Programma (incl. uitslagen en stand) Select view: Program (including results and position) Optioneel poule filter: De Treffers R Optional group filter: De Treffers R Selecteer poule(s): Eredivisie - Poule A Select group(s): Premier League - Group A I want to grab the output you get after making all the selections. When I look at the webbrowser's page source the selections (drop-down-boxes) are inside an iframe from another domain: <iframe src="http://www.nttb-competitie.nl/" width="100%" height="1200" scrolling="yes" frameborder="0" name="NTTB_Competitie"></iframe>I figured out: First, the script gets url: http://www.nttb-competitie.nl/selectie.php?anr=0And after last selection it gets url: http://www.nttb-competitie.nl/web_programma.php?reset=0&pidString=1009267&sc=0&vastgesteldeAfdelingsnr=0&cnid=10085&cid=10704&view=programma&pf=1269&pid=1009267My problem is when I copy those URL's in a webbroser 's address bar, I get a page with only the words: Ongeldige aanroep!Which means "Invalid Call!" So my question is: How can I grab the data instead of this stupid message? Is it even possible or is it somehow protected? Please help! Here's the code that deals with the client side:
<?php session_start(); if(!isset($_SESSION['Logged_in'])){ header("Location: /page.php?page=login"); } ?> <!DOCTYPE Html> <html> <head> <!--Connections made and head included--> <?php require_once("../INC/head.php"); ?> <?php require_once("../Scripts/DB/connect.php"); ?> <!--Asynchronously Return User Names--> <script> $(document).ready(function(){ function search(){ var textboxvalue = $('input[name=search]').val(); $.ajax( { type: "GET", url: 'search.php', data: {Search: textboxvalue}, success: function(result) { $("#results").html(result); } }); }; </script> </head> <body> <div id="header-wrapper"> <?php include_once("../INC/nav2.php"); ?> </div> <div id="content"> <h1 style="color: red; text-align: center;">Member Directory</h1> <form onsubmit="search()"> <label for="search">Search for User:</label> <input type="text" size="70px" id="search" name="search"> </form> <a href="index.php?do=">Show All Users</a>|<a href="index.php?do=ONLINE">Show All Online Users</a> <div id="results"> <!--Results will be returned HERE!--> </div>search.php <?php //testing if data is sent ok echo "<h1>Hello</h1><br>" . $_GET['search']; ?>This is the link I get after sending foo. http://www.family-li...php?&search=foo Is that mean it was sent, but I'm not processing it correctly? I'm new to the whole AJAX thing. I wish to create validation rules once which are used both on the client and on the server.
For instance, I will start off with the following PHP object:
stdClass Object ( [rules] => stdClass Object ( [email] => stdClass Object ( [required] => 1 [email] => 1 [remote] => stdClass Object ( [url] => check-email.php [type] => post [data] => stdClass Object ( [username] => function() {return $( '#username' ).val();} ) ) ) ) [messages] => stdClass Object ( [email] => stdClass Object ( [required] => an email is required ) ) )When the edit page is downloaded to the client, I will include this object in some format suitable to the client. The client will then use the jQuery Validation plugin (http://jqueryvalidation.org/) along with the validation object, and client side validate the page. When the form passes client side validation and is uploaded, PHP will use the same validation object to serverside validate the form (I have this part working as desired). My question is how should I pass this data to the client? Originally, I would just use PHP to write some JavaScript. exit('var myObj='.json_encode($myObj));Note that when I json_encode the object, the value of $myObj->rules->email->remote->data->username is a string with quotes around it, however, I can easily use PHP to strip these tags before sending it to the client. As Jacques1 pointed out in http://forums.phpfre...ascript-client/, I should never ever use PHP to generate JavaScript, and should use AJAX to download the JSON directly. I tried doing the later, but found that a callback function could not be included in the JSON. Please advise on the best way to accomplish this. Thank you I have a web portal which is scripted using client side scripting language i.e HTML. I want to create a login page in .php and want the other pages to be in .hmtl. Can i do so? I want to do this because i want the login password to be stored in a database. Also I want the password to get encrypted (by either MD5 javascript or OpenSSL ) when user enters it inside the login form. I cannot create the entire portal in php because my portal makes use of C code. And php doesn't have an interface with C language. Can a user get directed to a .html page after a secure login from login.php page ? My main aim is to secure the access to my web portal using a password. I tried to authenticate the login using javascript where the password was stored in an array. But i feel any one having moderate knowledge can easily break that password. Any help would be greatly appreciated!! is it true that all the server side code runs before the client side code when accessing a webpage? if that is true, what about PHP code that is embedded inside HTML tags? wouldn't that result in an error a lot of times? Ok, so basically I have every column in the link below to work right and have the data for each column displayed....except for "Person" column. http://trigamer.com/forums/newest.php?fid=1 If you check there, you can see the posts, but not the poster. I'm thinking the 7th line from the bottom is the issue? Below is the PHP code for that section: Code: [Select] <!-- list threads--> <?php if($threads) {?> <tbody> <?php while($thread = mysql_fetch_array($threads) ){ #get last user to post $last_user = fetch("SELECT user FROM posts WHERE tid = ".$thread["tid"]." ORDER BY dateline DESC LIMIT 1"); if(!$last_user) $last_user = array(); ?> <tr bgcolor="#202025"> <td class="threadIcon"><img src="/images/posticon.png" /></td> <td class="threadTitle"><a href="replythread.php?tid=<?php echo $thread["tid"];?>"><?php echo $thread["title"];?></a></td> <td class="threadReplies"><font color=white><?php echo $thread["replies"];?></font></td> <td><font color=white><?php echo $last_user[0];?></font></td> <td><font color=white><?php echo date("m-d-Y",$thread["dateline"]);?></font></td> </tr> <?php } ?> </tbody> <?php }?> <!-- //end list threads--> I'm trying to build a calculator for a game...but I'm stuck on the extracting part. I don't really know how to go about it (so if you know of a tutorial/handbook please link), but how I would I extract this data: //data to extract $name = "Robin hood hat" $currentprice = "3.3m" $change = "+11.5k" //display echo $name echo $currentprice echo $change from: http://itemdb-rs.runescape.com/results.ws?query=robin hood hat I know about get_file_contents and doing it line by line...but that turns into a pain with many things to grab. Is there a way of grabbing it by table definition similarly to the way Google Docs does? Google Docs link format: =Index(ImportHtml("http://itemdb-rs.runescape.com/results.ws?query=Robin hood hat", "table", 2),2,4) This goes to the 2nd table, 2nd row, and 4th column for the "Change" data. I'm trying to learn how to validate a form using the php server side method. Everything I search is very different and old. Anyone have knowledge of a good tutorial or source that I could use? None of my books have anything about it either! Thanks! I have a text box and a submit button. I want that when the submit button is pressed, the value on the text box will be checked if it matches the values that are on my server before proceeding, and if they don't match it should give an error report and stop. All I can make myself is the text box and the submit button, I have tried for hours to find a way to do the rest, but all I can find on the internet are vague explanations and information that a novice like me cannot use. It would be a shame to let me web site that I have worked hard on to go to waste because I cannot do this myself Thank you in advance I am doing server side validations using php and jquery.Its validating properly.But problem is the erros messages are displaying on the top of the page.I want to display side of field.All of the validations store in array.How to display errors to side of the field. hello, since php is run server side, can i launch a program (.exe) on the server from a link? Hi all. I have a video upload page utilizing ffmpeg to convert to .flv format via ajax with progress bar. Currently I am having an issue where the user uploads the video however the same upload script also converts to .flv format (exec("ffmpeg -i etc..")) after the file is uploaded. This is working fine however if the user selects to move away from the page after the video is uploaded it is causing the users browser to lockup (and sometimes crash). How can I make the exec() command to convert the video format strictly run server side and allow the user to move away from the page even though the conversion is still processing? Thanks for any advise on how to handle this issue. Hey guys just thought I'd introduce myself as it's a polite thing to do.
My name is Nick I am currently a front end developer and love learning new technologies so it looks like PHP is my next step.
I hope to learn and give whatever knowledge I can back
I hope I'm posting in the correct forum. If not, I'm super sorry! Anyways, I need help with a website I'm working on. We have been asked to redesign our "Apply Online" page. My supervisor has asked that I find the correct code to make an upload button that will allow users to upload their resumes to our server, and send a copy to the specific branch they indicate (we have 17 branches). Could any of you point me in the correct direction for this code? I've seen several sites for Uploads to servers, but I'm worried this isn't exactly what we are looking for. Basically what I am trying to achieve is making sure any $page called originates from my server, but if no $page is defined, to include a default page I have set up. This is my code, and I cannot figure out what's wrong with it. Code: [Select] <?php $path = 'pages/'; $extension = '.txt'; if ( preg_match("#^[a-z0-9_]+$#i",$page) ){ $filename = $path.$page.$extension; include($filename); } if (!$page) include 'pages/main.txt'; ?> An example URL I am using is www.mywebsite.com/index.php?$page=pages/tester What am I doing wrong? Hi I am presently writing a code which does the following steps given a site 1) get some keywords (written a function for it) 2) search google for these keywords (I have used curl and getURL functions for these) 3) perform keyword search in the first page of googles results. Presently I have used curl and curl_multi_getcontent but when i run the code it consumes 100% of my server. My server will not respond in this case if someone else pings. I have been trying to do pcntl_fork, but could you let me know how to optimize this code by threading and forking. I am a newbe in PHP please let me know the structure of how to invoke multiple threads and process the same. If you have someother suggestions please let me know that too. Sorry if this is a silly question lol. I want to know if there is an online tool I can use to check and see what PHP code will ouput server side. For example: <?php $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); ?> I have a javascript code that displays a monster hitting my character via client side only. It runs every 2 seconds via a setTimeout function.
My problem is... A user could just disable javascript all together, or craft their own code to disable the monster attack function.
I want to detect serverside if anything is being altered. If that makes sense.
This is EXTREMELY hard for me to explain, I have no idea but my game is essentially turn based at this point. THE MONSTER ONLY DOES DMG if a player HITS IT. That way, I can safely, and change the values serverside with MYSQL.
What I want is the monster to attack the player every 2 seconds or so (Which I have javascript code for already), but a user could just manipulate that code and then attack the mob and receive only that damage. I want it to be more of an action attack game, where the monster's attack automatically, but securely... If that makes sense, any idea?
Would I have to implement some type of timing mechanism or something serverside? Or once the player spawned that mob..? Not sure. (You only have XX Seconds to kill!), but that doesn't really fix the problem..
TLDR: Autoattack mob system serverside.
Edited by Monkuar, 19 January 2015 - 10:53 AM. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321861.0 |