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

Errors using php and Perl

I'm trying to intergrate a cgi affiliate tracking system into a php
website. When someone pays using PayPal it's supposed to direct them to one
page if the payment is a success or another if payment failed. This is the
code:

if($action == order && $order_n != "")
{

include "engine/card_process.pml";

if($payment_status == success)
{
$page = payment_success;
}
else
{
$page = payment_failed;
}
}
I'm trying to insert code into this process that will credit the affiliate
the correct amount if the process is a success. This is the code that's
supposed to be inserted to credit affiliates:

<img src="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment=
$amount" border=0>

I tried inserting this before the line "$page = payment_success;" in
various forms, but I either get errors, or the affiliate isn't credited, or
both. I managed to get the code to credit affiliates correctly, by
inserting this:

include "<img src='http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?
payment=$amount' border=0>";
but it also gives me errors:

Warning: main(): failed to open stream: No such file or directory in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 18

Warning: main(): Failed opening '<img src='http://www.yoursite.com/cgi-
bin/affiliates/sale.cgi?payment=0.01' border=0>' for inclusion
(include_path='.:/usr/share/pear') in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 18

Warning: session_start(): Cannot send session cookie - headers already sent
by (output started at
/home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 29

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 29

Warning: Cannot modify header information - headers already sent by (output
started at /home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 69

Line 18 is the inserted code, line 29 is:

session_start();

Line 69 is:

setcookie("current_page"' $page);

If you can help me I would appreciate it. I really don't have a clue about
what I'm doing. I'm just guessing. Also, the email address is valid.
Address harvesters are programmed to ignore email addresses that contain
the word "fake".
Jul 17 '05 #1
2 1776
R. Gregg Reed wrote:
I'm trying to intergrate a cgi affiliate tracking system into a php
website. When someone pays using PayPal it's supposed to direct them to
one page if the payment is a success or another if payment failed. This is
the code:

if($action == order && $order_n != "")
{

include "engine/card_process.pml";

if($payment_status == success)
{
$page = payment_success;
}
else
{
$page = payment_failed;
}
}
I'm trying to insert code into this process that will credit the affiliate
the correct amount if the process is a success. This is the code that's
supposed to be inserted to credit affiliates:

<img src="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment=
$amount" border=0>

$amount must be interpreted as php:
<?=$amount?> or
print "<img
src=\"http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment=$amount\"
border=0>";
I tried inserting this before the line "$page = payment_success;" in
various forms, but I either get errors, or the affiliate isn't credited,
or both. I managed to get the code to credit affiliates correctly, by
inserting this:

include "<img src='http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?
payment=$amount' border=0>";
but it also gives me errors:

Warning: main(): failed to open stream: No such file or directory in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 18

Warning: main(): Failed opening '<img src='http://www.yoursite.com/cgi-
bin/affiliates/sale.cgi?payment=0.01' border=0>' for inclusion
(include_path='.:/usr/share/pear') in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 18

Well, it doesn't make much sense, 'include' is used for including php files.
Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at
/home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 29

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in
/home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 29

Warning: Cannot modify header information - headers already sent by
(output started at /home/httpd/vhosts/yoursite.com/httpdocs/index.php:18)
in /home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 69

This is normal... no cookies after errors.
Line 18 is the inserted code, line 29 is:

session_start();

Line 69 is:

setcookie("current_page"' $page);

If you can help me I would appreciate it. I really don't have a clue about
what I'm doing. I'm just guessing. Also, the email address is valid.
Address harvesters are programmed to ignore email addresses that contain
the word "fake".


Well, I don't think that's quite enough to detect a fake address...
Take it easy,
Ivan

Jul 17 '05 #2
"R. Gregg Reed" <fa*******@blazon1.com> wrote in message news:<Kr********************@comcast.com>...
I'm trying to intergrate a cgi affiliate tracking system into a php
website. When someone pays using PayPal it's supposed to direct them to one
page if the payment is a success or another if payment failed. This is the
code:

if($action == order && $order_n != "")
{

include "engine/card_process.pml";

if($payment_status == success)
{
$page = payment_success;
}
else
{
$page = payment_failed;
}
}
I'm trying to insert code into this process that will credit the affiliate
the correct amount if the process is a success. This is the code that's
supposed to be inserted to credit affiliates:

<img src="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment=
$amount" border=0>

I tried inserting this before the line "$page = payment_success;" in
various forms, but I either get errors, or the affiliate isn't credited, or
both. I managed to get the code to credit affiliates correctly, by
inserting this:


<snip>

Few things to point out:

1. include syntax is wrong. It should be include "filename.php" or
include "http://someurl.foo" (see <www.php.net/include>)
2. In PHP, single quote is different from double quotes. See the
manual to findout the differences.
3. I could see some security issues in your PayPal system. Google for
PayPal IPN
4. http://in.php.net/outcontrol

This can be achieved in two ways:
1. Web bug thing:
<p>something else</p> <img
src="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment=<?=$amount?>"
border=0>

2. PHP with include:
ob_start(); //not really necessary. just for safe..
include( 'http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment='.$amount
);
ob_end_clean(); //see ob_start() above

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

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

Similar topics

1
by: Spike | last post by:
Is there a clean way to trap errors in PHP? In Perl there is eval { <code> } and a special variable that can be checked to see if the execution of the code was successful or not, and thus a clean...
0
by: Vince | last post by:
I'm getting link errors trying to install DBD::Sybase 1.0 on AIX 5.1, running Sybase 12.5.0.3 64-bit and Perl 5.8.0. DBI installed fine. I have tried building DBD::Sybase with both 32 and 64-bit...
0
by: ReaprZero | last post by:
Hi, I'm using Cygwin and ActiveState perl to try to compile a sample application using SWIG. I'm using the short tutorial from http://www.swig.org/tutorial.html (the perl part of it), but with a...
0
by: r | last post by:
Hello, I'm testing a Perl application Is it possible to retrieve a log for CGI errors when using IIS. If so, how? I'm running WinXPPro, IIS, & activestate Perl. Thanks, R
0
by: dsclements | last post by:
>Description: I'm running mysql in a 3 server configuration, with 2 servers being slaves to the first. I'm running vpopmail, which means a connection every incoming mail and every check. I woke up...
19
by: mailbox | last post by:
In trying to build the Perl Curses module (Curses-1.12) under Perl 5.8 on a new AIX box I came up against the limits of my C as well as my Unix knowledge. The thing had built okay under Perl 5.6...
4
by: Keary Suska | last post by:
I received the following errors from an automated full vacuum: vacuumdb: vacuuming of database "milemgr" failed: ERROR: tuple concurrently updated ERROR: Vacuum command failed: Inappropriate...
13
by: squash | last post by:
I am a little annoyed at why such a simple program in Perl is causing so much difficulty for python, i.e: $a += 200000 * 140000; print $a;
8
by: jaynemarie | last post by:
I am new to using Active State Perl, I've use Perl on Linux and Unix systems and the same thing on unix systems don't work with active state and I am perplexed. I wrote the code below and I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.