Search Results
… code is what I came up with. $username = 'philipnorton42'; $scrobbler_url = "http://ws.audioscrobbler.com/2.0/user/" . $username . "/recenttracks"; if ($scrobbler_xml = file_get_contents($scrobbler_url)) { $scrobbler_data = simplexml_load_string($scrobbler_xml); echo … is the name of the album that the track belongs to (e.g. "Nocturnal"). url : This is a URL that links back to the track information on the …
… is issued and the page redirected. if ($_SERVER['HTTPS'] == 'on') { $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header('Location: ' . $url, true, 301); exit(); } You can turn it back on again on your secure pages using the opposite. if ($_SERVER['HTTPS'] != 'on') { $url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; …
… ($this->files as $file) { echo '<li>'.$file. ' <a href="'.$this->url(array('controller'=>'pdf', 'action'=>'viewmeta', 'file' => urlencode($file)),'default', true).'" title="View PDF Meta">View Meta</a>' . ' <a href="'.$this->url(array('controller'=>'pdf', 'action'=>'editmeta', 'file' => …
Article: PHP Streams
… to the script. Let's say we called a script with the following curl request. curl -X POST -d "data1=thing" -d "data2=anotherthing" … For example, when we use the file_get_contents() function to access a URL it will always do this using a GET request. echo …
… file there is no point in adapting this script so that it creates a urllist.txt file. The best solution is to use this sitemap.xml file to create the urllist.txt. The following script will do exactly this. $lines = … = $matches[0][0]; }; }; }; $list = ''; foreach ( $allMatches as $url ) { $list .= $url."\n"; }; $fh = fopen('urllist.txt', "w+"); …
Article: Playing With ReactPHP
… getJSON() function. The first parameter of this function is the full URL to our ReactPHP server (including the port), which must contain a … } ); } When we run this code it will send a request to the following URL structure. … run the following command in the directory you want to work from. curl -s https://getcomposer.org/installer | php This will download a …
Article: Getting Started With Zend_Lucene
… Note that when adding documents in this way you should also add the URL of the document as a field so that you can retrieve it later. $doc … $doc->addField(Zend_Search_Lucene_Field::Text('url','http://www. hashbangcode.com/')); $index->addDocument($doc); You … is now presented as a property of this object. So if you set a URL field for your document you can see a list of your documents using …
Article: PHP Custom Stream Wrappers
… and file_get_contents()). * * @param string $path * Specifies the URL that was passed to the original function. * @param string $mode * … stream_wrapper_register('http', 'MockHttpStreamWrapper', STREAM_IS_URL); We pass in 'http' as the stream type and the class name … parameter is any additional flags, which should be set to STREAM_IS_URL if protocol is a URL protocol (which we are setting here). The …
… contain the full output of phpinfo(). To use this output, go to the URL http://xdebug.org/find-binary.php and paste it into the text area. … in Netbeans it will open up a web browser (as stated before) but the URL that it opens is the one that you set when you created the project. … (stored in a nbproject folder) then you should double check the URL before you start. With your project selected, open the project …
Article: Redirecting The Page In PHP
… can be used to redirect the page in the same way. // set up redirect URL $url = "http://www.hashbangcode.com"; if ( headers_sent() ) { // … "; exit(); } else { // otherwise use the php way. header("Location:".$url); exit(); } This works as long as the user has JavaScript turned …