PHP - Accessing Another Page
I am a part of an institue which has internal web pages. It also provides me with my web space with php servers. Now I know those internal web pages are available to the server. I want a code that can fetch those web pages and display it in my web space. And whatever forms i fill or links i click it should do those on internal page and again return the new web page.
Similar TutorialsHow do I access an object on different pages? I created object "A" on pageone.php and I need to access it on pagetwo.php. How do I do that? TomTees I have a registration page that mails a link to the users email. The link in the email takes the user to the activation page which sends out a welcome email and updates the database as activated if the user is not already activated. For some reason, this page is being accessed by an Amazon ip address with multiple browsers in the user_agent. Whatever this is is automatically activating my users and sending them a welcome email without them even accessing the page. The only suspect I can think of is I have a javascript snippit for google ads and also facebook on some of my pages. I don't know if they could somehow be accessing the page or not. It must be following the activation link in the mail() script I have on the registration page. I'm mailing myself the following when the activation page is accessed. I get an amazon ip, multiple browsers, and no referer. $browser = $_SERVER['HTTP_USER_AGENT']; $ip = $_SERVER['REMOTE_ADDR']; $referer = $_SERVER['HTTP_REFERER'];
Hello, I want to prevent this page from being directly accessed by all via just putting its address in the address bar: http://www.mysite.com/page1/page2/signup.php I want to allow to be accessed this page only via clicking on a link in a particular page like: http://www.mysite.com/activate/index.php Please help me. Is there any way to access a variable that is not assigned until further down the page eg: echo $myname; $myname = 'batman'; // clearly my real name which is why I am so poor at coding Thanks If $result contains the result of mysql_query, a select count distinct query, how do I access the count? I've tried $result[0] to no avail and $result only returns the resource #. Hi guys, I have xml that looks like: <item> <title></title> <link></link> <description></description> <dc:date>2011-02-27T16:42:31-05:00</dc:date> </item> I can access title, link, and description just fine. But how do I access a tag that has a colon? I tried this: Code: [Select] $x = new SimpleXmlElement($content); $entry = $x->item; $entry->children('dc', true)->date; Thanks for looking. LR HEy Guys Here is a snippet of an array: SimpleXMLElement Object ( [report1] => SimpleXMLElement Object ( [ReportHost] => Array ( => SimpleXMLElement Object ( [HostName] => 192.168.2.34 [startTime] => Thu Dec 17 13:58:49 2009 [stopTime] => Thu Dec 17 15:13:13 2009 [netbios_name] => (unknown) [mac_addr] => (unknown) [dns_name] => (unknown) [os_name] => (unknown) [num_ports] => 2 [num_lo] => 0 [num_med] => 0 [num_hi] => 0 [ReportItem] => Array which is printed using print_r($a) now how can i access [HostName] => 192.168.2.34 in the $a array?? Thanks in advance Is it possible to have a class access another class it its parent directory without using a fully qualified name? While the following script is not valid, it is how I would have thought it would be done should it be possible. If it is not possible, I expect there is a good reason why one would not want to do so, and would appreciate your thoughts why that is so. Thanks // src/PrimaryTopic/SubTopic/SubSubTopic/ParentClass.php namespace PrimaryTopic\SubTopic\SubSubTopic; class ParentClass {} // src/PrimaryTopic/SubTopic/SubSubTopic/Child/ChildClass1.php namespace PrimaryTopic\SubTopic\SubSubTopic\Child; class ChildClass1 extends ..\ParentClass {} // src/PrimaryTopic/SubTopic/SubSubTopic/Child/ChildClass2.php namespace PrimaryTopic\SubTopic\SubSubTopic\Child; class ChildClass2 extends ..\ParentClass {}
Hi all, I've tried to access the admin.php of the xcart installation he http://www.cleaningshopuk.com but it doesn't allow me to access it, saying that it's a 404 page not found error. That page does in fact exist, but I think the issue might be something to do with a redirection. The site owner apparently clicked on something in the admin section (possibly https or something similar) but what can I do to avoid this issue without having to re install everything? Thanks, Neil I have the following code in zend: Code: [Select] $arrErrors=array(); if (!empty($this->post['submit'])) { // Each time theres an error, add an error message to the error array // using the field name as the key. if (empty($this->post['client_name'])) $arrErrors['client_name'] = "Please Enter Client's name as it appears in the carrier software"; } if i set $this->view->arrErrors=$arrErrors in the controller, Can I access it as $this->arrErrors['client_name'] in the view? Hey everyone, I'm creating a website which requires users to login. I didn't want to have to do my own crypto, so I basically created it with Wordpress. I'm at the point where I don't want to use Wordpress for the whole site--just the login system. So I was wondering how I can piggyback off the user management system of Wordpress while using my own script for the rest of the site. I know that Wordpress ends up storing passwords in the database as HMACs, for what that's worth. Thank you, Ryan Hello All: I am trying to access a value within an object. The value name has whitespace in it and is called "zip code". When I try to access the value via regular object call such as: Code: [Select] $sub = $sub->zip code; PHP goes crazy on me. I've tried to encapsulate the value name within a variable like this: Code: [Select] $zip_code = "Zip Code"; $sub = $sub->zip_code; and that doesn't work either. Does anyone have any ideas about how I should go about yanking the data out? I use a CURL script API with the header "$headers[] = 'Content-Type: application/json';" The script ends with "$result = curl_exec($ch);" If I simply echo the $result to my browser, I get an array that looks like this:
stdClass Object
[toAddress] => stdClass Object Do I really need to "json_decode" this array? I've spent 2 1/2 days trying every which way, with every permutation to access that one value:
echo $result["fromAddress"]["phone"]; Unfortunately I must have fallen asleep during the array lesson in PHP class ? Thank you. Can somebody help me what i'm doing wrong? The value from database is not visible when using: <?php $artikel = new Artikel(); $content= $artikel->printArtikel(); echo $content; ?> <?php class Artikel { // db connection protected $mydb; // database value protected $land; public function __construct($artikelnummer = false) { // databaseconnection: $this->mydb = new MyDB(); if($artikelnummer) { $this->load($artikelnummer); } else // load everything from database. { $sql = "SELECT * FROM artikel"; $this->mydb->doQuery($sql); $this->mydb->close(); } } public function load($artikelnummer) { $sql = "SELECT * FROM artikel"; $this->mydb->doQuery($sql); if($artikel = $this->mydb->fetch()) { // i got a feeling there is something missing here, like query from database?? } $this->mydb->close(); } public function printArtikel() { // return database value as table. $html = "<table border='1'>"; $html .= "<tr> <td>".$this->land."</td> </tr>"; $html .= "</table>"; return $html; } } ?> Other class are accessing extern. For example database connection with class MyDB. please, can somebody correct my script?? So basically I'm using PHP to solve a math problem for me. The user puts in a few parameters and the program runs those numbers through the algorithm and spits out a bunch of xy coordinates. I'm using the PHP SELF method to retrieve the user input. This all works fine, but it's afterwords that I run into problems. I create a drop down menu of all the x values and I want the user to be able to choose any x value they wish and to have the corresponding y value be displayed. The problem is that I have to use another POST command for this and when I do, it wipes out all the computed data. Of course the y-value is never displayed, and there lies the problem. I'm sure there are many ways to get around this, but I could not find one out myself. Anyone have any ideas? Hi all, I am still trying to figure what went wrong. It doesn't work over here. The error shown was the {else} command else { echo '<p class="error">There was a problem accessing your profile.</p>'; } I have attached my 4 sql tables for reference. Appreciate any advices.... Code: [Select] <?php $query3 = "SELECT ols.subject_level_id, sl.level_id, sl.subject_id, tl.level_name AS level_name, ts.subject_name AS subject_name " . "FROM tutor_overall_level_subject AS ols " . "INNER JOIN tutor_subject_level AS sl USING (subject_level_id) " . "INNER JOIN tutor_level AS tl USING (level_id) " . "INNER JOIN tutor_subject AS ts USING (subject_id) " . "WHERE ols.tutor_id = '" . $_GET['tutor_id'] . "'"; $data3 = mysqli_query($dbc, $query3) or die(mysqli_error($dbc)); if (mysqli_num_rows($data3) == 1) { echo '<div id="panel4">'; echo'<table><tr>'; // Start your table outside the loop... and your first row $count = 0; // Start your counter while($row3 = mysqli_fetch_array($data3)) { /* Check to see whether or not this is a *new* row If it is, then end the previous and start the next and restart the counter. */ if ($count % 5 == 0) { echo "</tr><tr>"; $count = 0; } echo '<td class="label">' . $row3['level_name'] . '</td><td>' . $row3['subject_name'] . '</td>'; $count++; //Increment the count } echo '</tr></table><br/>'; //Close your last row and your table, outside the loop echo '</div>'; //End of panel 4 } //End of if (mysqli_num_rows($data3) == 1) else { echo '<p class="error">There was a problem accessing your profile.</p>'; } ?> Hello every1,
I'm trying to create a magazine wesite and I dont want anybody to access my images folder which is located in the root directory.
I want some thing like this...
I want to call the images in my website using <img> tag but I dont want any1 to access the directory directly.
It should also protect from software bots also like (HTTrack or website Copier)
It should show "Access forbidden".
Any help will be greatly appreciated.
Thank you...
This is a bit of a wierd problem, but I haven't been able to solve it so I thought I'd post it up here. Basically, I'm using the following function to access Maxmind's GEO IP database (so that I can target visitors to my site based on their location): <?php // This code demonstrates how to lookup the country by IP Address include("geoip.inc"); // Uncomment if querying against GeoIP/Lite City. // include("geoipcity.inc"); $gi = geoip_open("/home/bounce6/public_html/geoIP/GeoIP.dat",GEOIP_STANDARD); $ip=$_SERVER['REMOTE_ADDR']; $country=geoip_country_code_by_addr($gi, "$ip"); geoip_close($gi); ?> The function is being called using this line from a separate file: include "/home/username/public_html/mydomain.com/functions/getCountry.php"; Now the code does what it's supposed to do, in as far as it's able to give me a string which details where a visitor is located. However, for some strange reason it seems to be adding a new HTML tag into my existing header tag. The code which has been inserted is as follows: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> </body> </html> I've managed to isolate the problem to this script, so I know that there must be an issue with it, but I'm not quite sure what it is. Can anyone suggest why this extra source code is being produced? Is there a particular function that I'm using which is forcing additional headers or something?! Any thoughts would be really appreciated! Hi. I was asked to make a portal to facilitate access information of the company. There are databases in MSSQL and Oracle, and products made in PHP. NET and access to two different server files via network shares. Also as a facilitator wanted access to the files (default documents) on the local machines of users. I've done something, but now I'm locked in for remote access client machines. Is there any way to do this in PHP? and using another type of language? I am trying to write a phone script that will accept a file uploaded by a user, read and alter the file byte by byte then return the file to the user. The class that alters the file I have already written but I don't know how to accept the uploaded file data, how to read it byte by byte, what to do with the altered data until the file alteration is complete, and how to return it to the user. Any help would be greatly appreciated. |