<PHP/MYSQL>

Pagina: 1
Acties:
  • 44 views sinds 30-01-2008

  • dawofl
  • Registratie: Februari 2002
  • Laatst online: 17-01 18:48
Goedenavond mensen,

Mijn probleem is als volgt, ik heb een phptriad geinstalleerd en heb een website draaien nu zit daar weer een MYSQL database aan gekoppeld en ik heb bijna alles voor elkaar behalve 1 klein ding. Hoe krijg ik het voor elkaar dat mijn *.html files werken? als ik ze namelijk rename naar *.php werkt het wel in combinatie met MYSQL maar als *.html heb werken ze niet 8)7

Hoop dat ik duidelijk genoeg ben \0/ |:(

GreeTz

I wanted to change the world but god wouldnt give me the source code


  • me1299
  • Registratie: Maart 2000
  • Laatst online: 22-08 14:04

me1299

$ondertitel

.html wordt standaard niet geparsed door php.

Het maakt eigenlijk niet uit wat je bewuste geest doet, omdat je onderbewuste automatisch precies dat doet wat het moet doen


  • Atomstar
  • Registratie: Juli 2002
  • Laatst online: 18-08 20:51
Als je in de apache config file kijkt staat daar een regel
AddType application/x-httpd-php .php
(iig bij php 4.1.2 (default in debian) met apache 1.3.26)
Daar kun je .html bijzetten en dan zou .html ook geparsed moeten worden.

Je moet alleen even kijken welke file je moet hebben ;) In Linux is het httpd.conf

[ Voor 21% gewijzigd door Atomstar op 19-06-2003 23:37 ]


Verwijderd

dan zul je er zo iets van moeten maken:

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>

PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
<?php 
//This script is created by Reptilian Feline 
//www.reptilian-feline.net 
//If you use it, please link to my site 
$full_path = getenv("REQUEST_URI"); 
//put the base URL in case you need it 
$base = "http://subomain.domain.ext"; 
//Get the name of the file 
$page_file = basename($full_path); 
//The files are named file_1.php, file_2.php, etc. Extract number from it. 
$page_num = substr($page_file 
    , strrpos($page_file, "_") + 1 
    , strpos($page_file, ".php") - strrpos($page_file, "_") - 1 
); 
$partial_path = substr($page_file, 0, strrpos($page_file, "_")); 
//Build array of pagenumbers. Here are ten pages. 
$all_pages = array (1,2,3,4,5,6,7,8,9,10); 

foreach ($all_pages as $all_page) 
{ 
//Create link to all the previus pages and put in prev-image. 
    if ($all_page < $page_num) 
        { 
        print "<a href=\"$partial_path"."_". $all_page . ".php\">[img]\"images/prev.gif\"[/img]</a>"; 
        } 
//Create I-am-here-image. 
    elseif ($all_page == $page_num) 
        { 
        print "[img]\"images/here.gif\"[/img]"; 
        } 
//Create links to all the next pages and put in next-image. 
    else 
        { 
        print "<a href=\"$partial_path"."_" . $all_page . ".php\">[img]\"images/next.gif\"[/img]</a>"; 
        } 
} 
?> 

</body>
</html>

  • dawofl
  • Registratie: Februari 2002
  • Laatst online: 17-01 18:48
ok, en hoe zorg ik ervoor dat het wel gaat werken :x

I wanted to change the world but god wouldnt give me the source code


  • SinergyX
  • Registratie: November 2001
  • Laatst online: 01:50

SinergyX

____(>^^(>0o)>____

mysql gebruik is lijkt mij vanuit php, plain html kan niet echt php commando's uitvoeren

Nog 1 keertje.. het is SinergyX, niet SynergyX
Im as excited to be here as a 42 gnome warlock who rolled on a green pair of cloth boots but was given a epic staff of uber awsome noob pwning by accident.


  • cybermans
  • Registratie: Maart 2001
  • Laatst online: 20-08 08:46
waarom is het erg dat de files .php heten. Ik zou gewoon de files waar php in voorkomt .php noemen (of eigenlijk allemaal zodat je niet hoeft na te denken in urls)

Strava | Runkeeper | Endomondo (mijn leikr uploads)


  • dawofl
  • Registratie: Februari 2002
  • Laatst online: 17-01 18:48
hehe dat was de grap van het hele verhaal, project van school die vonden het leuk dit als opdracht erin te zetten :P kortom die site heb ik zo gekregen en moet ik aan de praat krijgen. en trouwens NoobX had gelijk ;)

I wanted to change the world but god wouldnt give me the source code


  • dawofl
  • Registratie: Februari 2002
  • Laatst online: 17-01 18:48
arffffffffffffffff ik moest apache restarten :D

8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7 8)7

Had al aantal dingen van google gezocht en geprobeerd \0/ moest dus gewoon apache opnieuw starten

naja

iig bedankt voor de reactie's

I wanted to change the world but god wouldnt give me the source code


Verwijderd

p.s. niet zozeer de code maar eerder het

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
en

</body>
</html> gedeelte

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Sja, dit is in de eerste de beste installatie/configuratie manual/tutorial van php en apache wel terug te vinden, ook die apache restart ;)

overigens, AoA2002:
encoding=\"iso-8859-1\"?".">"; ?>
da's niet nodig, hoor :) In PHP is een string gewoon een string, hoe vaak je er ook ?> of <? of <?php in zet :)

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz

Pagina: 1

Dit topic is gesloten.