[PHP] functies probleem

Pagina: 1
Acties:

  • 4Real
  • Registratie: Juni 2001
  • Laatst online: 14-09-2024
ik heb dus een functions.php die in de header staat waar allemaal functies voor forum in staan, en ik wou dit er ook in zetten

code:
1
2
3
4
5
6
<script>
function go(form) 
{
location=form.selectmenu.value
}
</script>


stond eerst bij forum in maar wil omzetten ik dacht gewoon
code:
1
2
3
4
function go(form) 
{
location=form.selectmenu.value
}

dat stuk over te zetten maar dan geeft die deze error

Parse error: parse error, unexpected T_STRING, expecting ')' in /data/www/www.qwebcams.nl/htdocs/personal/4real/tijdelijk/forum/include/functions.php on line 52

wat doe ik nou fout :? ik weet niet waar ) moet

Verwijderd

Heb je de <SCRIPT> weggehaald? Dat kan nl. niet...het is een javascript functie en niet php..dus het moet ook buiten de php tags staan. Hoop dat dit je helpt...

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

OMFG
wat probeer je nou?
een js functie integraal over te nemen in php?
dan moet je serieus gaan beginnen met hello world ofzow

Doet iets met Cloud (MS/IBM)


Verwijderd

da's javascript en het staat hoop ik niet tussen <? ?> anders is die parse error wel erg logisch

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

drm

f0pc0dert

D2k:
dan moet je serieus gaan beginnen met hello world ofzow
PHP:
1
2
3
4
5
<?
function helloworld () {
   document.write ( 'Hello World!' );
}
?>

:'( doet nie...


:+

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


  • Altaphista
  • Registratie: Juli 2001
  • Laatst online: 01-09 09:22

Altaphista

1. check manual, 2. ask

:? tja... (LOL)
echo/print ...
een zin: http://www.php.net/en/manual !!!!

Je gaat het pas zien als je het doorhebt.


  • SWINX
  • Registratie: Juni 2001
  • Laatst online: 02-06 23:18
<?
$bla = "hello world"; // bla kan natuurlijk ook een getvar ofzo zijn...
?>
<script language="javascript">
document.write("<?=$bla?>");
</script>

Mannen komen van Mars Tweakers, vrouwen van Venus Bokt

Pagina: 1