Jump to content

ILYAS415

Members
  • Posts

    292
  • Joined

  • Last visited

Everything posted by ILYAS415

  1. Hi, im totally confused on a forum script that im making. My boss has asked me to make it so, every time there is a new post the post is highlited. The easy thing is that i can put a row called ('read') im my table called ('topics') and set it to '1' everytime someone posts in a topic. The hard part is for when each specific user views it. E.g. when a user views it , 'read' will be set back to 0 and the post will no longer be new. This means that it will update it for each user. What im trying to do is so after one user has seen that there is a new post, they can view the post and 'read' will be set to '0' for him. From their other users will still be able to see there is a new post until they view the topics. P.S : I am also using MYSQL for my tables in my DB. Thanks for Any major help. ----------------------------------------- Azeem
  2. Lol. I think i no wat ur talking about but why don't you just get rid of <? echo SITE_URL; ?>? At the moment ur outputting your a href link as www.website.com/reception however if u just use... <a href="reception/" class=snav>Reception areas</a> it'll work fine
  3. Hi. Basically i have a paypal IPN script and the problem is its not working. What basically happens is... User goes through payment system | He pays and payment is succesful | On my ipn script its meant to email the user but it doesn't Script example: http://www.ragingmortals.com/donate.php You can log in with username: demo password: demo NOTE: Only use the above if you want to test the ipn script. Although you'll spend 1p it will be refunded. Just reply here to get a refund of 1p Here is the coding of the form which takes them to paypal to pay and notifies the ipn script:- <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="email hidden "> <input type="hidden" name="item_name" value="Raging Mortals - Package 1"> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="amount" value="0.01"> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="lc" value="GB"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.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_GB/i/scr/pixel.gif" width="1" height="1"> <input type="hidden" name="notify_url" value="http://www.ragingmortals.com/ipn_res.php"> <input type="hidden" name="rm" value="2"> </form> At the end of the script the script is notifying the ipn script. Here is my second script:- <? // made by robin kohli (robin@19.5degs.com) for 19.5 Degrees (http://www.19.5degs.com) // ----- edit these settings // database settings $host="localhost"; $ln=""; $pw=""; $db=""; // paypal email $paypal_email = "azeemilyas@hotmail.co.uk"; // email address where script should send notifications $error_email = "azeemilyas@hotmail.co.uk"; // email header $em_headers = "From: Raging Mortals <paypal@ragingmortals.com>\n"; $em_headers .= "Reply-To: support@ragingmortals.com\n"; $em_headers .= "Return-Path: support@ragingmortals.com\n"; $em_headers .= "Organization: Raging Mortals\n"; $em_headers .= "X-Priority: 3\n"; // ----------------- require("ipn_cls.php"); $paypal_info = $HTTP_POST_VARS; $paypal_ipn = new paypal_ipn($paypal_info); foreach ($paypal_ipn->paypal_post_vars as $key=>$value) { if (getType($key)=="string") { eval("\$$key=\$value;"); } } $paypal_ipn->send_response(); $paypal_ipn->error_email = $error_email; if (!$paypal_ipn->is_verified()) { $paypal_ipn->error_out("Bad order (PayPal says it's invalid)" . $paypal_ipn->paypal_response , $em_headers); die(); } switch( $paypal_ipn->get_payment_status() ) { case 'Pending': $pending_reason=$paypal_ipn->paypal_post_vars['pending_reason']; if ($pending_reason!="intl") { $paypal_ipn->error_out("Pending Payment - $pending_reason", $em_headers); break; } case 'Completed': $qry= "SELECT i.mc_gross, i.mc_currency FROM item_table as i WHERE i.item_number='$item_number'"; mysql_connect("$host","$ln","$pw") or die("Unable to connect to database"); mysql_select_db("$db") or die("Unable to select database"); $res=mysql_query ($qry); $config=mysql_fetch_array($res); if ($paypal_ipn->paypal_post_vars['txn_type']=="reversal") { $reason_code=$paypal_ipn->paypal_post_vars['reason_code']; $paypal_ipn->error_out("PayPal reversed an earlier transaction.", $em_headers); // you should mark the payment as disputed now } else { if ( (strtolower(trim($paypal_ipn->paypal_post_vars['business'])) == $paypal_email) && (trim($mc_currency)==$config['mc_currency']) && (trim($mc_gross)-$tax == $quantity*$config['mc_gross']) ) { $qry="INSERT INTO paypal_table VALUES (0 , '$payer_id', '$payment_date', '$txn_id', '$first_name', '$last_name', '$payer_email', '$payer_status', '$payment_type', '$memo', '$item_name', '$item_number', $quantity, $mc_gross, '$mc_currency', '$address_name', '".nl2br($address_street)."', '$address_city', '$address_state', '$address_zip', '$address_country', '$address_status', '$payer_business_name', '$payment_status', '$pending_reason', '$reason_code', '$txn_type')"; if (mysql_query($qry)) { $paypal_ipn->error_out("This was a successful transaction", $em_headers); // you should add your code for sending out the download link to your customer at $payer_email here. $rand= rand("1111111111", "9999999999"); //CODE FOR CLAIMING THE POINTS $to = "$payer_email"; $subject = "You payment - RM"; $body = "Congratulations! You have purchased some points! Now please follow the below instructions...<br><font color=red><strong>YOUR CODE NUMBER FOR CLAIMING YOUR POINTS IS $rand</font><br> Please enter this at the Raging Mortals donation page. If you forget this code you must contact a member of staff by emailing support@ragingmortals.com. We will look into your payment and give you the points manually."; mail($to, $subject, $body); echo "<br>Congratulations! You have purchased some points! Now please follow the below instructions...<br><font color=red><strong>YOUR CODE NUMBER FOR CLAIMING YOUR POINTS IS $rand</font><br> Please enter this at the Raging Mortals donation page. If you forget this code you must contact a member of staff by emailing support@ragingmortals.com. We will look into your payment and give you the points manually."; } else { $paypal_ipn->error_out("This was a duplicate transaction", $em_headers); } } else { $paypal_ipn->error_out("Someone attempted a sale using a manipulated URL", $em_headers); } } break; case 'Failed': // this will only happen in case of echeck. $paypal_ipn->error_out("Failed Payment", $em_headers); break; case 'Denied': // denied payment by us $paypal_ipn->error_out("Denied Payment", $em_headers); break; case 'Refunded': // payment refunded by us $paypal_ipn->error_out("Refunded Payment", $em_headers); break; case 'Canceled': // reversal cancelled // mark the payment as dispute cancelled $paypal_ipn->error_out("Cancelled reversal", $em_headers); break; default: // order is not good $paypal_ipn->error_out("Unknown Payment Status - " . $paypal_ipn->get_payment_status(), $em_headers); break; } ?> Please help, thanks. Btw as u can see ipn script was not coded by me thats y im struggling :@ If theirs any info missing then just mention it plz. thnx
  4. Thanks Alot Helraizer. It worked! The only thing i can say now is...... TOPIC SOLVED
  5. Hmm any their? Okay I have another problem now... www.ragingmortals.com/tester.php How do i get rid of the black part?
  6. Okay i think i kinda got it now. Took a while tho Hav a kl now and pls advise on any changes... i changed the imagecopymerge function to imagecopymerge($im, $secondim, 0, 0, 15, 15, 71, 146, 100);
  7. Okay come up with an error... www.ragingmortals.com/tester.php New code:
  8. ummm i dont think that'll help... what im trying to do is create a picture ontop of the other picture (so both pictures are still showing) and then use then position the second picture somewhere on the first picture. ive already made the first picture (which is on the code i specified) now i need to make a second picture_.
  9. won't that replace the image i already have on their?
  10. Okay no problem. Its quite ironic that u actually show me that script becuz thats the same one i am currently trying to use. Okay if your talking about the $payer_email and $reciever_email variables don't worry their just variables fetched from the paypal website. The problem with the script u provided is that i dont think it includes a manual. I tihnk your meant to create a button in the paypal button factory and make the button somehow notify the ipn script uve provided. Ive seen somewere b4 how to do this but im afraid it didn't work then. Hopefully someone hu nos will reply here... i said hopefully
  11. lol well.... okay the question is... how do i put an image onto the gd img i povided? i hav no idea how to do and google gives me weird results.
  12. Hiya im workin on my own php image (first one ever) and with a help of a few tutorials i hav come up with... www.ragingmortals.com/tester.php What i need to do is put another image like... www.ragingmortals.com/images/characters/any image in this directory onto my php made image. Just wondering how i could do that. If you have enough time could you please add it onto this script and explain for me? Thanks... p.s. im currently working on the page so plz refresh if their are errors. <? //CREATED BY WASIM ILYAS!<-- THATS ME! ILYAS THE GREAT header ("Content-type: image/gif"); $im= imagecreatefromgif("images/user.gif"); //Image i want to use $color = imagecolorallocate($im, 255,255,255); //Text color set to white $txt = (imagesx($im) - 260); //Text will be on the positions (-260 the image width). $txt2 = (imagesx($im) - 390); imagestring($im, 3, $txt, 15, "Hi guys im still making this image", $color); imagestring($im, 3, $txt, 30, "so Please...leave now", $color); imagestring($im, 3, $txt2, 15, "Another img to", $color); imagestring($im, 3, $txt2, 30, "be put here", $color); imagegif($im); imagedestroy($im); ?>
  13. Lol btw does the source has a significant effect on the pages layout?
  14. Well i checked n yh its enable... i think... GD Support enabled GD Version bundled (2.0.28 compatible) FreeType Support enabled FreeType Linkage with freetype GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled
  15. cooldude i wasnt expecting any1 to hand me one! Anyway Goose what you can do with a paypal ipn script is... 1). Create a random code and email it to the user. Make sure to insert the code into your db so that u can check for it later on and see if it matches anything anyone types in. Make a code box in which people can type in the code they recieved in their email. When they type in their code they can/have to specify a email (the one they used in their payment) for security reasons so that noone else uses their code. 2). ... Or you can choose to simply connect the ipn script to your database and give them the product manually by running queries etc. Ipn scripts can also connect to your db so you can run quries on the same page. It is known as a 'Instant payment notification' script which basically means its MADE for notifying the owner of the product but it can also be used for automated and electronic stuff e.g. like in your game you want to credit them with a donators package or something like that. ---------------------------------------------------------- Their is also another payment method script you can use which allows the players on your game to pay by sms. This is very useful becuz then ull earn lots of $$$. Basically you'll hav to lk this up on google. Try typing "Onebip sms payments" or something lyk that.
  16. Hehe. Have a lk in the other files u included in the first code u gave us just now.
  17. Hey. Im just wondering because on my server php created images won't appear. Only a [x] will appear. Any known reason why this could be?
  18. Hmmm their is no sign of any html apart from the meta tags in that... are u sure u hav no html in the db connection file jus checkin.
  19. ILYAS415

    crowded!!!

    Okay i think i no what u mean... The database will have no problem execusting the queries you are describing even if it means that 100 people or more do do it at the same time. Of course you'll need to use Php and mysql to do what u were describing. Lets take it that you have one million people all executing these queries on your databse. Their will be one problem... i thikn its to do with CPU usage. You see everytime you run a query, your using up some of your database cpu (monthly). If the db cpu goes to 0 then ur pages won't show up (the viewers will get errors similiar to 404 also known as no such page errors). I think the only fix to this is making your queries more efficient and probably getting more CPU from ur host.
  20. Hi i was reading the forum when i came across the code... <?php if (stristr($_SERVER['PHP_SELF'], "'") || stristr($_SERVER['PHP_SELF'], '"') || stristr($_SERVER['PHP_SELF'], '<') || stristr($_SERVER['PHP_SELF'], '>') || stristr($_SERVER['PHP_SELF'], '/')) { echo "No XSS today, thank you"; //or any other message exit(); } ?> Okay Im just wondering howto use this script. Basically when i put this script into my game site, i put it into a file called functions.php Every page in my site is includes function.php in its coding (using the function include_once). The script which Helraizer provided, is meant to stop XSS. Unfortuanely when i go on a page which has no XSS or even no $_GET thingy on it it says... Any help?
  21. Hmmm im not sure but i think the server is declining connections now, thats why the ftp could'nt replace the file on the server... Any ideas as to why this could be?
  22. I am looking for an easy to use script. Mate what you need to be looking for is a php paypal ipn script. They can be really difficult to set up i have tried countlessly for my php game www.ragingmortals.com sorry ifim not allowed to post links mods i never actually read the rules properly Anyway i do have some php ipn scripts which arent mine and i can also get one of my friend who also owns a php game but his seems complicated because it uses 'switches' functions which im not familiar with.
  23. Okay i was connecting to my site thru FTP and everything was working. The sites pages were being saved etc. I went away and when i came back i edited a few files and tried to save them. When i tried to save them Dreamweaver told me that it had skipped the files. I refreshed my page and the page had seemingly dissapeared. I checked in my control panel and the page had been deleted. In my ftp results it said... The file "public_html/fortress.php" was skipped because the old remote file could not be deleted. > CWD /public_html < 250 OK. Current directory is /public_html > PWD < 257 "/public_html" is your current location I think this might either be something with my FTP or with the file permissions on my site changing somehow... Any help will be appreciated ALOT.
×
×
  • 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.