-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Microsoft Teams to add a faster way to build automations using slash commands
By zikalify,
- microsoft
- microsoft teams
- (and 7 more)
- 0 replies
- 0 views
-
Microsoft completes global rollout of autonomous AI Workflows for Teams
By zikalify,
- microsoft
- microsoft teams
- (and 13 more)
- 0 replies
- 0 views
-
- 0 replies
- 0 views
-
Google Meet users on Google Workspace get extended emoji set, with some limitations
By zikalify,
- google workspace
- (and 4 more)
- 0 replies
- 0 views
-
- 2 replies
- 0 views
-
Question
Mohammad_Khalid_Hussain
Assalamalaikum (peace be unto you) to all the Muslims,
and a Hi to everyone else,
I'm currently doing a project for a course at my university, we are told to create a simple registration system using PHP and MySQL. I've already created the logon page and it works well. I'm currently working on the Main Page which the user is shown after a successful login attempt.
I'm a beginner at PHP and MySQL so any advice as to how to improve my code is appreciated as well :)
Now on to the question, on the Main Page, I have several buttons positioned in a certain way and a content area below them. What I want to do is to change the content area depending on the button pressed. But once a button is pressed, the old content from the content area is removed and the new content is displayed. I don't want to change the buttons position,etc... or the title, etc... just the content area every time a button is pressed.
Here is my source code:
<html><title>Main Page</title> <style type="text/css"> div#main { text-align: left; font-size: 200%; } div#user { text-align: left; font-size: 100%; } </style> </html> <?php $user= $_POST["user"]; $pwd = $_POST["pwd"]; $database="wp_project"; $connect = mysql_connect('localhost',$user,$pwd); $thedatabase=mysql_select_db($database,$connect) or die( "Unable to select database"); $get_name = mysql_query("SELECT concat(p_first,' ',p_last) AS Name FROM people") or die(mysql_error()); while($info = mysql_fetch_array($get_name)) { $user_name=$info['Name']; } if(!$connect) { echo "MySQL connection failed!"; mysql_error(); exit; } else { ?> <html><div id="main"></html><?php Print "Main Page<br/>";?> <html></div> <html><div id="user"></html><?php Print "User: $user_name";?> <html></div><HR> <input type='submit' name="allbooking" value="View Booking(s)"/> <input type='submit' name="newbooking" value="New Booking"/> <input type='submit' name="venuecheck" value="Venue Availability"/> <input type='submit' name="history" value="User History"/> <input type ="submit" name="logoutbutton" value="Logout"/><br/> <HR> </html></html> <?php mysql_close(); }; ?>Screenshot is attached. Any help is much appreciated.
Thanks a lot.
Link to comment
https://www.neowin.net/forum/topic/1045835-help-with-main-page-want-some-content-to-stay-the-same/Share on other sites
0 answers to this question
Recommended Posts