Jump to content

Wildhalf

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by Wildhalf

  1. Thanks but if you look at my code i am using this. Which works fine for one intance but when passing through PAYPAL Sandboax it doesn't work... Is there a way to pull the URL from the last page visited from the history
  2. Hi, I need some help... I have the code below working for XAMP when i use the URL http://127.0.0.1/paypal/test/test2.html test2.html contains a link to a php file on my site with the code below. This Works when i use it this way.. But when i am testing it through PAYPAL Sandbox the code doesn't work. It returns a NULL for the URL. Is this because Sandbox uses HTTPS?? If so how do i get this working for HTTPS? <? /*Gets URL that sent visitor to the site */ $referrer_url = $_SERVER['HTTP_REFERER']; print "Referral URL : $referrer_url</br>"; /*Checks to see if paypal is in the URL*/ ereg ("paypal", $referrer_url, $domain); print "Referral URL : $domain[0]</br>"; If ($domain[0] == 'paypal'){ echo '</br>This works </br>'; include "main.html"; exit(); } ?> Thanks in advance, Kieron
  3. Is that going to be the same for anyway you do it?? Unless you create a variable. I am really using it to make sure my customers have paid me via paypal. For what i am doing i cannot encrypt my paypal subscription buttons (Im not going into why). Therefore my return URL will be displayed. I will search for the string "paypal.com" and with this code in place it checks to see if the server who sent the user there was paypal or not. If so it will display my signup/download link or else dispay an error message telling them they did not pay.
  4. Thanks for your replys.... I just figured it out.... The following works for me I used ereg() <? $referrer = $_SERVER['HTTP_REFERER']; //echo "$referrer"; echo $referrer; echo '<br />'; ereg ("Kieron", $referrer, $domain); If ($domain[0] == 'Kieron'){ echo 'This works </br>'; } echo $domain[0]; // prints @example.com ?>
  5. Sorted Myself..... Basicaly the code below searchs the url that sent a visitor to the site and extracts the word test from it and prints it out..... You can change test to what ever you want <? $referrer = $_SERVER['HTTP_REFERER']; //echo "$referrer"; echo $referrer; echo '<br />'; ereg ("test", $referrer, $domain); If ($domain[0] == 'test'){ echo 'This works </br>'; } echo $domain[0]; // prints @example.com ?>
  6. Best way to do that would have a unique key in your database that auto increaments then qeury the database for the max number
  7. Hi I have been looking it up but cant come up with the code to extract a word from a string. example : "Hi There I am Kieron" I want to extract "Kieron" It doesn't matter really if the returned value equals what i am looking for a True or False would do. But it would be handy if i could. Kieron
  8. Hi, You will have to change the follow with reference to your Database 1. ocalhost 2. DB_User 3. password 4. DB You will have to change the follow with reference to your Table 1. table_name 2. first_name 3. last_name Try this.... # Create DB connection $dbhost = 'localhost'; $dbusername = 'DB_User'; $dbpasswd = 'password'; $database_name = 'DB'; #under here, don't touch! $connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); /* Let's get the user info */ $sql = mysql_query("SELECT * FROM table_name"); $data = mysql_fetch_array($sql); $first = $data[first_name]; $last = $data[last_name];
  9. Thank you for that Just installed XAMPP and tested it it does work... One last question... $referrer = $_SERVER['HTTP_REFERER']; $referrer will display the whole url is there any way for extracting just the domain name from this.... What i am doing is if the url is one thing dispay one page if it's another display a different page completely
  10. Hi, I have a quick qustion. I want to know who what URL or website sent the visitor to a certain page. I am looking into it as we speak and was wondering if anyone knew if this would work... $referrer = $_SERVER['HTTP_REFERER'];
  11. fixed it used the code in "blaa Blaa" include ""blaa Blaa"/re_offer.htm";
  12. This may seem silly to most but i can't get the syntax right... I have a php file checking a value in my database and opening one page if it is a 0 and another if it is a 1. My Problem is that the page returned when the value is a 0 is in the root directory while the php file is stored in a subfolder of another folder eg. "/test1/test/" I thought this... include "../re_offer.htm"; Would let me view the file but i keep getting errors Warning: main(../re_offer.htm): failed to open stream: No such file or directory in "blaa Blaa on line 39 The code above is line 39
  13. I understand what you are doing but think you making it hard on yourself why not just do the following Create a PHP file for each page using the code below just changing the content.html page to the cotent you want for each link...... eg. Index - content_index.html contact - content_contact.html and so on why make things hard <?php include "top.html"; include "content.html"; include "bottom.html"; ?>
  14. I have done exactly what you are trying to do but can't login to my ftp account to get you the code here as FTP is disabled. If i remember once i get out of bed tomorrow i will pos tyou the info needed. I setup another field on my table called activated defaulted to 0. Aswell as sending the user his info via PHP mail i also sent an activation link. www.somesite.com/activate.php?user=username Members where not able to login usless the account is activated. By clicking the link. once the link is clicked i changed the value of activated to 1. i made sure that my login script would only let users in if activated = 1 PHP Mail is easy enough you can find everything you need on php.net. hope this gives you an idea. I am sorry again i couldn't post my own code but it happens
  15. I think i might have figured out a way to do what i wanted... Would this work???? The email address someemail@gmail.com will pull the info i need from the database. so i by changing the following 2 lines when the user returns to my site i can pull the info i want from my table. <input type="hidden" name="business" value="someemail@gmail.com"> <input type="hidden" name="return" value="http://www.somesite.com/return.php?email=someemail@gmail.com">
  16. I need to know if it is possible to do the following. Can i pass values with the paypal subscription code below. so they can be used in the return page <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <input type="hidden" name="business" value="someemail@gmail.com"> <input type="hidden" name="item_name" value="Payment 1 of 3"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://www.somesite.com/"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="IE"> <input type="hidden" name="bn" value="PP-SubscriptionsBF"> <input type="hidden" name="a1" value="0.00"> <input type="hidden" name="p1" value="3"> <input type="hidden" name="t1" value="D"> <input type="hidden" name="a3" value="5.00"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <input type="hidden" name="src" value="1"> <input type="hidden" name="sra" value="1">
  17. Just figured it out myself........ Thought i had updated everything since last test but never changed the Database files....
  18. Hi All, When i was testing my file on my local machine using Xampp everything worked fine. But now that i have uploaded it to my server i get the following error when i get my use to click on there actiation link.... Unknown column 'activated' in 'field list' Activated is the name of my PHP file. its not a field Link i use to activate account http://www.mysite.com/activated.php?email=email@gmail.com&name=TSteve&site=confirm <? // Get database connection include 'db.php'; // Define post fields into simple variables $email = $_REQUEST['email']; $name = $_REQUEST['name']; $site = $_REQUEST['site']; $sql2 = mysql_query("UPDATE tblmembers SET activated=1 WHERE email='$email'") or die (mysql_error()); print "eMail : $email"; print "<br>"; print "Account Activated"; include "activated_html.php"; ?>
  19. Here is the code i used to sort problem... [code] $member_id = $refer_id;   $sql = mysql_query("SELECT * FROM tblmembers WHERE referred_by='$member_id' ORDER BY no_referrals DESC") or die(mysql_error());   //$num_rows = mysql_num_rows($sql_num_rows); //now you could do something like this to make sure that you don't loop //through the results if there aren't any to be looped through if (mysql_num_rows($sql) < 1) {     die("There are not matching results"); }    //now we loop through the results.. //for ( $counter = 0; $counter <= $num_rows ; $counter += 1) { while($row = mysql_fetch_array($sql)) { echo '<tr bgcolor="#FFFFCC"> <td  align="center" width="160" height="20" bgcolor="#eeeeee"> <div align="center" class="style5">'; echo $row['firstname']; echo ' ' ; echo $row['lastname']; echo '<div> </td> <td width="160" height="20" bgcolor="#eeeeee"> <div align="center" class="style5"> '; echo $row['no_referrals']; echo '</div> </td> <td width="160" height="20" bgcolor="#FFFFCC" scope="row"> <div align="center" class="style5"> '; echo '<a href="mailto:'; echo $row['email']; echo '">'; echo $row['email']; echo '</a>'; echo '</div> </td> </tr> '; } [/code]
  20. Hi I need some help. The While loop below returns and displays exactly what i want but i want to sort the rows by $row['no_referrals'] showing the largest first. Has anyone any ideas how i do this??? $sql = mysql_query("SELECT * FROM tblmembers WHERE referred_by='$member_id'") or die(mysql_error()); //$num_rows = mysql_num_rows($sql_num_rows); //now you could do something like this to make sure that you don't loop //through the results if there aren't any to be looped through if (mysql_num_rows($sql) < 1) { die("There are not matching results"); } //now we loop through the results.. //for ( $counter = 0; $counter <= $num_rows ; $counter += 1) { while($row = mysql_fetch_array($sql)) { echo '<tr bgcolor="#FFFFCC"> <td align="center" width="160" height="20" bgcolor="#eeeeee"> <div align="center" class="style5">'; echo $row['firstname']; echo ' ' ; echo $row['lastname']; echo '<div> </td> <td width="160" height="20" bgcolor="#eeeeee"> <div align="center" class="style5"> '; echo $row['no_referrals']; echo '</div> </td> <td width="160" height="20" bgcolor="#FFFFCC" scope="row"> <div align="center" class="style5"> '; echo '<a href="mailto:'; echo $row['email']; echo '">'; echo $row['email']; echo '</a>'; echo '</div> </td> </tr> '; }
  21. Thank you both for your help tomfmason I modified your code a little but got it working.. [code]while($row = mysql_fetch_array($sql)) {     include 'html_1.htm;';     echo $row['firstname'];     include 'html_2.htm;';     echo  $row['lastname'];     include 'html_3.htm;';     echo  $row['email'];     include 'html_4.htm;';             }[/code] The include statments are just segments of my Table... pocobueno1388 I didn't get your message till i had sorted the problem took me a while to figure it out... But i know your way would have been easier.. than what i did.. Thanks All. Kieron
  22. Hi, I need help. Been racking my brain all night trying to come up with a way to return all records from my table with a certain ID and then dispplay all colums in a table. My problem is i haven't worked with PHP and arrays yet well i assume i have to use arrays. What im looking for is the SQL command simmilar to  $sql_num_rows (in code below) that returns all the members referrals and also how do i display it... Thanks in advance for any help given... [code] echo "<table border="0" align="center">"; echo " <tr bgcolor="#FFFFFF">"; echo "  <td width="160"><div align="center" class="style4">First Name</div></td>"; echo " <td width="160"><div align="center" class="style4">Last Name</div></td>"; echo " <td width="160"><div align="center" class="style4">eMail</div></td>"; echo "</tr>";   $member_id = BBBQ1090   $sql_num_rows = mysql_query("SELECT * FROM tblmembers WHERE referred_by='$member_id'");   $num_rows = mysql_num_rows($sql_num_rows);   for ( $counter = 0; $counter <= $num_rows ; $counter += 1) {   echo " <tr bgcolor="#FFFFCC">"; echo " <td width="160" height="20" bgcolor="#eeeeee"> <div align="center" class="style5"> <? php echo"$firstname";?> <div> </td>"; echo " <td width="160" height="20" bgcolor="#eeeeee"> <div align="center" class="style5"> <? php echo"$lastname";?> </div> </td>"; echo "<td width="160" height="20" bgcolor="#FFFFCC" scope="row"> <div align="center" class="style5"> <? php echo"$email";?> </div> </td>";  echo "</tr>"; } echo "</table>"; [/code]
  23. quick question.... From what you said i think your using frames.... Am i right?? If the Script works without frames why don't you just use Tables instead...
  24. Tandem, Thank you for such a quick reply. It works like a charm... Been looking on the web for 40 mins and new there would be an easy way to do it.. One step closer to completion. When im finished ill PM my site to you for a look... Thanks again, Kieron
×
×
  • 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.