• Contact Editorial Team
  • Advertise on YNOT
  • Submit PR
Thursday, March 26, 2026
  • Login
  • Register
YNOT
  • Home
  • Industry News
    • Porn Star & Adult Talent News
    • Adult Business News
    • Adult Novelty News
    • Adult Industry Legal News
    • Tech News for Adult Webmasters
    • Video Game News for Adults
    • EU News
  • PR Wire
  • Podcasts
  • Industry Guides
  • Newsletters
No Result
View All Result
  • Home
  • Industry News
    • Porn Star & Adult Talent News
    • Adult Business News
    • Adult Novelty News
    • Adult Industry Legal News
    • Tech News for Adult Webmasters
    • Video Game News for Adults
    • EU News
  • PR Wire
  • Podcasts
  • Industry Guides
  • Newsletters
No Result
View All Result
YNOT
No Result
View All Result
Home YNOT Features YNOT University

Introduction to PHP and MYSQL – Part 3

admin by admin
July 25, 2002
in YNOT University
491
SHARES
Share on FacebookShare on Twitter

It’s All In Your Form

[Part 1] [Part 2]

One of the most common uses of PHP is the dynamic processing of form variables. Just like watching a major league baseball player stepping up to the plate, a great deal of the PHP game is all in your form.It’s All In Your Form

[Part 1] [Part 2]

One of the most common uses of PHP is the dynamic processing of form variables. Just like watching a major league baseball player stepping up to the plate, a great deal of the PHP game is all in your form. HTML forms are used on the World Wide Web for a variety of purposes that range from the sign-up and authentication of their member base, to the most complex online e-commerce applications. Since this rudimentary skill will be used in practically every website you work on, I have dedicated an entire article to the use and power of form processing.

The Wind Up… The Pitch

To begin, let’s create a simple HTML page with a form on it. The following HTML page contains a basic form and some of the basic input field types that you will use.

<HTML><HEAD><TITLE>PHP Form Basics</TITLE></HEAD>
<BODY>
<FORM ACTION=”formprocess.php” METHOD=POST>
<center>
Page Title: <INPUT TYPE=TEXT NAME=”page_title” SIZE=40><br>
User Name: <INPUT TYPE=TEXT NAME=”username” SIZE=20><br>
Password: <INPUT TYPE=PASSWORD NAME=”password” SIZE=20><br>
<INPUT TYPE=SUBMIT NAME=”SUBMIT” VALUE=”Submit Me”>
</center>
</FORM>
</BODY>
</HTML>

The <FORM> tags will define where your form begins and ends. The ACTION parameter of the <FORM> tag controls what page will be the recipient of this form’s data when the submit button is pressed. The METHOD parameter controls the manner in which data is transmitted between your pages. I have chosen, and nearly always choose to send data via the POST method because of the transparency of the data. If I just lost you, let me take a moment to explain.

There are two alternatives you have when using the METHOD parameter of the <FORM> tags, POST and GET. To be honest, it won’t really make that much of a difference to you when you are first starting out with your exploration of dynamic form processing. This is because both methods do the most important thing you are attempting to accomplish, namely, delivering the data between forms. As you start to write more and more sophisticated applications the distinction will become readily apparent.

The difference between these two methods is how they deliver the data between forms. POST sends information without the user seeing any data while the GET sends all of the form variables as part of the URL that is passed into the address bar of the user’s browser.

URL using POST
http://www.yoursite.com/formprocess.php

URL using GET
http://www.yoursite.com/formprocess.php?page_title=PHPFun&username=Midnight&password=mypassword

Using POST will always insure that your users have a clean URL to look at in their browser, and prevents the display of unwanted information such as INPUT fields that use the TYPE=HIDDEN parameter to pass along global scope information in the stateless environment of the World Wide Web. It also insures that it will give the least amount of information to those individuals that would seek to break into your system, or feed it with invalid data in an attempt to disrupt the normal flow of information.

Keep Your Eye On The Ball And Swing!

Build this page, or copy and paste it into your PHP editor, and save it as formprocess.php. Take a minute to look the code over before continuing with your reading.

<HTML><HEAD><TITLE>PHP Form Basics</TITLE></HEAD><BODY><center><?php//This is a simple form processor//validate the page_title variableIf (!$page_title){ echo "No Page Title Assigned<br>";}else{ echo "page_title: ".$page_title."<br>";}//validate the log-in informationIf(!$username){ echo "No User Name Entered<br>";}else{ If($username=="Midnight"){ If(!$password){ echo "No Password Entered<br>"; }else{ If($password=="mypass"){ echo "You have logged into the system!<br>"; }else{ echo "Invalid Password Entered<br>"; } } }else{ echo "Invalid User Name Entered<br>"; } }?></center></FORM></BODY></HTML>

The code above, while not exactly as elegant as I would like it to be, clearly demonstrates a simple but effective login algorithm. You will notice that I use negative logic throughout the code. This simply means I test to see if the page_title variable does not exist with the If(!$page_title) as opposed to assuming that the page_title variable exists. I use negative logic a great deal when I code, but this is a personal preference and not necessarily how you should develop your personal coding style. Each person is different, and while computer science courses are designed to churn out happy little algorithm automatons, it is important to never let go of the artistic and creative passions that led you to programming in the first place.

Running The Bases

Upload these files and point your browser at the first HTML form that we built. You should see the makings of a simple authentication system for your website project. You will notice that the username and password are hard-coded into the formprocess.php page. Our next article will begin to delve into the world of interacting with a Relational Database Management System (RDBMS), namely MYSQL.

Until the next time, keep coding and don’t give up. Remember, it’s hard to hit a home run unless you keep stepping up to the plate to take your turn at bat.

— Midnight

Bob Cristello is a recognized leader in the programming world. His articles on programming have appeared in Byte, InfoWorld, Avatar, Computer Telephony and Visual Basic Programmers Journal. He is a former keynote speaker for the Microsoft nationwide broadcast series. Bob’s clients have included Prodigy Online, Arthur Anderson and Nellie Mae. He recently retired as the Head of the Internet Development Group at REBAR and lives just outside of Boston with his wife, Elsibeth. Most days, Bob and Elsibeth can be found in irc.webmasterlive.com in #adultnetsurprise and are better known as Midnight and Kandi. Bob can be reached by emailing midnighterotica@hotmail.com or via ICQ# 118997859.

Share196Tweet123
admin

admin

YNOT Admin wields his absolute power without mercy. When he's not busy banning spam comments to hell he enjoys petting bunnies and eating peanut butter. He recommends everyone try the YNOT Mail (ynotmail.com) email marketing platform and avoid giving their money to mainstream services that hate adult companies.

Related Posts

Adult Business News

UK Online Safety Act Cuts Pornhub Traffic 36% as Age Verification Takes Effect

December 13, 2025
Adult Business News

The Cambassador: Lindsey Banks, Flirt4Free and Brand Representation

September 5, 2018
Adult Business News

ImLive’s Mere Menezes Siqueira Manages Models, Makes the Machine Work

August 23, 2018
Corey Silverstein of Adult.law
Adult Business News

Silverstein Says: 3 Legal Issues Cam Companies, Models Must Pay Attention To

August 22, 2018
Load More

SPONSOR

INDUSTRY EVENTS

Currently Playing

YNOT Summit Model Track: Nerds Dig Sexy Gamers

YNOT Summit Model Track: Nerds Dig Sexy Gamers

01:05:46

YNOT Summit Webmaster Track: Understanding Webcam Business Models

00:51:11

YNOT Summit Model Track: Cam Law 101

01:26:24

SPONSOR

POPULAR NEWS

Chelsea Poe Continues Re-release Campaign with “The Dinner Party”

March 26, 2026
Tech Savy Crew Expands Adult SEO Services With 'AI-First Strategy'

Tech Savy Crew Expands Adult SEO Services With ‘AI-First Strategy’

March 26, 2026
Honey Play Box Officially Launches the “Vibrosa Mini”

Honey Play Box Officially Launches the “Vibrosa Mini”

March 26, 2026

Sponsor

YNOT YNOT

QUICK LINKS:

  • About YNOT
  • Terms of Use
  • Privacy Policy
  • Editorial Team
  • Advertise on YNOT
  • Sitemap

FRIENDS OF YNOT:

  • Best Adult Cams
  • Live Porn
  • Adult Reviews
  • Adult Email Marketing
  • Discounted Porn
  • vr porn sites
  • European Adult Biz Magazine

FRIENDS OF YNOT:

  • Rabbits Reviews
  • XXX Job Interviews
  • Adult Site Broker
  • Femdom
  • Paid Porn Sites
  • Live Sex
  • Cam girl sites
  • AI Girlfriend
  • live porn Vibra Game

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Home
  • Adult Business News
  • Adult Industry Legal News
  • Adult Novelty News
  • Porn Star & Adult Talent News
  • Tech News for Adult Webmasters
  • Video Game News for Adults
  • Interviews
  • Opinions
  • YNOT Industry Wire
  • Newsletters

Copyright © 2026 YNOT Group LLC.

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.