LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   What can we do with an Webhosting SQL? (http://www.linuxquestions.org/questions/programming-9/what-can-we-do-with-an-webhosting-sql-713892/)

frenchn00b 03-23-2009 04:42 PM

What can we do with an Webhosting SQL?
 
How people could enter whatever text into a such box http://kmuto.jp/debian/hcl/, and it would be stored on the ftp ?
I use something, ftp webprovider, like free.fr


I found that we can do it in JAVA maybe that it is creating a TXT file in my ftp
here I found the begining of hte code:

when the person click on the knob how to make it save it into the ftp site ?? any code ?


Code:

<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

function MsgBox (textstring) {
alert (textstring) }

// - End of JavaScript - -->
</SCRIPT>

</HEAD>


<BODY>

<FORM>
<INPUT NAME="text1" TYPE=Text>
<INPUT NAME="submit" TYPE=Button VALUE="Show Me" onClick="MsgBox(form.text1.value)">
</FORM>

</BODY>
</HTML>



thx
regards

cowlol 03-23-2009 04:45 PM

You can do whatever since you dont use SQL as a frontend, you tell the php/ajax/ruby/html page to access a database stored in the mysql server for a query of some sort. Can realy have whatever database you want. But dont realy understand your question.

frenchn00b 03-23-2009 04:49 PM

Quote:

Originally Posted by cowlol (Post 3485445)
You can do whatever since you dont use SQL as a frontend, you tell the php/ajax/ruby/html page to access a database stored in the mysql server for a query of some sort. Can realy have whatever database you want. But dont realy understand your question.

so people could enter whatever text into a such box http://kmuto.jp/debian/hcl/, and it would be stored on the ftp ?
I use something, ftp webprovider, like free.fr

cowlol 03-23-2009 04:53 PM

I guess on that site thay have database and when the webpage ask for a query (the text put the in box) it does a search trough the database and see if it finds the terms the webpage is asking for and im pretty positive the sql database cant be stored on a ftp server.

frenchn00b 03-23-2009 04:59 PM

Quote:

Originally Posted by cowlol (Post 3485454)
I guess on that site thay have database and when the webpage ask for a query (the text put the in box) it does a search trough the database and see if it finds the terms the webpage is asking for and im pretty positive the sql database cant be stored on a ftp server.

Is there some sort of basic sql code to do so ??

very very extremely basic, so that we could start with ...

thanks for your information:!!!!!!!!!!!!!!!!

cowlol 03-23-2009 05:01 PM

http://www.hotscripts.com/

Im not sure if thats what your looking for, but its a great start.

frenchn00b 03-23-2009 05:06 PM

Quote:

Originally Posted by cowlol (Post 3485465)
http://www.hotscripts.com/

Im not sure if thats what your looking for, but its a great start.

those have sql free webhosting.http://www.free-webhosts.com/free-mysql-database.php
I should look into PHP, I just activated my SQL services, but still dont know much how I gonna make this... box to enter text, and been displayed on anohther webpages ...

frenchn00b 04-10-2009 01:20 PM

Quote:

Originally Posted by frenchn00b (Post 3485452)
so people could enter whatever text into a such box http://kmuto.jp/debian/hcl/, and it would be stored on the ftp ?
I use something, ftp webprovider, like free.fr

I found that we can do it in JAVA maybe that it is creating a TXT file in my ftp
here I found the begining of hte code:

when the person click on the knob how to make it save it into the ftp site ?? any code ?


Code:

<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

function MsgBox (textstring) {
alert (textstring) }

// - End of JavaScript - -->
</SCRIPT>

</HEAD>


<BODY>

<FORM>
<INPUT NAME="text1" TYPE=Text>
<INPUT NAME="submit" TYPE=Button VALUE="Show Me" onClick="MsgBox(form.text1.value)">
</FORM>

</BODY>
</HTML>


frenchn00b 04-10-2009 10:16 PM

Code:

Zugriff auf die Datenbank mit PHP

Um mit PHP auf eine Datenbank zuzugreifen, benötigen Sie folgende Angaben, die Sie in der Regel von Ihrem Webspace-Anbieter bekommen.
Server        z.B. localhost
Benutzername        z.B. Benutzer
Passwort        z.B. Password
Datenbankname        z.B. Databases

Am besten speichern Sie diese Daten in eine Datei, z.B. zugriff.php in ein durch .htaccess geschütztes Unterverzeichniss, und binden diese über ein include in Ihren PHP-Dateien ein, da dieser Code-Schnipsel evtl. mehrmals in diversen PHP-Dateien benötigen.

  <?php
  define("MYSQL_HOST",    "localhost"); 
  define("MYSQL_USER",    "benutzer");
  define("MYSQL_PASS",    "passwort");
  define("MYSQL_DATABASE", "Gastbuch");
  ?>

Um Kontakt mit der Datenbank aufzunehmen, benutzen Sie die Funktion mysql_connect(), die eine Variable eines Zeigers der Datenbank zurückgibt, die später für den Zugriff benötigt wird. Daher speichern Sie diese am besten in der Variablen $dz für Datenbankzeiger.
Sobald die verbindung zum Server steht, benutzen Sie die Funktion mysql_select_db(), um die Datenbank zu öffnen. Ist eine Funktion nicht erfolgreich, kann das Script mit OR die('Fehlertext') abgebrochen werden. Fehlt diese Funktion, werden folgende Anweisungen ausgeführt.
Zum schluss wird wird die Datenbank mit mysql_close() geschlossen. Das ganze sieht dann so aus:

  <?php
    include 'inc/zugriff.php';
    $dz = @mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS)
      OR die('Verbindung fehlgeschlagen');
    mysql_select_db(MYSQL_DATABASES)
      OR die('Konnte Datenbank nicht benutzen');
  ?>
  ... hier folgt weiterer Code ...
  <?php
    @mysql_close($dz);
  ?>


so I found that I should use PHP + SQL, to make the text box update my database in my ftp site, no?

progressing on good way?

frenchn00b 04-10-2009 10:50 PM

it seems that i have to create a CSV file and ask it ... but how ?

Code:

  <?php
  $abfrage = "SELECT url, urlname FROM links";
  $ergebnis = mysql_query($abfrage);
  while($row = mysql_fetch_object($ergebnis))
    {
    echo $row->url;
    }
  ?>



All times are GMT -5. The time now is 03:28 AM.