https://www.phpmyadmin.net/ creating a database online

gennady46

New member
Hi, I am new to this, never have done this before.

To make it brief, I have a visual studio windows form application in C# which requires a licensing feature.

When the user clicks on "Buy" button it will open up the website, and after the successful payment it will redirect to a certain webpage URL.

There I would want using PHP language to do a few tasks.

Getting PC ID, like PC ID = CPU + Motherboard ID.

Then generate a random license key for the end user.

Then adding to a PHP my admin database, like PC ID, Name, email and a license key.

So that I would be able to download updated database to my SSD at any time.

Also, maybe emailing automatically a license key to a provided email address.

In addition, I also would be able to add a new person information manually with all its fields if I need to do so.

I know that this database has to be created to begin with in order to get started and the PHP coding must be implemented on the webpage as well.

So, after successful delivery of license key, my program asks to paste into the field the license key. And it needs to be checked whether the key is correct format or not

and also access the updated database to check if the key exists or does not, and if it does the program would be activated.

Can anyone direct where how to begin.

Thanks in advance, Gennady
 
Better off using something like LicenseBox or WHMCSSolutions, which has a Licensing feature addon available. What you are asking will take a lot of work to get it right.

However, this is something I scraped up. It may or may not help. Untested.

PHP:
<?php
// Function to get the PC ID
function getPCID() {
    // Simulating retrieval of CPU and Motherboard IDs
    $cpuID = shell_exec("wmic cpu get ProcessorId");
    $motherboardID = shell_exec("wmic baseboard get SerialNumber");
    
    // Clean up the output
    $cpuID = trim(preg_replace('/\s+/', ' ', $cpuID));
    $motherboardID = trim(preg_replace('/\s+/', ' ', $motherboardID));
    
    // Combine CPU and Motherboard IDs to create a unique PC ID
    return $cpuID . '-' . $motherboardID;
}

// Function to generate a random license key
function generateLicenseKey($length = 16) {
    $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
    $licenseKey = '';
    
    for ($i = 0; $i < $length; $i++) {
        $licenseKey .= $characters[rand(0, strlen($characters) - 1)];
    }
    
    return $licenseKey;
}

// Main execution
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Assuming payment is successful
    $pcID = getPCID();
    $licenseKey = generateLicenseKey();
    
    // Output the results
    echo "PC ID: " . htmlspecialchars($pcID) . "<br>";
    echo "Generated License Key: " . htmlspecialchars($licenseKey);
}
?>

The script checks if the request method is POST, which indicates that the payment process has been completed.
It then calls the getPCID() function to retrieve the PC ID and the generateLicenseKey() function to create a new license key.
Finally, it outputs the PC ID and the generated license key, ensuring that any special characters are safely displayed using htmlspecialchars().
 
I just found out my webhosting company which is weebly.com does not support PHP, but it does support JavaScript instead.

Thanks, let me know, thanks so much for your help, I will view those proposition...
 
I was trying to find a suitable website hosting company like Weebly, which also supports phpMyAdmin and MySQL databases and PHP code as

well, and also Node.js (maybe), so that I can create are all necessary functions for my pages, since those I found are too complicated to manage,

can you suggest something, thanks so much...

Get back...
 
You are best to google website hosting companies that offer what you need. Do a search for your local area is best.
PHP, MySQL, PHPMyAdmin, etc. If you want a website builder, add that to your search too. Most companies offer applications, such as Softaculous and Installatron, which have website builders.
The company I use, VentraIP, is from my locality.
 
Thanks, I will explore and look, I found some site, InfinityFree.com and they say it takes 72 hours to access site builder and control panel, and file manager. I can probably figure out uploading PHP files with starting INDEX.PHP, will see. It was so easy to use Weebly, I attached pictures, all you have to do is to drag an item into the site and modify it according to your needs. But they do not support things mentioned above.

I mean to be clear to make it on auto pilot payments and activation keys, you need code on a site. Otherwise, I can easily make it in C# language form for the users to fill out and submit, but I would have to process payments myself, since I am using square payment system and it would delay the whole thing, I cannot be by the computer 24/7, which would not be so good for users. Write back, thanks so much.
 

Attachments

  • weebly-items1.jpg
    weebly-items1.jpg
    40.6 KB · Views: 2
  • weebly-items2.jpg
    weebly-items2.jpg
    42.7 KB · Views: 2
Thanks, I will explore and look, I found some site, InfinityFree.com and they say it takes 72 hours to access site builder and control panel, and file manager. I can probably figure out uploading PHP files with starting INDEX.PHP, will see. It was so easy to use Weebly, I attached pictures, all you have to do is to drag an item into the site and modify it according to your needs. But they do not support things mentioned above.

I mean to be clear to make it on auto pilot payments and activation keys, you need code on a site. Otherwise, I can easily make it in C# language form for the users to fill out and submit, but I would have to process payments myself, since I am using square payment system and it would delay the whole thing, I cannot be by the computer 24/7, which would not be so good for users. Write back, thanks so much.
It should not take 72 hours to access these things. Even if it is free. Any hosting company that says it does I would not use them at all. How long would it take for them to provide support?
You are better off, for what you need, using a premium Lynux web hosting company.
 
Back
Top