Post: [PHP , PDO] SPRX License Key Download Script
03-16-2017, 09:21 PM #1
IcarusXSEC
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({}); This is just a REALLY BASIC Script on allowing a user to download there key downloading a logged in users licensekey

    
<?php

$id = $_SESSION['session_name']

$stmt = $auth_user->runQuery("SELECT * FROM Keys WHERE id=:id");
$stmt->execute(array(":id"=>$id));
$row=$stmt->fetch(PDO::FETCH_ASSOC) //Data to read rows

if (isset($_POST['downloadKey'])) // This is Just a way to download the File from A Post Request but you can use something else to trigger the download
{

header('Content-Type: text/plain'Winky Winky; // you can change this based on the file type
header('Content-Disposition: attachment; filename="Your_Menu_Name.key"'Winky Winky;

$key = $row['LICENSE_KEY_COLUMN'];

print("$");

exit();

header("Location: download.php"); // Always good to set headers after $_POST Request Submits, just in case on refresh it might submit $_POST again
}
?>


Don't Bitch if you dont Like PDO
I Hope this Can help People
HiHiHi

My Next Tutorial will be making an AJAX chat with PHP and Base Setup !

The following user thanked IcarusXSEC for this useful post:

HamoodDev
03-17-2017, 06:58 AM #2
CyberNomadic
Web Developer
People make these like people made Mod Menus for MW2 lol
03-17-2017, 09:29 AM #3
IcarusXSEC
Do a barrel roll!
Originally posted by CyberNomadic View Post
People make these like people made Mod Menus for MW2 lol


If that was a joke i didnt get it

if it wasnt a joke then its just to help people starting out or
03-17-2017, 04:10 PM #4
Tustin
Balls of Steel
Originally posted by PumahModzUk View Post
If that was a joke i didnt get it

if it wasnt a joke then its just to help people starting out or

The joke was about how a lot of old MW2 GSC menus were poorly coded.

At first glance, the code you posted has a syntax error. You're referencing the object $auth_user but it is never instantiated. Looks like it's supposed to be some PDO helper class considering the runQuery function. You should probably do some checking on the query result too to make sure it's actually returning a row. You'll also need to include session_start at the top of your script to utilize sessions.

Not trying to insult you or anything. Just pointing out some problems with your code :p
03-17-2017, 05:00 PM #5
IcarusXSEC
Do a barrel roll!
I would of presumed people already have their own logged in user session, and i have the session start at the top of all my pages but i would of people already would have that sorted.

Also could I PM About something to do with your psn wrapper for PHP
03-17-2017, 05:02 PM #6
IcarusXSEC
Do a barrel roll!
Originally posted by Tustin View Post
The joke was about how a lot of old MW2 GSC menus were poorly coded.

At first glance, the code you posted has a syntax error. You're referencing the object $auth_user but it is never instantiated. Looks like it's supposed to be some PDO helper class considering the runQuery function. You should probably do some checking on the query result too to make sure it's actually returning a row. You'll also need to include session_start at the top of your script to utilize sessions.

Not trying to insult you or anything. Just pointing out some problems with your code :p



Sorry forgot to quote
03-18-2017, 04:12 AM #7
Tustin
Balls of Steel
Originally posted by PumahModzUk View Post
I would of presumed people already have their own logged in user session, and i have the session start at the top of all my pages but i would of people already would have that sorted.

Also could I PM About something to do with your psn wrapper for PHP

Well it seemed like this was for people who have little to no web dev experience (considering "basic"...) so I wanted to point out some issues people might have if they just copy and paste this verbatim.

You don't need to ask to PM me, my PMs are always open

The following user thanked Tustin for this useful post:

IcarusXSEC
03-20-2017, 04:33 PM #8
IcarusXSEC
Do a barrel roll!
Originally posted by Tustin View Post
Well it seemed like this was for people who have little to no web dev experience (considering "basic"...) so I wanted to point out some issues people might have if they just copy and paste this verbatim.

You don't need to ask to PM me, my PMs are always open


Ah ok i see now, well thank you i will always add those in the future

and ill pm you about the wrapper now

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo