Hello…please may I ask advice. I am brand new to php and have been learning for three weeks now but I am quite slow. Bit nervous for asking this question. I want to show paypal button next top my brothers products on his web site…that the value(code) comes from sql…shall i post code? ok…
<?php // Connects to your Database mysql_connect("localhost", "xxxxx", "xxxxx") or die(mysql_error()) ; mysql_select_db("xxxxxxx") or die(mysql_error()) ; //Retrieves data from MySQL $data = mysql_query("SELECT * FROM employees") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the image and other data Echo ""; } ?> <?php $target = "images/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $pic=($_FILES['photo']['name']); $link=$_POST['link']; mysql_connect("localhost", "xxx", "xxxx") or die(mysql_error()) ; mysql_select_db("xxxx") or die(mysql_error()) ; mysql_query("INSERT INTO `employees` VALUES ('$name', '$email', '$phone', '$pic','$link')") ; if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { echo "Sorry, there was a problem uploading your file."; } ?>
So the user can just click paypal button and go to pay. I can’t find anywhere URL to store and just can’t see how HTML can run from PHP script.
Please forgive me if i am otaaly out of my depth I’m just trying to understand for brother’s web site.