Re: Hello world1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 30, 2022 at 11:33 PM JEFFRY KILLEN <jekillen@xxxxxxxxxxx> wrote:
>
> Hello;
> The most effective and direct way to do form input screening is with javascript. It can also play a sound an/ or just thow up some
> disturbing text style sheet styles to inform the user of unacceptible input.
>
> As far as PHP is concerned, it can do all the screening. But the user input does have to get to the server unscreened if you do not use javascript
> or html5 regex imbedded in the text input element to prescreen it. The downside of javascript has been that the user can turn it off in the browser
> or use a client that does not have javascript. Php also cannot play sounds in the browser (if you want to use sounds). It can serve sounds but javascript
> is needed to play them for the user.
>
> I have been doing web design and development for some time and have seen that well known browsers have all made it fairly difficult to turn javascript
> off if you do not have development sophistication and many sights use it extensively. Particularly commercial sights use it to fetch, load and display ad
> content.
>
> It also means that you have another programming language to get to know and be confortable with. The best and most comprehensive text I know of
> is OReilly publications Javascript: The Definitive Guide. The latest version is the 7th edition. But I would also get access to the 6th edition becuase
> there are significant differences in the language in the 7th edition and the 6th edition will give a better perspective on what the differences are.
>
> Something to be aware of: Javascript is NOT java. It is a scripted language that needs a javscript interpreter to run it. It has been developed from the
> start to be used in web browsers. But it can also be used in PDF (not well known, and Adobe implementation has its own quirks). Google has also
> developed a server side version of javascript: node.js. I have rudimentary experience with it and understand it to be fairly widely accepted and used.
>
> One thing to come to terms with regarding web development: NOTHING is really simple. So expecting simplicity will compromise effectiveness and
> efficiency.
>
> Best;
> Jeff K.
>
> > On Dec 30, 2022, at 9:39 PM, Deliberatus Freeman <deliberatus@xxxxxxxxxxx> wrote:
> >
> > Hi. I'm a recent adopter of php, and I am coming to love it.
> >
> > I am building a website. I need to accept a form, and it is to accept ONLY letters and numbers; just 1 char of anything else and it must bark like a rabid duck and abort the process. whats the simple reliable way to do this?
> >
> > PS: I rent a slice off the end of the box, and cannot play around with configuring things.
> >
> >
> >
> > Salute!
> >              -Kirk Bailey
> >               It is an ill wind that blows no minds.

Sounds like Deliberatus is a newbie who just needs a <simple-answer>

https://www.w3schools.com/php/php_forms.asp
https://www.w3schools.com/php/php_ref_regex.asp
https://www.w3schools.com/php/php_ref_string.asp

Good old fashioned GET and POST methods via HTML form. Still perfectly
valid, still used today, and it's a foundational building block for
all the complexity Jeff was talking about. For validating what
characters were input, I'd go with regex (regular expressions). If
regex's cryptic syntax is too much for you right now, you could just
loop through each character of the input string and check it against a
list of valid characters (strstr function might be useful).

</simple-answer>

I'd also like to clarify/correct a couple of Jeff's historical statements.

While JavaScript was originally developed with the intention to embed
within Netscape Navigator (a web browser), the core language
specification is not exclusive to that use case. All browser-specific
elements are introduced as API bindings to the application in which
it's embedded. Not long after its introduction, they were embedding
JavaScript in Netscape Enterprise Server for server-side scripting as
well. Web browsers were just the most prolific usage of JavaScript for
the first decade of its existence and what we think of first. There is
a wide range of applications that embed JavaScript these days.

NodeJS was not developed by Google. Google developed the v8 JavaScript
Engine, which NodeJS uses, but alone v8 is just a C++ library that
sits there and does absolutely nothing. It is the responsibility of an
application developer who is embedding v8 to bootstrap an instance of
the engine and provide API bindings to whatever capabilities you want
to expose to JavaScript; such as filesystem access, operating system
functions, environment data, networking, and so on.



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux