Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Core
.NET MAUI
.NET Standard
Active Directory
ADO.NET
Agile Development
AI
AJAX
AlbertAGPT
Alchemy
Alexa Skills
Algorand
Algorithms in C#
Android
Angular
ArcObject
ASP.NET
ASP.NET Core
Augmented Reality
Avalanche
AWS
Azure
Backbonejs
Big Data
BizTalk Server
Blazor
Blockchain
Bootstrap
Bot Framework
Business
Business Intelligence(BI)
C#
C# Corner
C# Strings
C, C++, MFC
Career Advice
Careers and Jobs
Chapters
ChatGPT
Cloud
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Copilot
Cortana Development
Cosmos DB
Cryptocurrency
Cryptography
Crystal Reports
CSS
Current Affairs
Custom Controls
Cyber Security
Data Mining
Data Science
Databases & DBA
Databricks
Design Patterns & Practices
DevExpress
DevOps
DirectX
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
F#
Files, Directory, IO
Flutter
Games Programming
GDI+
General
Generative AI
GO
Google Cloud
Google Development
Graphics Design
Graphite Studio
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Infragistics
Internet & Web
Internet of Things
Ionic
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
Kotlin
Langchain
Leadership
Learn .NET
Learn iOS Programming
LINQ
Machine Learning
Metaverse
Microsoft 365
Microsoft Fabric
Microsoft Office
Microsoft Phone
Microsoft Teams
Mobile Development
MongoDB
MuleSoft
MySQL
NEAR
NetBeans
Networking
NFT
NoCode LowCode
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Polygon
PostgreSQL
Power Apps
Power Automate
Power BI
Power Pages
Printing in C#
Products
Progress
Progressive Web Apps
Project Management
Public Speaking
Python
Q#
QlikView
Quantum Computing
R
React
React Native
Reports using C#
Robotics & Hardware
RPA
Ruby on Rails
RUST
Salesforce
Security
Servers
ServiceNow
SharePoint
Sharp Economy
SignalR
Smart Devices
Snowflake
Software Architecture/Engineering
Software Testing
Solana
Solidity
Sports
SQL
SQL Server
Startups
Stratis Blockchain
Swift
SyncFusion
Threading
Tools
TypeScript
Unity
UWP
Visual Basic .NET
Visual Studio
Vue.js
WCF
Wearables
Web API
Web Design
Web Development
Web3
Windows
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML
XML
XNA
XSharp
Register
Login
1
Answer
Submit button does nothing?
NURU DAWUD
3y
695
1
Reply
php part(registration.php)
<?php
session_start();
include
(
"db_conn.php"
);
if
(isset(
$_POST
[
'submit'
])){
function
validate(
$data
){
$data
= trim(
$data
);
$data
=
stripslashes
(
$data
);
$data
= htmlspecialchars(
$data
);
return
$data
;
}
$fatherName
= validate(
$_POST
[
'fatherName'
]);
$firstName
= validate(
$_POST
[
'firstName'
]);
$grandFatherName
= validate(
$_POST
[
'grandFatherName'
]);
$gender
= validate(
$_POST
[
'gender'
]);
$nationality
= validate(
$_POST
[
'nationality'
]);
$residence
= validate(
$_POST
[
'residence'
]);
$country
= validate(
$_POST
[
'country'
]);
$regionOrState
= validate(
$_POST
[
'regionOrState'
]);
$city
= validate(
$_POST
[
'city'
]);
$email
= validate(
$_POST
[
'email'
]);
$phone
= validate(
$_POST
[
'phone'
]);
$department
= validate(
$_POST
[
'department'
]);
$graYear
= validate(
$_POST
[
'year'
]);
$studyLevel
= validate(
$_POST
[
'studyLevel'
]);
$ocopation
= validate(
$_POST
[
'ocopation'
]);
$comment
= validate(
$_POST
[
'comment'
]);
$sql2
= "INSERT INTO mebmbertable(
fatherName, firstName, grandFatherName, gender, nationality, residence, country, regionOrState, city, email, phone, department, graYear, studyLevel, ocopation, comment )
VALUES
(
'$fatherName'
,
'$firstName'
,
'$grandFatherName'
,
'$gender'
,
'$nationality'
,
'$residence'
,
'$country'
,
'$regionOrState'
,
'$city'
,
'$email'
,
'$phone'
,
'$department'
,
'$graYear'
,
'$studyLevel'
,
'$ocopation'
,
'$comment'
)";
if
(!mysqli_query(
$conn
,
$sql2
)) {
echo
" Your account has been created successfully. Please login... "
;
}
else
{
header(
"error=unknown error occurred"
);
}
}
?>
HTML PART(registrationForm.php)
<?php
session_start();
include
(
"db_conn.php"
);
?>
<!DOCTYPE html>
<!-- Designined by CodingLab - youtube.com/codinglabyt -->
<html lang=
"en"
dir=
"ltr"
>
<head>
<meta charset=
"UTF-8"
>
<title> Membership Registration </title>
<link rel=
"stylesheet"
href=
"style1.css"
>
<link rel=
"stylesheet"
href=
"style.css"
>
<script src=
"alert.js"
></script>
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
</head>
<body>
<div
class
=
"container"
>
<center>
<h1
class
=
"h"
> X University Registrar
and
Alumni Directorate </h1>
<h2
class
=
"h"
>Membership Application Form</h2>
<h3
class
=
"h"
>Membership is open to all graduates of Wollo University
</center>
<div
class
=
"content"
>
<form action=
"registration.php"
method=
"POST"
>
<div
class
=
"title"
>1) Personal Information </div>
<div
class
=
"user-details"
>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Father Name</span>
<input type=
"text"
name=
"fatherName"
placeholder=
"Father Name"
required >
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Name</span>
<input type=
"text"
name=
"firstName"
placeholder=
"Name"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Grand Father Name</span>
<input type=
"text"
name=
"grandFatherName"
placeholder=
"Grand Father Name"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Nationality</span>
<input type=
"text"
name=
"nationality"
placeholder=
"Nationality"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Residence</span>
<input type=
"text"
name=
"residence"
placeholder=
"Residence"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Country</span>
<input type=
"text"
name=
"country"
placeholder=
"Country"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Region/State</span>
<input type=
"text"
name=
"regionOrState"
placeholder=
"Region/State"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>City</span>
<input type=
"text"
name=
"city"
placeholder=
"City"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Email</span>
<input type=
"email"
name=
"email"
placeholder=
"Email"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Phone</span>
<input type=
"tel"
name=
"phone"
placeholder=
"Phone"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Gender</span>
<select name=
"gender"
id=
"gender"
class
=
"select"
>
<option value=
""
>...</option>
<option value=
"Male"
>Male</option>
<option value=
"Female"
>Female</option>
</select>
</div>
</div>
<div
class
=
"title"
>2) Education </div>
<div
class
=
"user-details"
>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Department</span>
<input type=
"text"
name=
"department"
placeholder=
"Department"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Year of Gratuation</span>
<input type=
"year"
name=
"year"
placeholder=
"Year of Gratuation"
required>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Study Level</span>
<select name=
"studyLevel"
id=
"sl"
class
=
"select"
>
<option value=
""
>...</option>
<option value=
"Diploma"
>Diploma</option>
<option value=
"Advanced Deploma"
>Advanced Deploma</option>
<option value=
"BA/BSC"
>BA</option>
<option value=
"BA/BSC"
>BSC</option>
<option value=
"MA/MSC"
>MA</option>
<option value=
"BA/BSC"
>MSC</option>
<option value=
"PhD"
>PhD</option>
<option value=
"Speciality"
>Speciality</option>
<option value=
"Sub-Speciality"
>Sub-Speciality</option>
</select>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Ocopation</span>
<select name=
"ocopation"
id=
"sl"
class
=
"select"
>
<option value=
""
>...</option>
<option value=
"Gevernment"
>Gevernment</option>
<option value=
"Private"
>Private</option>
<option value=
"NGO"
>NGO</option>
<option value=
"Job Seeker"
>Job Seeker</option>
<option value=
"Other"
>Other</option>
</select>
</div>
<div
class
=
"input-box"
>
<span
class
=
"details"
>Comment</span>
<textarea
class
=
"textarea"
name=
"comment"
placeholder=
" Enter your comment here..."
></textarea>
</div>
<div
class
=
"input-box"
>
<br><br>
<img src=
"img/Membership.gif"
width=
"70%"
height=
"50%"
align=
"right"
alt=
"Membership"
>
</div>
</div>
<div
class
=
"button"
>
<button type=
"submit"
value=
"Save"
> Save</button>
</div>
<div
class
=
"button"
>
<input type=
"reset"
value=
"Reset"
>
</div>
<div>
<h1
class
=
"a"
><a href=
"logout.php"
>Logout</a></h1>
</div>
</form>
<div
class
=
"thankyou"
>
<center> <h3>Hello, <?php
echo
$_SESSION
[
'name'
]; ?></h3>
<p
class
=
"p"
>Thank you
for
filling this form<br>
X University Registrar
and
Alumni Directorate
</p> </center>
</div>
</div>
</div>
</body>
</html>
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to install xdebug on xamp in mac
Doesnt save into my PHP