pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedNewbie needs help
2+ messages / 2 participants
[nested] [flat]
* Newbie needs help
@ 1998-05-29 06:19 Matthew T. O'Connor <matt@ctlno.com>
1998-05-29 06:47 ` Re: [INTERFACES] Newbie needs help Constantin Teodorescu <teo@flex.ro>
0 siblings, 1 reply; 2+ messages in thread
From: Matthew T. O'Connor @ 1998-05-29 06:19 UTC (permalink / raw)
To: 'pgsql-interfaces@hub.org' <pgsql-interfaces@hub.org>
Hello, I am a newbie in the world of Linux Admin \ Apache \ PostgreSQL.
I have a lot of Unix user experience, and a lot of NT sysadm experience.
I am now attempting to work with Linux and create a web site that is
driven by a database. I am looking for a good guide to how to do this.
Any help? I have been reading about the pgsql module for Apache, but I
can't find it. and I have been reading about PHP3 but I'm not sure how
to use it.
Thanks in advance,
Matt O'Connor
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [INTERFACES] Newbie needs help
1998-05-29 06:19 Newbie needs help Matthew T. O'Connor <matt@ctlno.com>
@ 1998-05-29 06:47 ` Constantin Teodorescu <teo@flex.ro>
0 siblings, 0 replies; 2+ messages in thread
From: Constantin Teodorescu @ 1998-05-29 06:47 UTC (permalink / raw)
To: Matthew T. O'Connor <matt@ctlno.com>; +Cc: 'pgsql-interfaces@hub.org' <pgsql-interfaces@hub.org>
Matthew T. O'Connor wrote:
>
> Any help? I have been reading about the pgsql module for Apache, but I
> can't find it. and I have been reading about PHP3 but I'm not sure how
> to use it.
<html>
<body bgcolor=white>
<?
Function Listeaza () {
global $res;
$nrecs=pg_NumRows($res);
$i=0;
echo "Clic <img src='/img/balls/bullet5.gif'> afiseaza si
modifica notita<br>";
echo "Clic <img src='/img/balls/bullet6.gif'> sterge <font
color=red><b>iremediabil</b></font> notita<br><br>";
echo "<table width=100%><tr
bgcolor=cyan><th> <th>Data<th>Subiect<th> </tr>";
while($i<$nrecs) {
echo "<tr><td align=center><a
href='blocnotes.php3?show+ovar=", pg_Result($res,$i,"oid"), "'>";
echo "<img src='/img/balls/bullet5.gif' border=0></a>";
echo
"<td>",substr(pg_Result($res,$i,"data"),0,16),"<td>",pg_Result($res,$i,"subiect");
echo "<td align=center><a
href='blocnotes.php3?delete+oid=",pg_Result($res,$i,"oid"),"'>";
echo "<img src='/img/balls/bullet6.gif'
border=0></a></tr>";
$i++;
}
echo "</table><br><br>";
}
?>
<? if ($argc==0): ?>
<? elseif ($argv[0]=="add"): ?>
<center>
<form name="nou" method=POST action="blocnotes.php3?store">
<table border=0><tr>
<td>Titlu: <input type="text" name="subiect" size=50></td></tr>
<tr><td><textarea name="continut" wrap="hard" rows=9
cols=60></textarea></td></tr>
<tr><td align="CENTER"><input type="submit" name="okbtn"
value="Adauga"></td></tr>
</table></form></center>
<? elseif ($argv[0]=="store"):
$acum=date("d-m-Y H:i:s");
echo "<font color=navy><b>Titlu</b></font> : $subiect<br><br>";
echo "<font color=maroon><b>Continut</b></font> :
$continut<br><br>";
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"insert into blocnotes
values('$REMOTE_USER','$acum','$subiect','$continut')");
pg_FreeResult($res);
pg_Close($dbc);
echo "A fost introdus in blocnotes!";
elseif ($argv[0]=="list"):
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"select oid,* from blocnotes where
iuzar='$REMOTE_USER' order by data desc");
Listeaza();
pg_FreeResult($res);
pg_Close($dbc);
elseif ($argv[0]=="show"):
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"select * from blocnotes where oid=$ovar");
echo "<font color=navy><b>Subiect :
</b></font>",pg_Result($res,0,"subiect"),"<br><br>";
echo "<font color=navy><b>Continut
:</b></font><br><pre>",pg_Result($res,0,"continut"),"</pre>";
echo "<br><br><br>";
echo "<a
href='blocnotes.php3?showandchange+ovar=$ovar'>Modifica</a><br>";
pg_FreeResult($res);
pg_close($dbc);
elseif ($argv[0]=="showandchange"):
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"select * from blocnotes where oid=$ovar");
?>
<center>
<form name="nou" method=POST
action="blocnotes.php3?modify+ovar=<? echo $ovar;?>">
<table border=0>
<tr><td>Titlu: <input type="text" name="subiect" size=50
value="<? echo pg_Result($res,0,"subiect"); ?>"></td></tr>
<tr><td><textarea name="continut" wrap="hard" rows=9 cols=60><?
echo pg_Result($res,0,"continut"); ?></textarea></td></tr>
<tr><td align="CENTER"><input type="submit" name="okbtn"
value="Modifica">
<input type="button" value="Abandon"
onClick="history.back()"></td></tr>
</table>
</form></center>
<?
pg_FreeResult($res);
pg_close($dbc);
elseif ($argv[0]=="modify"):
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"update blocnotes set
subiect='$subiect',continut='$continut' where oid=$ovar");
pg_FreeResult($res);
pg_Close($dbc);
echo "Am modificat, noile informatii sint :<br><br>";
echo "<font color=navy>Subiect :
</font><b>$subiect</b><br><br>";
echo "<font color=navy>Continut : </font><pre>$continut</pre>";
elseif ($argv[0]=="delete"):
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"delete from blocnotes where oid=$oid");
pg_FreeResult($res);
$res=pg_Exec($dbc,"select oid,* from blocnotes where
iuzar='$REMOTE_USER' order by data");
Listeaza();
pg_FreeResult($res);
pg_Close($dbc);
elseif ($argv[0]=="search"): ?>
<center>
<form name="caut" method=POST action="blocnotes.php3?find">
<table border=0>
<tr><td>Cuvint <input type="text" name="wort"></td></tr>
<tr><td align="CENTER"><input type="submit" name="okbtn"
value="Cauta"></td></tr>
</table></form></center>
<? elseif ($argv[0]=="find"):
if ($wort !="") {
$dbc=pg_Connect("localhost","5432","","","consiliu");
$res=pg_Exec($dbc,"select oid,* from blocnotes where
subiect ~* '$wort' or continut ~* '$wort'");
$nrecs=pg_NumRows($res);
if($nrecs==0) {
echo "Nu am gasit nimic!<br><br>";
} else {
Listeaza();
}
pg_FreeResult($res);
pg_Close($dbc);
}
else {
echo "<center><h1>Introduceti macar o litera
!</h1></center>";
}
endif;
?>
</body>
</html>
--
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-05-29 06:47 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-05-29 06:19 Newbie needs help Matthew T. O'Connor <matt@ctlno.com>
1998-05-29 06:47 ` Constantin Teodorescu <teo@flex.ro>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox