473,382 Members | 1,622 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,382 software developers and data experts.

imagecreatefrom and dynamic graphics

I'm trying to get an image to analize by
imagecreatefrompng(http://www.domain.pl/png.php);

The file png.php is generating a PNG file different for all logged users in
domain (cookies are used in this process).

I want to get this graphic from another domain e.g. domain2 by
imagecreatefrompng and analize it.
Problem is that - if I get this image straight to HTML by <img
src="http://www.domain.pl/png.php"> everything is ok. But if I'm using
imagecreate... the png.php file is not using it domains' cookie.

Can you solve my problem?

Krzysztof Kujawski

Soryy about all mistakes in English.
Jul 17 '05 #1
8 6323
"Krzysztof Kujawski" <kr****************@zhp.pl> wrote in message
news:bt**********@atlantis.news.tpi.pl...
I'm trying to get an image to analize by
imagecreatefrompng(http://www.domain.pl/png.php);

The file png.php is generating a PNG file different for all logged users in domain (cookies are used in this process).

I want to get this graphic from another domain e.g. domain2 by
imagecreatefrompng and analize it.
Problem is that - if I get this image straight to HTML by <img
src="http://www.domain.pl/png.php"> everything is ok. But if I'm using
imagecreate... the png.php file is not using it domains' cookie.

Can you solve my problem?

Krzysztof Kujawski

Soryy about all mistakes in English.


tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php
--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #2
> tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php


thanks... but how?
Krzysztof Kujawski
Jul 17 '05 #3
"Krzysztof Kujawski" <kr****************@zhp.pl> wrote in message
news:bt**********@atlantis.news.tpi.pl...
tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php


thanks... but how?
Krzysztof Kujawski

First, figure out exactly what you need to do. Without knowing too much
about it, I would suggest the following , assuming your using windows

use a browser, and grab the image in the address bar.
once its on the screen, go to your cookie directory, and open up the
domain.txt file

look at the cookie.

then in the script:
$useHeader = "GET _URI_ HTTP/1.0\n".
...
...
...
"Cookie: item=data".
...
...
"Connection: Close\n";
if you want to spy on the headers, to see what is being sent, use this
program:
http://www-2.gzentools.com/sockview.php

--
Mike Bradley
http://www.gzentools.com -- free online php tools

Jul 17 '05 #4
> tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php


I don't want to send a cookie, I want that connection via socket to use
cookies from that domain where I'm connecting.

Krzysztof Kujawski
Jul 17 '05 #5
"Krzysztof Kujawski" <kr****************@zhp.pl> wrote in message
news:bt**********@atlantis.news.tpi.pl...
tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php


I don't want to send a cookie, I want that connection via socket to use
cookies from that domain where I'm connecting.

Krzysztof Kujawski


Ok, you do not want to send a cookie, but you want to use cookies from the
domain its connecting to.

Got news for you, you are sending a cookie, I was trying to show you how to
look at what is being sent. becouse it might be looking for a cookie that
was sent from the page, and passed to the image script.

More news for you, this is beyond your ability if you do not understand what
is going on in the trasaction.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #6
> Got news for you, you are sending a cookie, I was trying to show you how
to
look at what is being sent. becouse it might be looking for a cookie that
was sent from the page, and passed to the image script.

Hmm. I've watched headers of this connection, and there is no cookie header.
Maybe I should explain what exactly am I doing..

I have two domains: domain and domain2.
I log in user to domain via another scripts and sending cookies for domain.
png.php script makes PNG-file with encoded information about user that is
logged.
In domain2 I want to read PNG-file with that information and decode it.

In headers that was send (I've installed sockView) there is no cookie header
(and I think it's normal because browser doesn't take a part in reading
PNG-file from png.php - ready PNG-file is output for browser).

I undestand what is going in the transaction, but I can't see solution of
this problem.

I think this will be useful for better contact.

Krzysztof Kujawski
Jul 17 '05 #7
Well, maybe you can get away with not using cookie if the other site has
session.use_trans_sid turned out. In that case you can pass PHPSESSID
through the URL. And if the other site has register_globals turned on, you
might be able to log in by passing the username and password through the
URL.

Uzytkownik "Krzysztof Kujawski" <kr****************@zhp.pl> napisal w
wiadomosci news:bt**********@atlantis.news.tpi.pl...
tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php


I don't want to send a cookie, I want that connection via socket to use
cookies from that domain where I'm connecting.

Krzysztof Kujawski

Jul 17 '05 #8
Chung Leong wrote:
Well, maybe you can get away with not using cookie if the other site has
session.use_trans_sid turned out. In that case you can pass PHPSESSID
through the URL. And if the other site has register_globals turned on, you
might be able to log in by passing the username and password through the
URL.

Uzytkownik "Krzysztof Kujawski" <kr****************@zhp.pl> napisal w
wiadomosci news:bt**********@atlantis.news.tpi.pl...
tweek this code to accept your cookies, or to send them:
http://www-2.gzentools.com/snippetvi...etresource.php


I don't want to send a cookie, I want that connection via socket to use
cookies from that domain where I'm connecting.

Krzysztof Kujawski


Maybe I'm missing something here, but it seems to me that the way to
make this work is to append your variables (whatever values are in the
cookies) to the png generator on the second domain. So, the request for
image.php would look like:
<img src='http://domainB/image.php?var1=1&var2=1&so_on_and_on=etc'>

Cookies from domainA aren't sent to domainB, and frankly, that's a GOOD
thing. For instance, if you're logging in to Alice's site, and ask it
to "remember" your info. your info would/could be saved in a cookie
(sessions would be better, but we're talking about cookies). If cookies
set on domainA (Alice's site) could be read by domainB (Malice's site),
then you'd essentially be giving your UID/PWs away to domainB, or really
any site you visit. That would be a pretty big security problem.

I think what you're missing is that the request for the image isn't
being sent from the client's web browser... it's being sent from the
domainB server, which doesn't, and shouldn't have access the cookies
domainA set on the client.

The client won't give domainA's cookies to domainB, so when domainB asks
for domainA's image, no cookies are sent along... and it's *supposed*
to work that way.

Hopefully that's a little clearer than mud. ;)

Regards,

- Dan
http://www.dantripp.com/
Jul 17 '05 #9

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

Similar topics

7
by: Craig Storey | last post by:
I have a little php application to store day hiking trips and to keep a running total of their yearly trips for a few users. Currently they select their hiking routes using drop lists or...
6
by: Robert J. O'Hara | last post by:
I'm one of those people who practices what some consider "dull" and others consider "elegantly conservative" page design. I appreciate good traditional typography and standards-compliant liquid...
0
by: Martin Schmid | last post by:
I have a aspx with the code below... I am trying to get the output from the Click redirect to display an image that may be right-clicked to 'save as'. The image displays as expected, but when...
4
by: tg | last post by:
Visual Studio 2003 My problem is that I am dynamically creating a datagrid on pageload. The datagrid is completely dynamic as it is based on the number of columns returned from a recordset. The...
2
by: webonomic | last post by:
Converting data types I'm trying to do some image manipulation. This code project article (http://www.codeproject.com/csharp/imageresize.asp) has a great method I want to modefy. Here it is: ...
1
by: code | last post by:
Hi Grp http://www.books-download.com/?Book=1493-PHP+Hacks+%3a+Tips+%26+Tools+For+Creating+Dynamic+Websites+(Hacks) Description Programmers love its flexibility and speed; designers love its...
11
by: toton | last post by:
Hi, I have little confusion about static memory allocation & dynamic allocation for a cluss member. I have class like class Bar{ public: explicit Bar(){ cout<<"bar default"<<endl; }
2
by: Rich | last post by:
Hello, Some database applicatins have a tooltip feature where when you are dragging the scrollbar of the table view a tooltip appears next to the mouse cursor displaying the approximate record...
1
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm wondering if it's possible to create dynamic transparent images in asp.net 2.0? This is some code (see below) from my web project. In this code below I create a...
0
by: pinxi | last post by:
We are seeking to hire a lead programmer to build a dynamic Web-based imaging module which will enable users to upload a digital image or photograph to the site and choose from thousands of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.