Jump to content

ShaolinF

Members
  • Posts

    314
  • Joined

  • Last visited

    Never

Everything posted by ShaolinF

  1. Hi, Alert gives me the exact answer that is being compared in the IF statement. Trimming doesnt work either.
  2. Yes, I have tried the code upto setTimeout().
  3. Hey Guys, Are there any good set of training vids on the net for OO PHP ? I know killerphp.com is one, but it's only an introduction. I want to learn some advanced techniques.
  4. Thanks. The problem is, is that everytime I run the script and try to get $_POST['etc'], all the variables are blank. It;s confused the hell out of me. Now, I ran the following code: // get post received and write to log file $fplog = fopen('ipnlog.txt','a'); fwrite($fplog,"GOT-IT $req\n"); fclose($fplog); // end code. // log $fplog = fopen('ipnlog.txt','a'); fwrite($fplog,"$res: $req\n"); fclose($fplog); // end log And I got the following output: Now the variables are there, but why can't I grab them is the question
  5. Thanks. Where are the rest of the parts ? Couldn't find them.
  6. Thanks, I'm using buy now buttons with the IPN, so don't know if options fields is still an option ? How did you configure the following piece of code, as it looks like I need to send back some variables but I don't know how: // 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"; }
  7. Hi Guys, Do you know of any training videos for MySQL ?
  8. Thanks for the responses guys. dolcezza: Excellent, I wasn't too sure if making my own custom variables would work. Is it only one variable though ? Ideally I would to create 3 custom variables. I was reading the documentation for IPN on the following link: http://www.pdncommunity.com/pdn/board/message?board.id=basicpayments&thread.id=368 it says: What fields do I include and how ? The send me over 30+ variables.
  9. Hi Guys, I've been trying to do this in several different occasions but it doesn't work. See the code below: php script: if ($_GET['tn'] > $result['TicketsOnSale']) { echo "inline"; } else { echo "none"; } AJAX: If the script echos inline, then the AJAX IF statement should be true. But even if logically it is true it still doesn't work. I've tried single and double quotes for both the php and AJAX script to no avail. The whole script works fine up until the IF statement. I've tried to debug using firebug but it outputs no errors. Why does this happen ?
  10. Btw, when I run the line of code you posted, I get only "1" as output.
  11. Thanks. I wanted to know, what do I have to do with the following piece of code: // 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"; } I've read the tutorials and asked on the their developer forums to no avail.
  12. Hey Guys, I'm using paypal for payments, and I am using IPN as the method of processing. Once paypal have processed and redirected the customer back to my website, the next step for me is to insert the data into my DB. The only problem is how do I know which record to update ? Should I use sessions ? or is there a way I can carry my userid/purchaseid variables over through the paypal process ?
  13. Im thinking of creating a random number, store it in a session and compare it in the mailme.php file. What do you think ?
  14. Hi Guys, So I am including a file (include("mailme.php") -- The problem is people can directly access this file, something which I don't want, so what methods could I use to protect this file from direct access ?
  15. Well I checked its output and it gave me a resource # something. I will have to use mysql_fetch_array. Is there any other way as I only want 1 record ?
  16. Thanks, didnt see that. Yet again another 2 problems. First of all, I am trying to insert the date into the table but its not going. This is how I defined the column: How I am adding date into the the column: $date = date("D dS M,Y h:i a"); //Update time to time of input into DB // Add purchase details $insert2 = mysql_query("INSERT INTO purchase VALUES ('', '$userid', '$eventid', '".$_SESSION['TICKET']."', '".$_SESSION['TOTALPRICE']."', 'N', '$date')") or die(mysql_error()); sECOND PROBLEM: the eventid when inserted into the db does not work. See code: $eventid = mysql_query("SELECT eventid FROM event WHERE eventset = 1");
  17. Thanks. I have now added the INSERT for purchase and am getting the following error: Parse error: syntax error, unexpected T_VARIABLE code (ERROR is in the $insert variable): //Grab userid and eventid to be used for purchase table $userid = mysql_insert_id(); $eventid = mysql_query("SELECT eventid FROM event WHERE eventset = 1") //Update time to time of input into DB // Add purchase details $insert = mysql_query("INSERT INTO purchase VALUES ('', '$userid', '$eventid', '".$_SESSION['TICKET']."', '".$_SESSION['TOTALPRICE']."', 'N', '')") or die(mysql_error());
  18. Hi Guys, I need to populate 2 tables with data. One is the users table and the other is a purchase table. Now this is the code I am using for the users table: $insert = mysql_query("INSERT INTO users VALUES ('', '".$_SESSION['NAME']."', '".$_SESSION['CONTACTNO']."', '".$_SESSION['EMAILADD']."', '".$_SESSION['GENDER']."')"); Now for the purchase field, is there anyway I could grab the userid for the user above without going through a lengthy SELECT statement ? Please note, there is no user registration allowed on the website.
  19. Well there are about dozen other variables involved, I only included one for the sake of simplicity. It's a purchase system. The user has the choice of starting over which will reset all the variables.
  20. I found the problem, now I need to find another way around it. <FORM> <INPUT type="button" class="altButtonFormat" value="Start Over" onClick="location.href='index.htm?id=<?php include("rand.htm"); session_unset(); session_destroy(); ?>'"> </FORM> The point of that was so when they click the link it would redirect the to the home page and destroy the session. :-\ Do you guys have any other suggestions on how I could achieve this ?
  21. Hi Guys, I created some session variables and was planning on using them on another page. But they don't seem to be getting passed over. See code below: page1.php - Session created and works fine If(!isset($_SESSION['LOGGEDIN'])) // If user does not have a session { //Add session $_SESSION['NAME'] = $_POST['name']; } page2.php - output session, value is nothing. session_start(); echo "name:" . $_SESSION['NAME'] . "<BR>"; die;
  22. Hey Guys This INSERT code doesnt work: $insert = mysql_query("INSERT INTO users VALUES ('', '$_SESSION['NAME']', '$_SESSION['CONTACTNO']', '$_SESSION['EMAILADD']', '$_SESSION['GENDER']')");
  23. Hi Guys, I am trying to use a div tag along with a form text box but it doesn't want to work! See code below: <script src="form_validation.js" type="text/javascript"> function ajaxFunction() {var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } // Function xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.getElementById('ticknodiv').style.display = xmlHttp.responseText; } } var tickno = document.signup.ticketno.value; var queryString = "?tn=" + tickno; xmlHttp.open("GET","tickno.php" + queryString,true); xmlHttp.send(null); } </script> <form action="confirm.htm?id=<?php include("rand.htm"); ?>" name="signup" method="post" onsubmit="return toggleDiv(this);" id="signup"> <label for="ticketno">How many Tickets:</label><br /> <input type="text" onkeyup="ajaxFunction();" name="ticketno" size="1" /><span id="format_tic">x £<? echo $_SESSION['SingleTicketPrice'] = $row['TicketPrice']; }?></span><br /> <br /> <input type="reset" class="altButtonFormat" /> <input type="submit" value="Continue >>" class="altButtonFormat" /></p> </form> <div id="ticknodiv" style="display:none" class="red"> <ul> <li>Too many tickets. Choose a lower amount</li> </ul> </div> tickno.php <?php include('db_connect.php'); $result = mysql_query('SELECT TicketsOnSale FROM event WHERE eventset = 1') or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { } /* if ($_GET['tn'] > $row['TicketsOnSale']) }*/ echo "display"; ?>
×
×
  • 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.