LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 05-25-2017, 10:17 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,653

Rep: Reputation: 255Reputation: 255Reputation: 255
PHP: easy basic beginner tutorial for Post, Button, and SELF use


Hello,

If you would like to learn the most basic use of file creation, file append, post, and button on a single SELF page, you can maybe benefit of this easy basic beginner tutorial for Post, Button, and SELF use.

A friend of mine asked me to make him a small page on the web.
It allowed me to make it easy for beginners and available for students and education purpose.

Link:
https://github.com/spartrekus/php-sc...hp-button-post

More about PHP:
https://www.w3schools.com/php/
 
Old 05-26-2017, 09:30 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,852
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Cool!
 
Old 05-26-2017, 03:17 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,258
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Thank you for sharing your code and ideas!

Please remember that the Programming forum is for receiving answers to programming questions. As this post is intended to share an idea rather than seek an answer, I am moving it to the General forum where it will be seen by a more general audience of members and guests.
 
Old 05-26-2017, 03:42 PM   #4
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,653

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
char *astrovar="astrogeek";
Quote:
Originally Posted by astrogeek View Post
Thank you for sharing your code and ideas!

Please remember that the Programming forum is for receiving answers to programming questions. As this post is intended to share an idea rather than seek an answer, I am moving it to the General forum where it will be seen by a more general audience of members and guests.
// I may believe that programming section of LQ might be better adapted, especially for programmers seeking examples.

/*
- anytime -
*/

printf( "%s %s\n", "Thanks" , astrovar );
 
Old 05-26-2017, 05:18 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,258
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Quote:
Originally Posted by Xeratul View Post
char *astrovar="astrogeek";
I may believe that programming section of LQ might be better adapted, especially for programmers seeking examples.
That is correct, the Programming forum is the place for those seeking help and examples. This post does not fit that description.

It is not a repository of everyone's personal examples offered without context.

I think it is great that you want to share your own learning experience and example code, but I would suggest that your blog space here on LQ might be a more appropriate place to post your examples and tutorials when not offered in response to the questions of others. Doing so provides a level of personal organization and continuity of thought not appropriate within the forums.

Code:
/* Just trying to point you in the right direction */
struct right_direction {...};
struct right_direction *Xeratul;

Last edited by astrogeek; 05-26-2017 at 06:51 PM. Reason: seeking help and examples
 
Old 05-26-2017, 07:57 PM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,258
Blog Entries: 3

Rep: Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713
Nice initiative.

Since you imply a request for feedback, two concerns:

If the plan is to use it as a positive example of PHP, it should probably address the concept of tainted data and explicitly address the matter of data validation before exposing any user-provided input to the system or the user. This is probably covered by use of the function htmlspecialchars(), but it is important enough to point out in some inline comments and maybe make a bigger deal out of what is happening with the user-supplied data.

Second, you are inadvertently including a lot of unnecessary JavaScript. At least it is present there in the buttons. This greatly weakens security and accessibility but if nothing else distracts from what should be the single focus: PHP. So the OnClick attributes accidentally included in the button elements should be removed. Buttons should always be inside a form element, anyway.

Last edited by Turbocapitalist; 05-26-2017 at 07:59 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Beginner Online Tutorial Recommendation llewellen Linux - Newbie 6 10-24-2016 11:26 PM
[SOLVED] First post... Xubuntu 14.04 Basic command (finger) , hopefully easy question for a newbie Ahowar22 Linux - Newbie 2 04-05-2016 12:07 PM
LXer: Tutorial: An Easy Tutorial on IP Tables and Port Knocking LXer Syndicated Linux News 0 02-04-2008 04:20 PM
PHP-Mysql Tutorial for beginner/dummies ewinandar Programming 1 11-10-2004 02:10 AM
A good beginner C tutorial/book dragoon linux Programming 3 12-25-2003 01:05 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration