943,096 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 586
  • PHP RSS
Jan 30th, 2010
0

Putting URL'S in a PHP script

Expand Post »
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.
PHP Syntax (Toggle Plain Text)
  1. <?
  2. begin_block("Donate");
  3. echo "<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>";
  4. echo "<a href=\"member.php?mid=$row[mid]\">$row[login]</a>";
  5. end_block();
  6. ?>


And here is the what i would like to insert into that php file
PHP Syntax (Toggle Plain Text)
  1. <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  2. <input type="hidden" name="cmd" value="_s-xclick">
  3. <input type="hidden" name="hosted_button_id" value="CP5UEJVJ9FG6C">
  4. <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!">
  5. <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
  6. </form>
Last edited by nav33n; Jan 30th, 2010 at 9:16 am. Reason: Please wrap your code in [code][/code] tags for easy readability.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
vjw757 is offline Offline
65 posts
since Jun 2005
Jan 30th, 2010
0
Re: Putting URL'S in a PHP script
Try replacing your first script with the following.
PHP Syntax (Toggle Plain Text)
  1. <?
  2. begin_block('Donate');
  3. echo '<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>';
  4. echo '<a href="member.php?mid='.$row['mid'].'">$row[login]</a>';
  5. end_block();
  6. ?>
Also don't forget to include the api file.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,003 posts
since Sep 2007
Jan 30th, 2010
0
Re: Putting URL'S in a PHP script
Click to Expand / Collapse  Quote originally posted by cwarn23 ...
Try replacing your first script with the following.
PHP Syntax (Toggle Plain Text)
  1. <?
  2. begin_block('Donate');
  3. echo '<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>';
  4. echo '<a href="member.php?mid='.$row['mid'].'">$row[login]</a>';
  5. end_block();
  6. ?>
Also don't forget to include the api file.
thats the same code
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
vjw757 is offline Offline
65 posts
since Jun 2005
Jan 30th, 2010
0
Re: Putting URL'S in a PHP script
Click to Expand / Collapse  Quote originally posted by vjw757 ...
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...
PHP Syntax (Toggle Plain Text)
  1. <?
  2. begin_block('Donate');
  3. echo '<BR><BR><CENTER>This would need to contain your donation code, or something. maybe even a paypal link</CENTER><BR><BR>';
  4. echo '<a href="member.php?mid='.$row['mid'].'">'.$row['login'].'</a>';
  5. end_block();
  6. ?>
[/edit]
Last edited by cwarn23; Jan 30th, 2010 at 9:25 am. Reason: added info
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,003 posts
since Sep 2007
Jan 30th, 2010
0
Re: Putting URL'S in a PHP script
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.
Reputation Points: 201
Solved Threads: 83
Posting Pro
cereal is online now Online
514 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: basic login and re-direct
Next Thread in PHP Forum Timeline: Create an email system that hides the email addresses of users.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC