By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,564 Members | 810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,564 IT Pros & Developers. It's quick & easy.

Stand alone PHP parser

P: n/a
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help
Jul 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
none wrote:
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help


Yes.

It might be helpful to know what platform you intend running this on (Linux
(what distro), Microsoft...) and how you've got PHP configured (mod_php in
Apache, cgi, ...?)

C.
Jul 17 '05 #2

P: n/a
none wrote:
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help


You can run a script locally by using php -q script.php
If you're on linux you could also include a shebang at the beginning of the
script like you'd do for a shell scrips (#!/bin/bash et cetera)
with the path to your php binary.
HTML formatting however is meaningless on a prompt, so you may have to adapt
existing code if that was developed for web output.

Pjotr
Jul 17 '05 #3

P: n/a
none wrote:
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help


which web server Apache or IIS. (I am assuming Wxx as you are using Access)
Using google, you can find MANY examples of using ODBC (db is somewhat irrelevant).
here is an example right out of the docs:

$con = odbc_connect('MSAccessDriver','','');

if ($con)
{
echo "odbc connected<br>";
$sql = "select * from Results";

//this function will execute the sql satametn in
//correspondance to the table in the db
$exc = odbc_exec($con,$sql);
}
else
echo "odbc not connected<br>";

if($exc)
{
echo "selection completed<br>";
while($row = odbc_fetch_row($exc) )
echo $row->id."<br>";
}
else
echo "selection failed<br>";

?>
and another example

$Fields = odbc_num_fields($cur);
print "<table border='1' width='100%'><tr>";
// Build Column Headers
for ($i=1; $i <= $Fields; $i++){
printf("<th bgcolor='silver'>%s</th>", odbc_field_name( $cur,$i));
}
// Table Body
$Outer=0;
while( odbc_fetch_row( $cur )){
$Outer++;
print "<tr>";
for($i=1; $i <= $Fields; $i++){
printf("<td>%s</td>", odbc_result( $cur, $i ));
}
print "</tr>";
}
print "</table>";
print "<b> Your request returned $Outer rows!</b>";

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #4

P: n/a
On 23 Jul 2004 03:37:07 -0700, ki*****@aol.com (none) wrote:
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help


take a look at PHP-GTK (http://gtk.php.net/) for stand-alone PHP apps
needing a GUI.


Jul 17 '05 #5

P: n/a
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:rg******************@newssvr24.news.prodigy.c om...
none wrote:
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help
which web server Apache or IIS. (I am assuming Wxx as you are using

Access) Using google, you can find MANY examples of using ODBC (db is somewhat

irrelevant).

The question was about a standalone PHP parser, not about how to use ODBC in
PHP.

<snip of Access examples>

- Virgil
Jul 17 '05 #6

P: n/a
Sorry guys (and gals) I didnt make myself completely clear.

I want to run HTML pages in a browser with forms and PHP functionality
to a db using ODBC without a server needing to be installed or
anything. I was wondering if anyone had come a accross a single
executable possibly that would parse PHP and display the PHP file in a
browser? I want to go in, set up the ODBC connection, copy some
executable, display PHP files in a browser. I may be asking a bit much
and if it isn't possible I need to look at alternatives.

Cheers
Jul 17 '05 #7

P: n/a
"none" <ki*****@aol.com> wrote in message
news:86**************************@posting.google.c om...
Howdy all,

I'm wondering if someone could give some direction on a problem I have
or share their experiences.

I'm wanting to create a little PHP application that will run on a
local machine and use ODBC to connect to a Access database on that
machine. A series of forms will interact with the database but if I
understand correctly, I need some way to parse the PHP code. Is there
a stand alone parser that could be used in place of a HTTP server?

Thanks for any help


Check out this little program I wrote. I call it "PHP FreeStyle." It allows
you to run PHP scripts, using the web browser interface, without setting up
a web server and so on. You will find it at my personal page (see
signature).

--
Obey the Clown - http://www.conradish.net/bobo/
Jul 17 '05 #8

P: n/a
On 23 Jul 2004 13:21:22 -0700, ki*****@aol.com (none) wrote:
Sorry guys (and gals) I didnt make myself completely clear.

I want to run HTML pages in a browser with forms and PHP functionality
to a db using ODBC without a server needing to be installed or
anything. I was wondering if anyone had come a accross a single
executable possibly that would parse PHP and display the PHP file in a
browser? I want to go in, set up the ODBC connection, copy some
executable, display PHP files in a browser. I may be asking a bit much
and if it isn't possible I need to look at alternatives.


ok.. you want to run your app in a browser... that would be a 'web'
browser, would it?

web browsers (InternetExploder, NutScrape, FireFob, etc) are,
generally, designed to talk to systems which speak HTML.

in order for your browser to receive this HTML, something must send it
to it .. this something is generally called a 'web server' (or HTTP
server).

if you want to run PHP applications via a browser without the use of
an HTTP server then:

a) you're a fool

b) you've got a lot of work ahead of you, building your own equivalent
of an HTTP server.

why can't you just install a local copy of Apache - i've built several
systems with just such a setup for customers - Apache/PHP with MySQL
and/or M$-Access; where i install Apache on theit laptop/PC and off
they go.. sometimes the machine in question will _never_ be connected
to The Internet - it doesn't matter.

now then, what was your problem again?
Jul 17 '05 #9

P: n/a
> take a look at PHP-GTK (http://gtk.php.net/) for stand-alone PHP apps
needing a GUI.


Cheers, thanks
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.