Jump to content

IChaps

Members
  • Content Count

    24
  • Joined

  • Last visited

Community Reputation

1 Neutral

About IChaps

  • Rank
    Newbie
  1. Hello. I'd just like to enquire, what is the best way to encrypt and decrypt please? I've created a basic signup form, and I would like to encrypt the data before it's written to a database. Then when I come to create the log in screen, I would like to access the database, pull a record, then decrypt the email and password, to check it matches what the user has entered. Or is there an easier way? Thank You. ps. Also could I please just ask. I've created a function for something else. When I've finished with it, can I delete or destroy it? Than
  2. Hello. I'd just like to ask about coping a picture file from one folder to another, then rename the copied file. At present I've written: $mstr_dir = "/core/graphics/"; $fle = "noimage.png"; $usr_folder = "/core/user/images/"; if (!copy("/core/graphics/noimages.png" , "/core/user/images/noimages.png")) { echo "ERR: ". error_reporting(E_ALL) . ini_set("display_errors", 1) . "<br>"; } error_reporting(E_ALL); ini_set("display_errors", 1); chmod("noimage.png",0777); $up_file = $last_id . ".png"; rename ('/core/user/images/noimages.png' , '/core/user/images/' . $up_file);
  3. Hello. I'd just like to enquire about loading a record/entry from a database and decryption. Encryption is fine. To start with I'm rebuilding my login/sign in file (signin.php) to load a record from the registration database, then decrypt the record, to check the email and password fields. All I wanted to enquire is, should I place the decryption code in the signin.php file, or because I'll be accessing the registration database later on in my project as well. Should I place the decryption in a separate php file (say decryption.php for example) and get the signin.php to load t
  4. Hello Jomla. I'm a newbie teaching myself php and MySQL. I've been looking at session since I started in June 2016. The way I got to read a database MySQL was:- $db_host = "localhost"; // $db_host $db_user = "<database username>"; // $db_user $db_pass = "<database password>"; // $db_pass $db_databasename = "<database name>"; // $db_databasename $conn = new mysqli($db_host, $db_user, $db_pass, $db_databasename); if(! $conn) { die('Connection Failed'.mysql_error()); } $sql = "SELECT Member_id, Fullname, Username, Email, Password, Location, Country, DOB
  5. Hello. I've created a small form with 6 text boxes and 2 select boxes/fields. The problem I'm facing is that I'm unable to post from the form to another php file. In the html form, I've written:- <form action="newmember.php" method="POST"> <table> <tr> <td>Full Name / Business Name:</td> <td><input name="txtAccountName" size="20" maxlength="50"></td> <td></td> </tr> <tr> <td>Username:</td> <td><input na
  6. IChaps

    Session Query

    Hello. I'd just like to enquire about using session S_session please. I've created 4 sessions to hold the log in data for the access to a database (host, username, password, database name) At present I've got it to load this data from a file and insert it into a session. Then for my use I've got it to display this data, to ensure it's reading from the file - which it is doing correctly. The problem I've got is in another php file. In the other php file the sessions are all blank and I don't know why this is. ---- In my index.php file the code reads [this works]:- //R
  7. Hi, Could I please briefly enquire about reading and writing to a file using php? I'm looking for a way of storing a database's, Name, Username and Password. Then reading it back again. Writing to a file, I've written:- // Write to file. $fp = fopen( dirname(__FILE__).'/sys/dbinfo.txt', 'w' ) or die("Couldn't open file:- "); fwrite($fp, $hostname); fwrite($fp, $database); fwrite($fp, $username); fwrite($fp, $password); fclose( $fp ); and to read back, I've written:- $fp = fopen( dirname(__FILE__).'/sys/dbinfo.txt', 'r' ) or die("Couldn't open file:- "); $db_host =
  8. Hello. I'd like to request a little guidance with regards forms and updating a database table please. I've created a form which has a dropdown list. I'd just like to enquire:- 1. How do I pass the selected result from the dropdown list to a variable? (at present I've written:- $user_gender = $_POST["profile_gender"] 2. I'm unable to update the database table. The database opens and there's no errors reported. I'd just like to ask the following looks ok? $sql = "UPDATE registration_table SET Gender='$user_gender' WHERE Member_id='$userID'"; Thank You.
  9. Hello. I'd just like to enquire how I would read and write to a file using php please? I'm looking to write a database's, Host, Username, Password, and database Name to a file name on the server, then at a later date. When I load the site, read this information back. At present I'm using the following to write to the file:- // Write to file. $fp = fopen( dirname(__FILE__).'/dbinfo.txt', 'w' ) or die("Couldn't open file:- "); fwrite($fp, $hostname); fwrite($fp, $database); fwrite($fp, $username); fwrite($fp, $password); fclose( $fp ); and to read back:- $fp = fopen( dirn
  10. Hello. Could anyone familiar with mysqli advise me with regards reading and searching a database please? After connecting to the database, and opening it. So far, I've written the following:- $sql = "SELECT Member_id, Fullname, Username, Email, Password, Location, Country, DOB, Gender, Photo, Tzone, WebsiteURL, MembershipType, AccountStatus, ShortURL, BusinessAddress, SignupDate, LastVisitDate, AccountClosedDate, AccountDeleteDate FROM registration"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while ($row = $result
  11. Hello again. I've tried the suggestion above, however I can't get it to work, as I'm getting a blank field. I have also written the code below, and I'm still getting a blank field next to the Account Name. Could I please request if anyone could write the correct coding for me? Thank You. <div id="editform"> <form name="edit_account" action="EDITING" method="POST"> <table style="border-size: 0px"> <tr> <td width="25%">Account Name:</td>
  12. Hello. Could I please request some guidance with editing data? I'm looking to build a form, which will pull data from a database and display it in the form, so it can be edited. However I don't know the correct way to enter the data into the form. or, I'll ask the question another way How do I edit a record held in a database please? Thank you.
  13. Hello Ingolme, Thank you for you reply. It's been about 8-10 years since I built a web site, so things may have changed some-what. The line I specified above, was used when I used FrontPage 2000/2002. Now, all attempts to use include in html has failed. I've used the guide on w3schools's site and I can't get to this to work for some reason. I just don't know what else to try. I'd welcome any help. Thank You.
  14. Hello. I'd just like to enquire, how would I include one html file in another? I'm using a bootstrap theme. I've created a menu, which I would like to include on a few more pages I'll be creating. I have used the old method - <!-- webbot bot="Include" U-Include="mainmenu.html" TAG="BODY" --> but I can't get this to work. I've also used iframe but all I get is a blank square. Could anyone please help? Thank You.
×
×
  • Create New...