Jump to content

banfw001

New Members
  • Posts

    8
  • Joined

  • Last visited

banfw001's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello All, I am trying to turn a PHP application I made about a year ago into a WordPress plugin. I'm reasonably new in the world of WordPress plugins and have what I think will be a simple question. My plugin creates a shortcode, and when the WordPress page with that short code on is loaded, the program calls a function and displays it. My question is, within that function, how do I create a link or button (or something else) which will run the chosen function. Here is what I mean: function welcome() { ?>Welcome. This is the first screen of the plugin. Click <a href="???">here</a> to register. } function register() { register here } How would I make the above piece of code work. My thanks in advance.
  2. Thanks a lot! Your helps appreciated.
  3. That's great, thanks so much! Is there a way I can adjust the $update query so that it updates multiple columns like I had originally, so take for instance surname, address, tel number, etc...
  4. Thanks for your fast response, however this did not work either. Any further help would be appreciated
  5. Could you not import your email addresses into a list array, then send the email from the list array
  6. Hi, I am having a bit of a problem with a simple task and I was wondering if someone would be able to help. I have a php system which allows members to sign up, stores their information in a mysql database, then they can sign in and do all sorts of things. The area I have a problem with is I'm trying to make an update page so that they can edit their details stored in the mysql database. My code is as follows. <?php session_start(); include_once "base.php"; //connects to database $username = mysql_real_escape_string($_SESSION['Username']); // get users username from session $forename = mysqL_real_escape_string($_SESSION['Forename']; //gets already stored forename $newforename = mysql_real_escape_string($_POST['newforename']);//post for new forename $registerquery = mysql_query("INSERT INTO users WHERE Username = '".$username."'(Forename) VALUES('".$newforename."')"); //finds row for the user and updates the forename column with new record ?> <form method="post" action="index.php" name="registerform" id="registerform"> <fieldset> <label for="newforename">Forename:</label><input type="text" name="newforename" id="newforename" /><br /> <input type="submit" name="register" id="register" value="Register" /> </fieldset> </form> Unfortunately this code does not update the database at all, however it does not crash or produce any errors! I would really appreciate any help you can give with this.
  7. Thanks a lot for your fast response. This worked perfectly.
  8. Hi, I am trying to make a website that stores and prints information entered by users. The site consists of one database that contains two tables. The first table stores all of the users details such as their username, password and address. The second is store users prescription items in. I have the login system completely working, and it shows all of the users details stored in the table once they have logged in. Now, I need the site to do more. Once the user has logged in, it want it to display all prescription items belonging to that user. The table consists of several fields, one of which is the users username. This means, when the user creates a new prescription item, it is sotred in the table and in one of the row cell's, their username is stored. I then want to be able to search for all records by that user and display them. I have managed to create some code which gets the information from the table and displays it on the users console page, however it gets information from all users, not just their account. For example, if someone had a username of 'fruit', I want it to search the prescription table for all records with the username 'fruit' and display them. Here is my code so far: <?php include_once "base.php"; $result = mysql_query("SELECT * FROM prescriptions") or die(mysql_error()); $list = ''; while ($row = mysql_fetch_array($result)) { $user_id = $row["user_id"]; $drug = $row["drug"]; $strength = $row["strength"]; $quantity = $row["quantity"]; $list .= '' . $drug . ' ' . $strength . ' ' . $quantity . '<br/>'; } ?> I would appreciate any help on this problem. Thanks in advance
×
×
  • 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.