473,699 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.pm l";

if($payment_sta tus == 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.co m/cgi-bin/affiliates/sale.cgi?paymen t=
$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.co m/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.co m/cgi-
bin/affiliates/sale.cgi?paymen t=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("curr ent_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 1793
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.pm l";

if($payment_sta tus == 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.co m/cgi-bin/affiliates/sale.cgi?paymen t=
$amount" border=0>

$amount must be interpreted as php:
<?=$amount?> or
print "<img
src=\"http://www.yoursite.co m/cgi-bin/affiliates/sale.cgi?paymen t=$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.co m/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.co m/cgi-
bin/affiliates/sale.cgi?paymen t=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("curr ent_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*******@blaz on1.com> wrote in message news:<Kr******* *************@c omcast.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.pm l";

if($payment_sta tus == 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.co m/cgi-bin/affiliates/sale.cgi?paymen t=
$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.p hp" 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.co m/cgi-bin/affiliates/sale.cgi?paymen t=<?=$amount?>"
border=0>

2. PHP with include:
ob_start(); //not really necessary. just for safe..
include( 'http://www.yoursite.co m/cgi-bin/affiliates/sale.cgi?paymen t='.$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
2352
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 way to trap the error without it killing the entire script. Is there something similar in PHP?
0
2900
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 support; both give the same errors. The "perl Makefile.PL" runs without errors, and finds all of the appropriate libraries. The "make" runs OK until the link statement, then I get all kinds of "Undefined symbol" errors. The ld command line...
0
2404
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 simplified version of their example (just a void hello() {printf("Hello, world!\n");} and corresponding .i interface file, %module hello \ extern void hello();). I first do swig -perl5 hello.i which works fine.
0
2569
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
2424
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 this morning to a mysql that wasn't answering connections, and that had left this in the log: 030716 13:48:06 InnoDB: Started mysqld got signal 11; This could be because you hit a bug. It is also possible that this binary or one of the...
19
1482
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 on the old AIX system. The only co-worker within reach who seems to know more C than I do had no clue either. I have put the error messages and excerpt from the source file in question at http://cpacker.org/aa.txt
4
2100
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 ioctl for device I can't find any information on these errors. Does anyone have an idea what they mean and indicate?
13
2094
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
2613
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 getting seven loops of Can not open shawneechamber.txt for reading: Bad file descriptor. Has anyone had this problem? I am on xp and installed v5.8.7 build for MSWIN32-x86 I am having the same problem at work and at home. I thank you for your...
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9172
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7745
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.