473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

getting other webpage results in to php page

Hi,

I Have a page which will take authentication from a diffrent page from
a difrent website.

My program needs to call a page like this from php page lets say:
http://www.abc.com?handshake.jsp?use...token=94399843
my php page is at www.xyz.com
based on this url's response i need to print the result on my php page?

I tried this..

$url="http://120.126.79.21:6080/AutoPrintWeb/apvalidator.jsp?tempid=$tempid&authtoken=$authtoke n&ipaddress=$rmtadd";
$fp = fopen($url, 'r');
$response1=stream_get_meta_data($fp);
print_r($response1);

The reukt is like this:

Array ( [wrapper_data] => Array ( [0] => HTTP/1.1 200 OK [1] => Server:
Apache-Coyote/1.1 [2] => Set-Cookie:
JSESSIONID=B55CA82D1790D6C0A9E20ED1CEDBB1B9; Path=/AutoPrintWeb [3] =>
Content-Type: text/html;charset=UTF-8 [4] => Content-Length: 382 [5] =>
Date: Fri, 10 Mar 2006 10:22:41 GMT [6] => Connection: close )
[wrapper_type] => http [stream_type] => tcp_socket [mode] => r+
[unread_bytes] => 382 [seekable] => [uri] =>
http://193.186.79.21:6080/AutoPrintW...ress=127.0.0.1
[timed_out] => [blocked] => 1 [eof] => )
I need only sucesss or fail..

Plz guide me. Thanks in advance.

Sharma

Mar 10 '06 #1
2 1394
File_get_contents($url)
done the magic...

SHARMA

Mar 10 '06 #2
ok something is missing or what not... its driving me nuts. what is
missing???

<?

class textPNG {
var $font = 'fonts/TIMES.TTF';
var $msg = "undefined";
var $size = 24;
var $rot = 0;
var $pad = 0;
var $transparent = 1;
var $red = 0;
var $grn = 0;
var $blu = 0;
var $bg_red = 255;
var $bg_grn = 255;
var $bg_blu = 255;

function draw() {
$width = 0;
$height = 0;
$offset_x = 0;
$offset_y = 0;
$bounds = array();
$image = "";

$bounds = ImageTTFBBox($this->size, $this->rot, $this->font, "W");
if ($this->rot < 0) {
$font_height = abs($bounds[7]-$bounds[1]);
} else if ($this->rot > 0) {
$font_height = abs($bounds[1]-$bounds[7]);
} else {
$font_height = abs($bounds[7]-$bounds[1]);
}

$bounds = ImageTTFBBox($this->size, $this->rot, $this->font,
$this->msg);
if ($this->rot < 0) {
$width = abs($bounds[4]-$bounds[0]);
$height = abs($bounds[3]-$bounds[7]);
$offset_y = $font_height;
$offset_x = 0;

} else if ($this->rot > 0) {
$width = abs($bounds[2]-$bounds[6]);
$height = abs($bounds[1]-$bounds[5]);
$offset_y = abs($bounds[7]-$bounds[5])+$font_height;
$offset_x = abs($bounds[0]-$bounds[6]);

} else {
$width = abs($bounds[4]-$bounds[6]);
$height = abs($bounds[7]-$bounds[1]);
$offset_y = $font_height;;
$offset_x = 0;
}

$image = imagecreate($width+($this->pad*2)+1,$height+($this->pad*2)+1);

$background = ImageColorAllocate($image, $this->bg_red, $this->bg_grn,
$this->bg_blu);
$foreground = ImageColorAllocate($image, $this->red, $this->grn,
$this->blu);

if ($this->transparent) ImageColorTransparent($image, $background);
ImageInterlace($image, false);

ImageTTFText($image, $this->size, $this->rot, $offset_x+$this->pad,
$offset_y+$this->pad, $foreground, $this->font, $this->msg);

imagePNG($image);
}
}

$text = new textPNG;

if (isset($msg)) $text->msg = $msg;
if (isset($font)) $text->font = $font;
if (isset($size)) $text->size = $size;
if (isset($rot)) $text->rot = $rot;
if (isset($pad)) $text->pad = $pad;
if (isset($red)) $text->red = $red;
if (isset($grn)) $text->grn = $grn;
if (isset($blu)) $text->blu = $blu;
if (isset($bg_red)) $text->bg_red = $bg_red;
if (isset($bg_grn)) $text->bg_grn = $bg_grn;
if (isset($bg_blu)) $text->bg_blu = $bg_blu;
if (isset($tr)) $text->transparent = $tr;

$text->draw();
?>

Mar 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: David Walker | last post by:
Hi I have a program which I need to interface with a webpage - the webpage will accept an input (probably a 'post' string from the program) and then will process it and needs to return a value. ...
2
by: Patrick Olurotimi Ige | last post by:
When i run the code below with stored proc :- I get only the first table results :-"templates" even if i fill the dataset with another table for example category,pages etc.. Any ideas? ...
0
by: tomslater2003 | last post by:
Hi! I wanted to know if there is any possibilites to export search results of a particular webpage to excel? I have a website where in search for a specific criteria. After selecting the...
12
by: M.L. | last post by:
When loaded from my hard drive, the webpage I'm working on renders fine on IE6, Firefox 2.0.0.1, and Opera 9.02. However, after uploading it to the web there are 2 images that fail to display on...
9
by: =?Utf-8?B?UmF5?= | last post by:
Have SQL server on one machine. Have IIS on another machine in same large intranet. Have website in IIS with Basic Authentication turned on and other options deselected. Have webpage (.aspx) with...
1
by: Patrick C | last post by:
Greetings, i'm a total amateur using py 2.5 on Win XP... I posted a similar message last week and I made the suggestion, yet I'm ending up with the same problem... In my script after I ask it...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
29
by: Chris Riesbeck | last post by:
I have an image with a class and the class defines a clip rectangle. In Firefox 2 and 3, and Opera 9, I can access the rectangle with document.defaultView.getComputedStyle(). But that doesn't...
6
denny1824
by: denny1824 | last post by:
On the webpage I use a view to fill a dataset. strCommand = "Select * from view" objConnection = New SqlClient.SqlConnection(strconnect) objCommand = New SqlClient.SqlDataAdapter(strCommand,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.