Jump to content

denno020

Members
  • Posts

    761
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by denno020

  1. I think you have something funky going on with your " " and ' '. Might want to look at them. Also check if you need to do anything special around $confirmCode, might need some " " or ' '. Just google: inserting php variables into an email Work from there, you should be able to find heaps of information. And if you find it yourself, you will learn it alot better than pulling the answer from someone here . Post back if you're still having problems. Denno
  2. Thanks for the reply kirkh34.. Still doesn't work for me though.. Could I possible see your IPN file? Did you write your own, or did you use the sample code from PayPal? Denno
  3. I have set up my PayPal IPN and it works perfectly when sending test IPN's using the IPN Simulator on the PayPal developer website. When I change the ssl in this line $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); to www.paypal.com It no longer works. It comes back as INVALID, not VERIFIED. Anyone know what the problem could be? My IPN is below. You'll see there is entries into the log table, this is just for testing purposes, and how I found out that it's coming back as INVALID and not VERIFIED. Thanks Denno <?php //connect to the database here include "../scripts/connect_to_mysql.php"; //------------------------------- // PHP 4.1 // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); // assign posted variables to local variables $team_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $associated_club = $_POST['custom']; $contact_number = $_POST['invoice']; if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { //User code is added below here $dateField=date("Y-m-d H:i:s"); $sqlCommand = "INSERT INTO log VALUES('','$dateField','$payment_status','$payment_amount','$payment_currency','1','0')"; $update = mysql_query($sqlCommand, $myConnection); if($payment_status == "Completed"){ if($payment_amount == '40.00' && $payment_currency == "AUD"){ //process payment and enter information into database $sqlCommand = "INSERT INTO teams VALUES ('','$first_name','$last_name','$associated_club','$team_name','$contact_number','1')"; $update = mysql_query($sqlCommand, $myConnection); } } //User code is added above here } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation $dateField=date("Y-m-d H:i:s"); $sqlCommand = "INSERT INTO log VALUES('','$dateField','$payment_status','$payment_amount','$payment_currency','0','1')"; $update = mysql_query($sqlCommand, $myConnection); } } fclose ($fp); } echo "$sqlCommand"; ?>
  4. Why are you counting the results? Just say: SELECT 'avatar field' FROM users WHERE id=$updateid (update avatar session variable) (replace 'avatar field' with the column name for the avatar). I would imagine that'd work alright...
  5. My answer above is wrong, sorry about that. However I did find out what your problem is. You can't have out as a table name. It is a reserved word, so you will have to change it. Reference: http://www.htmlite.com/mysql002a.php Denno
  6. INSERT INTO out( names , section , wo , printer_name , toner_code , quantity , remarks , technician , trainee ) VALUES ('$names','$section','$wo','$printer_name','$toner_code','$quantity', '$remarks','$technician','$trainee') I don't think you need to have the information in the brackets after INSERT INTO out. Take out that and see what happens. Denno
  7. As joel is saying above, you need to provide more information, show the php code where this query is run. Also, make sure you have a value going into every column of your database table. I counted 9 entries from this query, is there exactly 9 columns in your database table? Denno
  8. Put another field in your database table where the total points is stored. Then when you compute the total wins, you could update this new field with the value, then you run another query where you pull the clan name, and use ORDER BY total_points ASC or DESC, depending on how you want it.. It's probably not the best way to do it, but I'm sure it would work. Denno
  9. I have never tried this before or anything, but I thought it might be a good idea: When they save their new settings, you could have a php script run that will update the database with the new values, and then query the database, getting all user's data again, and re-assigning the session variables to these new query results.. One of those variables would be the avatar, which, I imagine, would update when the session variable is updated with the new information.. I could be way off though, but it's just an idea I thought could work. Denno
  10. Go to youtube, and search for Web Intersect. It is a series of tutorials that youtube user flashbuilding has created. In it, he will show you how to make a near facebook clone, from scratch. I think that you should be able to use the knowledge you will gain from those videos to be able to implement what you want into your site. Denno
  11. I don't think I can help you out sorry mate. I can't read any of those comments, and I'm not that well equipped at PHP to be able to just read the code and understand what is happening.. Denno
  12. So I've had a little play around, and I've got something working. It's not perfect, in fact it's far from perfect, but with a bit of tweaking, you should be able to have it functioning how you want. Also, I'm sure this can be done in a much more efficient way, but I just wanted to get it to work, doesn't matter how many lines I used . Here is the javascript: <script type="text/javascript"> function hide(obj){ switch(obj){ case('A1'): document.form1.A2.style.visibility = 'hidden'; document.form1.A3.style.visibility = 'hidden'; document.form1.A4.style.visibility = 'hidden'; break; case('B1'): document.form1.B2.style.visibility = 'hidden'; document.form1.B3.style.visibility = 'hidden'; document.form1.B4.style.visibility = 'hidden'; break; case('C1'): document.form1.C2.style.visibility = 'hidden'; document.form1.C3.style.visibility = 'hidden'; document.form1.C4.style.visibility = 'hidden'; break; case('D1'): document.form1.D2.style.visibility = 'hidden'; document.form1.D3.style.visibility = 'hidden'; document.form1.D4.style.visibility = 'hidden'; break; case('A2'): document.form1.A3.style.visibility = 'hidden'; document.form1.A4.style.visibility = 'hidden'; break; case('B2'): document.form1.B3.style.visibility = 'hidden'; document.form1.B4.style.visibility = 'hidden'; break; case('C2'): document.form1.C3.style.visibility = 'hidden'; document.form1.C4.style.visibility = 'hidden'; break; case('D2'): document.form1.D3.style.visibility = 'hidden'; document.form1.D4.style.visibility = 'hidden'; break; case('A3'): document.form1.A4.style.visibility = 'hidden'; break; case('B3'): document.form1.B4.style.visibility = 'hidden'; break; case('C3'): document.form1.C4.style.visibility = 'hidden'; break; case('D3'): document.form1.D4.style.visibility = 'hidden'; break; } } </script> Here is the HTML: <form id="form1" name="form1" method="post" action=""> <p> <input type="radio" name="A1" id="A1" value="A1" onclick="hide(this.value)" /> <label for="A1"></label> <input type="radio" name="B1" id="B1" value="B1" onclick="hide(this.value)" /> <label for="B1"></label> <input type="radio" name="C1" id="C1" value="C1" onclick="hide(this.value)" /> <label for="C1"></label> <input type="radio" name="D1" id="D1" value="D1" onclick="hide(this.value)" /> <label for="D1"></label> </p> <p> <input type="radio" name="A2" id="A2" value="A2" onclick="hide(this.value)" /> <label for="A2"></label> <input type="radio" name="B2" id="B2" value="B2" onclick="hide(this.value)" /> <label for="B2"></label> <input type="radio" name="C2" id="C2" value="C2" onclick="hide(this.value)" /> <label for="C2"></label> <input type="radio" name="D2" id="D2" value="D2" onclick="hide(this.value)" /> <label for="D2"></label> </p> <p> <input type="radio" name="A3" id="A3" value="A3" onclick="hide(this.value)" /> <label for="A3"></label> <input type="radio" name="B3" id="B3" value="B3" onclick="hide(this.value)" /> <label for="B3"></label> <input type="radio" name="C3" id="C3" value="C3" onclick="hide(this.value)" /> <label for="C3"></label> <input type="radio" name="D3" id="D3" value="D3" onclick="hide(this.value)" /> <label for="D3"></label> </p> <p> <input type="radio" name="A4" id="A4" value="A4" onclick="hide(this.value)" /> <label for="A4"></label> <input type="radio" name="B4" id="B4" value="B4" onclick="hide(this.value)" /> <label for="B4"></label> <input type="radio" name="C4" id="C4" value="C4" onclick="hide(this.value)" /> <label for="C4"></label> <input type="radio" name="D4" id="D4" value="D4" onclick="hide(this.value)" /> <label for="D4"></label> </p> </form> Play with it and see what you can come up with. You will need to add code to show the elements again, for cases where the user might change their mind as to their order. For that reason I would suggest not hiding the rest of the elements, but just checking the elements for duplicate selections afterward. If you take away the rest of the radio options, you're giving the user a feeling that they can't actually change their selection anymore.. (which, if they select A1, B1, C1, D1, they actually won't be able to change). Of course, I could be completely missing the point of your question, in which case, I'm sorry. Denno
  13. So I'm thinking you want to implement a rating type system, whereby the user will select which they like most, then 2nd most, then third most, and the fourth most is the only one left? You could just give each set of radio buttons the same options, and let the user use their 'brain power' to figure out that they don't click on the same one twice. However, there will be people who will do that, so you could have some javascript that would check for this duplicate entry. Or you could have a php script as your form action which will check for duplicate entries from each set of radio buttons, and give an error as appropriate. If you want to have the form change on the fly, then you will need to use javascript. In simplified terms, you'll set an onchange parameter for the radio button, so that when it is selected, it will trigger the javascript function, and within that function, you can hide the rest of the occurrences of that value. Atleast, this is how I'd imagine it would work, I haven't had much testing behind the theory. Might do some now though! Denno
  14. ahh thankyou. I have found this. The menu's were well hidden. I was hovering of the main Profile button at the top, and only seeing 3 options. I didn't realize that inside of one of those options, there was a mody profile button.. I know now though . Denno
  15. Do you use CSS to line the elements up? I reckon it would be a problem with something you've used in your CSS, and IE7 not supporting it.. Maybe you need to see what new CSS features IE8 supports compared to IE7, and see if you have used any of them. Denno
  16. How can I enable such a feature? I never remember to tick the box to be notified of new responses.. I need it to be done automatically, like auto subscribe to thread... Is it possible on this forum? Thanks Denno P.S. Yes I remembered to tick the box for this
  17. What sort of a contact form do you need? They're really very simple to create, I'm not sure why you need so much code. From the looks of it, it's going to be one complex form. All you really need to do is create your form in html as per usual. Then you give the form an action which points to a php file. This php file will grab each of the form fields data from $_POST or $_GET (depending on your sending method), and then can either send the form data to an email address, enter it into a database, or do whatever you want it to do.. Unless I'm missing the point, and you're requiring a more complex setup? Denno
  18. I don't understand what you're trying to get rid of? The Copyright notice? I didn't have anything that looked like SPAM underneath the bottom navigation menu. I'm using Google Chrome if it matters. Denno
  19. Oh wait, I'm sorry, I can see what's happening there.. Maybe it's not formatting it properly? Try echoing out $start_time, to see what format it's in?
  20. Is this just a typo here or is it how you have it in your code? You will need to enter the actual numbers there, like you have for $end_time.
  21. echoing text into a variable? With your code I would write it like this: if({'paid1'} == no){ $paid1b = "Pay Now"; }else{ $paid1b = "Yes"; } echo $paid1b Don't quote me on the formatting of that above code, I'm always getting confused between () [] {}, and the needs for them in different situations, but the gist of what I've written should work.. Hope that helps Denno
  22. I can give you some psuedo code, as it's late and I should be in bed lol. Assuming the countdowns are for the same day hours_left = target_hours - current_hours; if(target_minutes < current_minutes){ hours_left = hours_left - 1; minutes_left = (60 - current_minutes) + target_minutes; }else{ minutes_left = target_minutes - current_minutes; } seconds_left = (same idea as minutes) Fairly sure that would work. Obviously test though . Hope that helps. Denno
  23. Hey guys and girls, Name is Luke, but nickname is Denno. I came across this site as I needed help with some php, which I have received exceptionally quickly. Have asked the same question on two other web development forums, and I still haven't got an answer there, so I'll be here from now on! I look forward to learning lots, and hopefully helping people with some of the more simple php/web development problems they may have. Denno
  24. Awesome, thankyou very much. I will change to that code . Thanks to everyone for their advice too, it all helped me to understand the problem. Denno
  25. I'm not really in need of a more efficient way, I don't think. I guess I could still implement the SELECT COUNT. After trying it before, without success, I just wanted to use the first thing that I could get working, which was the other method lol. If I wanted to use the SELECT COUNT query though, I would just assign $numRegistrations = $query? (where $query = mysql_query($sqlCommand, $myConnection) or die (mysqli_error()) Is there any other steps or is the returned query the exact answer I'm after? Tah Denno
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.