954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Putting URL'S in a PHP script

im trying to insert paypal donation code into a php file. i keep getting errors. so here is the code i have to work with.

<?
begin_block("Donate");
echo "<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>";
echo "<a href=\"member.php?mid=$row[mid]\">$row[login]</a>";
end_block();
?>

And here is the what i would like to insert into that php file

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="CP5UEJVJ9FG6C">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
vjw757
Junior Poster in Training
65 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Try replacing your first script with the following.

<?
begin_block('Donate');
echo '<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>';
echo '<a href="member.php?mid='.$row['mid'].'">$row[login]</a>';
end_block();
?>

Also don't forget to include the api file.

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

Try replacing your first script with the following.

<?
begin_block('Donate');
echo '<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>';
echo '<a href="member.php?mid='.$row['mid'].'">$row[login]</a>';
end_block();
?>

Also don't forget to include the api file.

thats the same code

vjw757
Junior Poster in Training
65 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 
thats the same code


If you read it more closely you will see that I changed how the array was added to the echo function and I changed the quotes type so you didn't have to escape the double quotes.

[edit]
Discovered a bug in my code...

<?
begin_block('Donate');
echo '<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>';
echo '<a href="member.php?mid='.$row['mid'].'">'.$row['login'].'</a>';
end_block();
?>

[/edit]

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

It isn't the same, he replaced double quotes with single quotes, check line 4. By the way, give us the error message you get from that code. Bye.

cereal
Master Poster
709 posts since Aug 2007
Reputation Points: 214
Solved Threads: 120
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You