Anyone here know PhP?

  • 1
  • Question
  • Updated 8 years ago
  • Answered
I have a question or two regarding inserting info from database! If you can help, please reply!
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
  • http://youcanneverbetoosmart.com

Posted 8 years ago

  • 1
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Yes, Donald, ask and you shall receive. LOL :)

But seriously, what you need help with?
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Oh, and if you don't want to ask or post it here, you know my email right?
Photo of SilverX

SilverX

  • 492 Posts
  • 40 Reply Likes
Donald,
dan is the best php-er I've ever seen.

His site is teamironblood.
Go there and find him!
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Ah shux ;)

LOL my main site is down for a "flashy" renovation. Here is my email if ya need it Donal owner@teamironblood.org
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
lol, hey... I was trying to figure out how to get my register.php into an elseif! Currently it's set to...

if logged in, email, website, location shows under My Account Info and else ... it goes away. However, I thought it would be nice to have my register.php included if logged out. When trying to include it, problems start to happen.

here's my page... http://ycnb2s.zymichost.com - go ahead, register and login - it should be working! And don't come back to me and say it's not working, I'll throw my computer!
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
ok, another question...

Register form (to register for your site) accesses a database and inserts a query...

Is there a way, to make the submit button link to paypal and is there a way to prefil a paypal's form? Also, is it possible to have the query inserted into the database ONLY if a paypal order was completed? I'm looking to minimize manual work for a project!
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Hey Donald,

I tried to register, but the registration page came up blank.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Hey Donald,

I tried to register, but the registration page came up blank.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Hey Donald,

I tried to register, but the registration page came up blank.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Hmm, that's weird. I don't know why it posted three times.
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
I thought I said I would throw my computer if you said that! lol... anyways, my page's tend to delete themselves... good thing for backups... it's working now! :) be sure to fill in the not required information to get the full feel. That information will show in your account info! :)
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
Here, register at this one too... http://1stop-martial-arts.zymichost.com/ - you'll notice a difference between register forms. This one I've added things and customized it myself and everything properly adds a query to the database from the test I did. However, I'm trying to figure an if statement for this form! I want an If statement as follows...

if bronze radio button, then submit button links to my account info or homepage
if silver radio button, then submit button links to paypal to pay for silver package
if gold radio button, then submit button links to paypal to pay for gold package
if platinum radio button, then submit button links to paypal to pay for platinum package

This would be a nice feature! :)
Photo of SilverX

SilverX

  • 492 Posts
  • 40 Reply Likes
Hi donald ,
your log in works great.
I chose not to show my email address, but it shows.
I think you need to change your 'age' field to 'birth year' field.(is this a discardable site for 1 year?)

unfortunately , we can't prefil paypal donate/subscribe buttons in an unverified accounts.

If you have a verified account , skip this.

To accept payments through donation-like transactions, go to Paypal's donation button creator and specify a minimum value as your yearly payment.Set your account as who pays for the transaction cost. Then , simply put a single line text field infront of the subscribtion plan(to put the transaction stamp code).

Do the same with the next level subscribtion fee, as the minimum donation.

Then , learn paypal's API and verify the user entered stamp code to make sure it has paid , and transaction successful.

Why dont you make an API to get credit from their accounts?
It costs too much money.

Hope these helps.
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
why would I use the donate option rather than the buy option? I do have a verified account by the way. I need to work on getting my if statement settled. I first plan on creating a buy button for silver, gold, and platinum packages and as you may know, each item to buy through paypal has it's own link. By clicking the link, it adds it to the user's cart. I want to create an if statement so that if silver is selected submit button redirects to buy the silver package through paypal... and the same for gold and platinum.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Here is a guy that does something similar. Check out his downloads page.

http://www.bigfatsimulations.com/down...

The thing is though, is he does it manually. Unfortunately, if you want to use PayPal, there is no way (yet) to do what you wish. If you want it to be completely automatic, you will have to host the billing on your own server.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Oh crap, forgot the else statements::
<!--

<?php
// process.php - Takes data from index.php and displays it

// Form data (POST)
// username - The name of the user.
// plan - Contains the plan of the user (b=bronze,s=silver,g=gold)

print("<html><head><title>Welcome ");
// Lets get the data. Place the name inside of the $_POST[] or $_GET[] variable to get the value of that data.

$username = $_POST['username'];
print $username . "</title></head><body>"; // Prints the user name and finishes the head of process.php. Starts the body.

$plan = $_POST['plan]; // Gets the plan of the user.
if ($plan == "b") {

print("<font color='#0000FF'>You have selected, Bronze</font>");
}
elseif ($plan == "s") {

print("<font color='#FF0000'>You have selected, Silver.</font>");
}
elseif ($plan == "g") {

print("<font color='#FF0000'>You have selected, Gold</font>");
}
else {
print("You did not specify a plan.");
}

?>
</body></html>

-->

So, that is a basic select form. Since I don't know how you want to process it, I can't be too specific on the code.
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
ok, I'll look it over, thanks! :)