Perl CGI DBI Module Tutorial

Perl CGI DBI Module Tutorial

Perl CGI DBI Module Tutorial

Onto yesterday’s Perl CGI DateTime Module Primer Tutorial‘s …

  • use of Perl module DateTime … today, we try out …
  • use of Perl module DBI

… to facilitate the connection and use of database functionalities, in our case MySql, as per our changed Perl code to read off our WordPress blog MySql database table fields …

  1. post_title
  2. post_content

… fields describing WordPress blog “Posting Title” and “Posting HTML Content” respectively, as per


#!/usr/bin/perl

use DateTime;
use DateTime::TimeZone;
use DBI;
use DBD::mysql;


local ($buffer, @pairs, $pair, $name, $value, %FORM);
# Read in text
$ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;

if ($ENV{'REQUEST_METHOD'} eq "GET") {
$buffer = $ENV{'QUERY_STRING'};
}

# Split information into name/value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}

$first_name = $FORM{first_name};
$last_name = $FORM{last_name};
$blogp = $FORM{blogp};
$oneletter = substr( $first_name, 0, 1 );

$dt = DateTime->now; # same as ( epoch => time )

$dttz = DateTime::TimeZone->new( name => 'local' )->name();

$dt->set_time_zone( $dttz );


$year = $dt->year;
$month = $dt->month; # 1-12


$day = $dt->day; # 1-31


$dow = $dt->day_of_week; # 1-7 (Monday is 1)


$hour = $dt->hour; # 0-23
$minute = $dt->minute; # 0-59


$second = $dt->second; # 0-61 (leap seconds!)


$doy = $dt->day_of_year; # 1-366 (leap years)


$doq = $dt->day_of_quarter; # 1..


$qtr = $dt->quarter; # 1-4

$dmy = $dt->dmy('/'); # 06/12/2002


$hms = $dt->hms; # 14:02:29

$tt = "";
$cont = "";

print "Content-type:text/html\r\n\r\n";
print "<html>";
print "<head>";
print "<title>Hello - Second CGI Program</title>";
print "<script type=text/javascript>";
print " var ls='', ns='', qwr=''; ";
print " function zeroize(iinsf) { var insf=iinsf; var sep='/', i=0; while (insf.substring(i).substring(0,1) >= '0' && insf.substring(i).substring(0,1) <= '9') { i++; } sep=insf.substring(i).substring(0,1); ";
print " var arr=insf.split(sep); ";
print " if (eval('' + arr.length) >= 3) { ";
print " if (eval('' + arr[1].length) == 1) { insf=insf.replace(sep + arr[1] + sep, sep + '0' + arr[1] + sep); } ";
print " if (eval('' + arr[0].length) == 1) { insf='0' + insf; } ";
print " arr=insf.split(' ')[1].split(':'); ";
print " if (eval('' + arr.length) >= 3) { ";
print " if (insf.indexOf(' pm') != -1) { insf=insf.replace(' ' + arr[0].trim() + ':', ' ' + eval(12 + eval('' + arr[0].trim())) + ':').replace(' pm', ' '); arr=insf.split(' ')[1].split(':'); } ";
print " if (eval(-1 + eval('' + arr[1])) == eval('' + document.getElementById('mystime').innerHTML.split(':')[1])) { insf=insf.replace(':' + arr[1] + ':', ':' + document.getElementById('mystime').innerHTML.split(':')[1] + ':'); arr[1]='zz'; } ";
print " if (eval('' + arr[1].length) == 1) { insf=insf.replace(':' + arr[1] + ':', ':0' + arr[1] + ':'); } ";
print " if (eval('' + arr[0].trim().length) == 1) { insf=insf.replace(arr[0].trim() + ':', '0' + arr[0].trim() + ':'); } ";
print " } ";
print " } ";
print " return insf; ";
print " } ";
print " function loctime() { if (ls == '') { ";
print " qwr='' + Intl.DateTimeFormat().resolvedOptions().timeZone; ";
print " var d = new Date(); ";
print " d.toLocaleString('en-US', { timeZone: qwr }); ";
print " ns=document.getElementById('mystime').innerHTML.split(':')[2].split(' ')[0]; ";
print " ls=zeroize(('' + d.toLocaleString()).replace(',','')) + ' <a onclick=alert(qwr); style=cursor:pointer;text-decoration:underline;>GMT' + d.toString().split(' GMT')[1] + '</a>'; } if (!document.getElementById('mytime')) { setTimeout(loctime,1000); } else { ";
print " document.getElementById('mytime').innerHTML=ls.replace(':' + ls.split(':')[2].split(' ')[0] + ' ', ':' + ns + ' '); } ";
print " } ";
print "</script>";
print "</head>";
print "<body onload=setTimeout(loctime,1000);>";
print "<h2 style='font-family:Courier New;'>Hello $first_name $last_name <br> Local: <span id=mytime></span><br>Server: <span id=mystime>$dmy $hms</span> $dttz </h2><h4>";

if ($blogp == "") { $blogp = $first_name; } else { $oneletter = substr( $blogp, 0, 1 ); }

if (ord($oneletter) >= ord("0") && ord($oneletter) <= ord("9")){
# /*** mysql hostname ***/
$hostname = 'dbhost';

# /*** mysql username ***/
$username = 'username';

# /*** mysql ***/
$password = 'password';

$dbname = 'dbname';

$tname = 'table_name';
$hostname = "DBI:mysql:$dbname:$hostname";

$dbh = DBI->connect($hostname, $username, $password);

$sth = $dbh->prepare("SELECT post_title, post_content FROM $tname WHERE ID=?");

$sth->execute( $blogp );

#while ( @row = $sth->fetchrow_array ) {
while (($tt, $cont) = $sth->fetchrow_array()) {
print "<details id=myd><summary id=mys><h1><a target=_blank href='//www.rjmprogramming.com.au/ITblog/?p=$blogp'>$tt</a></h1></summary>$cont</details>\n";
# print "@row\n";
}
# }
}


print "</h4><br><br><iframe id=myif src='/hello_get.html' style='width:100%; height:1500px;'></iframe></body>";
print "</html>";

1;

… in the changed Perl hello_get.cgi code supervised by (and working with) the changed HTML hello_get.html web application.


Previous relevant Perl CGI DateTime Module Primer Tutorial is shown below.

Perl CGI DateTime Module Primer Tutorial

Perl CGI DateTime Module Primer Tutorial

Do you remember with Perl CGI Modes of Use Primer Tutorial how we used the Perl programming language as an alternative server language player up at the RJM Programming website?

Well, in any case, today, we explore some Perl modules which can make that code be more useful to us. As for how we interface to it, we’ve written a very simple HTML hello_get.html interfacer we’d like to thank https://www.tutorialspoint.com/perl/perl_cgi.htm for …


<html>
<head>
<title>hello_get ... Thanks to https://www.tutorialspoint.com/perl/perl_cgi.htm and https://perlmaven.com/most-popular-perl-modules and https://www.freecodecamp.org/news/how-to-format-dates-in-javascript/</title>
</head>
<body>
<h1>hello_get.html HTML calls on hello_get.cgi Perl</h1>
<h3>RJM Programming - February, 2023</h3>
<h3>Thanks to https://www.tutorialspoint.com/perl/perl_cgi.htm and https://perlmaven.com/most-popular-perl-modules and https://www.freecodecamp.org/news/how-to-format-dates-in-javascript/</h3>
<br><br>
<FORM action = "/cgi-bin/hello_get.cgi" method = "GET">

First Name: <input type = "text" name = "first_name"> <br>

Last Name: <input type = "text" name = "last_name">
<input type = "submit" value = "Submit">
</FORM>

</body>
</html>

… where this webpage’s HTML form’s action points to some Perl hello_get.cgi (up at the Apache web server, in a cgi-bin folder and with the executable permission bit set) code using the DateTime module, and showing the user client local timezone current time compared to this RJM Programming’s server timezone current time …


#!/usr/bin/perl

use DateTime;
use DateTime::TimeZone;

local ($buffer, @pairs, $pair, $name, $value, %FORM);
# Read in text
$ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;

if ($ENV{'REQUEST_METHOD'} eq "GET") {
$buffer = $ENV{'QUERY_STRING'};
}

# Split information into name/value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}

$first_name = $FORM{first_name};
$last_name = $FORM{last_name};

$dt = DateTime->now; # same as ( epoch => time )

$dttz = DateTime::TimeZone->new( name => 'local' )->name();

$dt->set_time_zone( $dttz );

$year = $dt->year;
$month = $dt->month; # 1-12

$day = $dt->day; # 1-31

$dow = $dt->day_of_week; # 1-7 (Monday is 1)

$hour = $dt->hour; # 0-23
$minute = $dt->minute; # 0-59

$second = $dt->second; # 0-61 (leap seconds!)

$doy = $dt->day_of_year; # 1-366 (leap years)

$doq = $dt->day_of_quarter; # 1..

$qtr = $dt->quarter; # 1-4

$dmy = $dt->dmy('/'); # 06/12/2002

$hms = $dt->hms; # 14:02:29

print "Content-type:text/html\r\n\r\n";
print "<html>";
print "<head>";
print "<title>Hello - Second CGI Program</title>";
print "<script type=text/javascript>";
print " function loctime() { ";
print " var qwr='' + Intl.DateTimeFormat().resolvedOptions().timeZone; ";
print " var d = new Date(); ";
print " d.toLocaleString('en-US', { timeZone: qwr }); ";
print " var ns=document.getElementById('mystime').innerHTML.split(':')[2].split(' ')[0]; ";
print " var ls=('' + d.toLocaleString()).replace(',','') + ' GMT' + d.toString().split(' GMT')[1]; ";
print " document.getElementById('mytime').innerHTML=ls.replace(':' + ls.split(':')[2].split(' ')[0] + ' ', ':' + ns + ' '); ";
print " } ";
print "</script>";
print "</head>";
print "<body onload=loctime();>";
print "<h2 style='font-family:Courier New;'>Hello $first_name $last_name <br> Local: <span id=mytime></span><br>Server: <span id=mystime>$dmy $hms</span> $dttz </h2>";
print "<br><br><iframe src='/hello_get.html' style='width:100%; height:1500px;'></iframe></body>";
print "</html>";

1;

The use of the HTML iframe in the Perl (writing HTML) code means that either …

… can be used to get the “Perl ball” rolling.


Previous relevant Perl CGI Modes of Use Primer Tutorial is shown below.

Perl CGI Modes of Use Primer Tutorial

Perl CGI Modes of Use Primer Tutorial

A little while back we revisited the “PHP Modes of Use” discussion last talked about with PHP Modes of Use File Traverse Tutorial as shown below. We’re revisiting today to show you that it doesn’t have to be only your principal server language of choice involved in this kind of thinking, but you can also talk in terms of your chosen CGI (Common Gateway Interface) language of choice, which happens to be Perl here at the www.rjmprogramming.com.au domain. The other common partner of PHP as its CGI partner is Python.

Do you recall the three modes of use we talk about? Here they are below …

  1. web browsing … via use of a GET arguments URL
  2. curl (from the command line … in our case Linux, but could be Windows too)
  3. command line (Perl) … use the $ARGV[] array variables

… all good? … okay, we keep those three, but with the curl option would also like to show that it can be subdivided into two submodes, namely …

  • GET mode (via URL)
  • POST mode (via simulated FORM (results))

… which is probably true of non-CGI scenarios as well, but is particularly pertinent to discussions of CGI because we generally think of the CGI language as the one POSTed to from an HTML form, but, here, hopefully, we extend your mode of thinking to the thought that curl can handle you sending in the GET mode (though that is awkward with more than one GET argument and using the & syntax) or via the use of various non-default switches such as -d “name1=value1 name2=value2 blah3=blahval3″ to simulate a (form) POST … pretty powerful, huh … enabling what you may have only initially thought of as a piece of code to process an HTML form, into the additional possibility of a standalone piece of code that curl can control independent of a web browser, as required. Please note, though, for those of us who want to “do their heads in” for “Onion of the 4th Dimension” possibilities, the PHP exec command, or something like it could be used with options 3 and/or 2a and/or 2b to create other possibilities.

Anyway, have a look (closely) at our tutorial picture and our web browser mode live run

… and have a look at the associated Perl CGI programming source code to read an *.htm* or *.txt file in readfile.cgi

Of great help for this tutorial was Perl and CGI for the World Wide Web by Elizabeth Castro page 195 (in particular) and What is the cURL command-line syntax to do a POST request? (for help regarding curl command line switches for POSTed data) … thanks.

Will leave you with a recall of the discussions regarding PHP (our primary non-CGI server language of choice at www.rjmprogramming.com.au) below …


Previous relevant PHP Modes of Use File Traverse Tutorial is shown below.

PHP Modes of Use File Traverse Tutorial

PHP Modes of Use File Traverse Tutorial

It’s been a while since we last visited the “PHP Modes of Use” discussion last talked about with C Supervised PHP Modes of Use Primer Tutorial as shown below. We’re revisiting today to show you a practical application of writing PHP for those three modes of use … namely …

  1. web browsing … use a form, then post, and then access the $_POST[] variables
  2. curl … note how only the one $_GET[] variable is available because of trouble using & on Linux command line (use of @ is a local idea … there would be many other ideas that will work)
  3. command line PHP … use the $argv array variables

… so have a look at the PHP programming source code to traverse a directory’s files in doviadir.php with the live “web browsing” live run.

Will leave you with a recall of the discussion below …

Recently, with our tutorial, PHP Modes of Use Primer Tutorial as shown below, we talked about three modes of use or access for the use of PHP and today we encase all that thinking in a Mac OS X command line C program supervision framework. You’d expect that this is possible in a command line or Intranet environment where Linux or unix (or, for that matter, Windows command line … though the code here won’t work for this one) where C can have such a close relationship to the Linux or unix kernel, that it would be able the “run the whole show” as well as the shell commands themselves can. Today’s C has been compiled using the Xcode IDE for use with a Mac OS X operating system.

So that’s the supervisor above. Read, again, about “the supervised”, below …

PHP is a very flexible programming language. It is probably best known as a server-side language called by a web browser using the http transport layer (ie. web browsing, or “surfing the net”). Let’s list three modes of use of PHP below:

  1. Via http transport layer (ie. web browsing, or “surfing the net”) in an Internet mode of use (eg: HTTP://localhost:8888/in_tra_ter_net.php?SERVER_NAME=localhost) in address bar of a web browser
  2. Via curl in an Internet mode of use (eg. curl HTTP://localhost:8888/in_tra_ter_net.php?SERVER_NAME=localhost) at Linux or unix or Windows command line to default output (and you can redirect as required via > outfile or >> outfile or 2> errfile or 2>> errfile)
  3. Via command line PHP in Linux or unix or Windows command line in a command or Intranet mode of use (eg. php in_tra_ter_net.php SERVER_NAME=localhost) at a Linux or unix or Windows command line (where the PHP code has been placed, in our example (ie. it is not a URL, but is a file specification of your (Intranet) server)) to default output (or you can redirect as required via > outfile or >> outfile or 2> errfile or 2>> errfile)

Does it matter how the PHP is accessed? Well, yes, it does … sometimes, but not if the code is restricted to a particular mode of usage (but part of what this tutorial is about is to get across how flexible and powerful PHP can be). With the last option above, lots of $_SERVER[] variables are undefined, for example.

  1. $_SERVER[‘HTTP_COOKIE’] is defined, unlike with curl usage (this seems to be a possibility as a way to detect curl usage). Most $_SERVER[] variables are defined, but $argv[] array is not.
  2. $_SERVER[‘HTTP_COOKIE’] is undefined, but a lot of the rest of $_SERVER[] variables are as above.
  3. Lots of $_SERVER[] variables are undefined, with the exception of $_SERVER[‘SCRIPT_FILENAME’] which may help you with Intranet application usage. You cannot enter $_GET[] arguments (on the command line (ie. you will get a syntax error if you try)) so these are undefined, but $argv[] array can be used in that awkward way shown, so that $argv[1] can be arranged to be a lot like $_SERVER[‘QUERY_STRING’] (ie. the bits after ? in a URL).

So, maybe you have the one mode of use in mind, but you need to think a bit to support all the modes of use, if they are all to have a role with the PHP you write, because, despite these differences it is good to use $_SERVER[] and $_GET[] and $_POST[] and $_SESSION[] and $argv[] and whatever else in terms of variable information PHP offers in terms of attempting to write generic code.

Hope you get something out of today’s discussion of our Mac OS X MAMP Apache local Web server environment example (hence the HTTP://localhost:8888/ you see in the URLs above), but please bear in mind that there would be other modes of use once you think of other client HTML element ways of accessing PHP (all a lot like the “web browsing” of above) or other possibilities within PHP code itself via PHP commands exec and file_get_contents the latter of which can be very useful during Intranet usage where there is no curl available, perhaps. Instead of curl you could use wget as another approach.

You may want to see a live run (web browsing) here at the rjmprogramming.com.au domain of the supervised PHP (alone), or you may want to download the supervised PHP programming source code you could call in_tra_ter_net.php or you may want to download the supervisory main.c as you require.

A “stop press” to do with code above is that since the “queueing up” of this blog post a new posting is relevant, the recent PHP Modes of Use Follow Up Tutorial, and that to incorporate this posting’s improvements over PHP Modes of Use Primer Tutorial, you’d want to substitute all mentions of in_tra_ter_net with more_in_tra_ter_net in the code of main.c as above. The relevant changed PHP source code is more_in_tra_ter_net.php


Previous relevant C Supervised PHP Modes of Use Primer Tutorial is shown below.

C Supervised PHP Modes of Use Primer Tutorial

C Supervised PHP Modes of Use Primer Tutorial

Recently, with our tutorial, PHP Modes of Use Primer Tutorial as shown below, we talked about three modes of use or access for the use of PHP and today we encase all that thinking in a Mac OS X command line C program supervision framework. You’d expect that this is possible in a command line or Intranet environment where Linux or unix (or, for that matter, Windows command line … though the code here won’t work for this one) where C can have such a close relationship to the Linux or unix kernel, that it would be able the “run the whole show” as well as the shell commands themselves can. Today’s C has been compiled using the Xcode IDE for use with a Mac OS X operating system.

So that’s the supervisor above. Read, again, about “the supervised”, below …

PHP is a very flexible programming language. It is probably best known as a server-side language called by a web browser using the http transport layer (ie. web browsing, or “surfing the net”). Let’s list three modes of use of PHP below:

  1. Via http transport layer (ie. web browsing, or “surfing the net”) in an Internet mode of use (eg: HTTP://localhost:8888/in_tra_ter_net.php?SERVER_NAME=localhost) in address bar of a web browser
  2. Via curl in an Internet mode of use (eg. curl HTTP://localhost:8888/in_tra_ter_net.php?SERVER_NAME=localhost) at Linux or unix or Windows command line to default output (and you can redirect as required via > outfile or >> outfile or 2> errfile or 2>> errfile)
  3. Via command line PHP in Linux or unix or Windows command line in a command or Intranet mode of use (eg. php in_tra_ter_net.php SERVER_NAME=localhost) at a Linux or unix or Windows command line (where the PHP code has been placed, in our example (ie. it is not a URL, but is a file specification of your (Intranet) server)) to default output (or you can redirect as required via > outfile or >> outfile or 2> errfile or 2>> errfile)

Does it matter how the PHP is accessed? Well, yes, it does … sometimes, but not if the code is restricted to a particular mode of usage (but part of what this tutorial is about is to get across how flexible and powerful PHP can be). With the last option above, lots of $_SERVER[] variables are undefined, for example.

  1. $_SERVER[‘HTTP_COOKIE’] is defined, unlike with curl usage (this seems to be a possibility as a way to detect curl usage). Most $_SERVER[] variables are defined, but $argv[] array is not.
  2. $_SERVER[‘HTTP_COOKIE’] is undefined, but a lot of the rest of $_SERVER[] variables are as above.
  3. Lots of $_SERVER[] variables are undefined, with the exception of $_SERVER[‘SCRIPT_FILENAME’] which may help you with Intranet application usage. You cannot enter $_GET[] arguments (on the command line (ie. you will get a syntax error if you try)) so these are undefined, but $argv[] array can be used in that awkward way shown, so that $argv[1] can be arranged to be a lot like $_SERVER[‘QUERY_STRING’] (ie. the bits after ? in a URL).

So, maybe you have the one mode of use in mind, but you need to think a bit to support all the modes of use, if they are all to have a role with the PHP you write, because, despite these differences it is good to use $_SERVER[] and $_GET[] and $_POST[] and $_SESSION[] and $argv[] and whatever else in terms of variable information PHP offers in terms of attempting to write generic code.

Hope you get something out of today’s discussion of our Mac OS X MAMP Apache local Web server environment example (hence the HTTP://localhost:8888/ you see in the URLs above), but please bear in mind that there would be other modes of use once you think of other client HTML element ways of accessing PHP (all a lot like the “web browsing” of above) or other possibilities within PHP code itself via PHP commands exec and file_get_contents the latter of which can be very useful during Intranet usage where there is no curl available, perhaps. Instead of curl you could use wget as another approach.

You may want to see a live run (web browsing) here at the rjmprogramming.com.au domain of the supervised PHP (alone), or you may want to download the supervised PHP programming source code you could call in_tra_ter_net.php or you may want to download the supervisory main.c as you require.

A “stop press” to do with code above is that since the “queueing up” of this blog post a new posting is relevant, the recent PHP Modes of Use Follow Up Tutorial, and that to incorporate this posting’s improvements over PHP Modes of Use Primer Tutorial, you’d want to substitute all mentions of in_tra_ter_net with more_in_tra_ter_net in the code of main.c as above. The relevant changed PHP source code is more_in_tra_ter_net.php


Previous relevant PHP Modes of Use Primer Tutorial is shown below.

PHP Modes of Use Primer Tutorial

PHP Modes of Use Primer Tutorial

PHP is a very flexible programming language. It is probably best known as a server-side language called by a web browser using the http transport layer (ie. web browsing, or “surfing the net”). Let’s list three modes of use of PHP below:

  1. Via http transport layer (ie. web browsing, or “surfing the net”) in an Internet mode of use (eg: HTTP://localhost:8888/in_tra_ter_net.php?SERVER_NAME=localhost) in address bar of a web browser
  2. Via curl in an Internet mode of use (eg. curl HTTP://localhost:8888/in_tra_ter_net.php?SERVER_NAME=localhost) at Linux or unix or Windows command line to default output (and you can redirect as required via > outfile or >> outfile or 2> errfile or 2>> errfile)
  3. Via command line PHP in Linux or unix or Windows command line in a command or Intranet mode of use (eg. php in_tra_ter_net.php SERVER_NAME=localhost) at a Linux or unix or Windows command line (where the PHP code has been placed, in our example (ie. it is not a URL, but is a file specification of your (Intranet) server)) to default output (or you can redirect as required via > outfile or >> outfile or 2> errfile or 2>> errfile)

Does it matter how the PHP is accessed? Well, yes, it does … sometimes, but not if the code is restricted to a particular mode of usage (but part of what this tutorial is about is to get across how flexible and powerful PHP can be). With the last option above, lots of $_SERVER[] variables are undefined, for example.

  1. $_SERVER[‘HTTP_COOKIE’] is defined, unlike with curl usage (this seems to be a possibility as a way to detect curl usage). Most $_SERVER[] variables are defined, but $argv[] array is not.
  2. $_SERVER[‘HTTP_COOKIE’] is undefined, but a lot of the rest of $_SERVER[] variables are as above.
  3. Lots of $_SERVER[] variables are undefined, with the exception of $_SERVER[‘SCRIPT_FILENAME’] which may help you with Intranet application usage. You cannot enter $_GET[] arguments (on the command line (ie. you will get a syntax error if you try)) so these are undefined, but $argv[] array can be used in that awkward way shown, so that $argv[1] can be arranged to be a lot like $_SERVER[‘QUERY_STRING’] (ie. the bits after ? in a URL).

So, maybe you have the one mode of use in mind, but you need to think a bit to support all the modes of use, if they are all to have a role with the PHP you write, because, despite these differences it is good to use $_SERVER[] and $_GET[] and $_POST[] and $_SESSION[] and $argv[] and whatever else in terms of variable information PHP offers in terms of attempting to write generic code.

Hope you get something out of today’s discussion of our Mac OS X MAMP Apache local Web server environment example (hence the HTTP://localhost:8888/ you see in the URLs above), but please bear in mind that there would be other modes of use once you think of other client HTML element ways of accessing PHP (all a lot like the “web browsing” of above) or other possibilities within PHP code itself via PHP commands exec and file_get_contents the latter of which can be very useful during Intranet usage where there is no curl available, perhaps. Instead of curl you could use wget as another approach.

You may want to see a live run (web browsing) here at the rjmprogramming.com.au domain or you may want to download the PHP programming source code you could call in_tra_ter_net.php as you require.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in Database, eLearning, Operating System, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>