dendjos Posted January 20, 2009 Share Posted January 20, 2009 Hi, I have a problem. My hosting has updated from php4 to php5 and I have a function that refuses to work. I'm not an expert in php and it's very important to have this up and running again. Can anybody help me? This is the current php: <?php $sql3=mysql_query("SELECT * from kalender where Datum>'2008-06-06' order by Datum desc"); if (!$sql3) { echo("Er deed zich een probleem voor, contacteer de webmaster"); exit; } else { while ($row=mysql_fetch_array($sql3)) { $datum=$row["Datum"]; $huidige=date("Y-m-d"); $Jaar = substr($datum, 0, 4); $Maand = substr($datum, 5, 2); $Dag = substr($datum, 8, 2); $datum="$Dag-$Maand-$Jaar"; $titel=$row["Naam"]; $titel=strtoupper($titel); $id=$row["IDkalender"]; $locatie=$row["Locatie"]; $start=$row["Startuur"]; printf("<tr valign='top'>"); printf("<td><span class='style1'>$datum</span></td>"); printf("<td><div align='left'><span class='style1'>$start</span></div></td>"); printf("<td><span class='style1'>$titel</span></td>"); printf("<td><span class='style1'>$locatie</span></td>"); echo("<td><font color='#0099FF' size='1' face='Arial, Helvetica, sans-serif'><a href='kalender.php?IDkalender=$id' onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('LinkTeksten14421','','images/gifs/kleinpijltjeb.gif',1)\"><img src='images/gifs/kleinpijltje.gif' name='LinkTeksten14421' border='0' align='absmiddle'/></a> Meer info </font></td>"); printf("</tr>"); }} ?> Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/ Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 There is nothing in that code that is specific to php5. Are you getting any errors? I don't see any db connection being made. Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741029 Share on other sites More sharing options...
RichardRotterdam Posted January 20, 2009 Share Posted January 20, 2009 My hosting has updated from php4 to php5 and I have a function that refuses to work ahhh dutch. What function is it that doesnt work? and what are the errors? Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741031 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 well, it's a calendar function that does not generate an individual page for each activity anymore. http://www.lvsvleuven.be/kalender.php If you click on "Meer info" you should get a page with more info for this event from our database... The problem started the same moment as the update from php4 to php5... So I think there must be something wrong there... Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741033 Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 We need to see the relevent code, a link doesn't help us. Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741034 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 <?php include("../admin.lvsvleuven.be/inc/databasefuncties.php"); connectie(); database_databaseconnect(); if (isset($Submit)) { if ($mailnieuwsbrief!="") { if (!check_email($mailnieuwsbrief)) { $test_nieuwsbrief="foutmailadres"; } else{ $email = "[email protected]"; $subject = ""; $gezonden=mail($email, $subject, $mailnieuwsbrief, "From: $mailnieuwsbrief"); if (!$gezonden) $test_nieuwsbrief="nee"; else $test_nieuwsbrief="ok"; } }} $sql2=mysql_query("SELECT * from kalender order by Datum"); if (!$sql2) { echo("Er deed zich een probleem voor, contacteer de webmaster"); exit; } else { while (($row=mysql_fetch_array($sql2))&& ($stop!="ja")) { $datum=$row["Datum"]; $huidige=date("Y-m-d"); $Jaar = substr($datum, 0, 4); $Maand = substr($datum, 5, 2); $Dag = substr($datum, 8, 2); if ($huidige<=$datum) { $datumvolgende="$Dag-$Maand"; $titelvolgende=$row["Naam"]; $titelvolgende=strtoupper($titelvolgende); $idvolgende=$row["IDkalender"]; $stop="ja"; } else { $datumvorige="$Dag-$Maand"; $titelvorige=$row["Naam"]; $titelvorige=strtoupper($titelvorige); $idvorige=$row["IDkalender"]; } }} ?> <!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" style="height: 100%;"> <head> <title>LVSV LEUVEN - Liberaal Vlaams Studentenverbond</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <STYLE TYPE="text/css"> <!-- A:link {text-decoration: none; color: #FFFFFF} A:visited {text-decoration: none; color: #FFFFFF} A:hover {text-decoration:none; color: #003366} a.linkinpagina:link{color: #0066FF; text-decoration: none;} a.linkinpagina:visited{color: #0066FF; text-decoration: none;} a.linkinpagina:hover{color: #FFFFFF; text-decoration: none;} input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; border: thin #1182D2 solid} select { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; border: thin #1182D2 solid} BODY { scrollbar-base-color: #1182D2; scrollbar-arrow-color: #0E257D; scrollbar-DarkShadow-Color: #1182D2; } .style1 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; } .style7 {color: #1182D2} .style9 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #1182D2; font-weight: bold; } .style16 {font-size: 12px; color: #1182D2; font-weight: bold; } --> </STYLE> <script language="JavaScript"> <!-- var rub1="wie"; var rub2="bestuur"; var rub3="activiteiten"; var rub4="archief"; var rub5="oudledenbond"; var rub6="sympathisanten"; var rub7="info"; var rub8="publicaties"; var rub0="leeg"; function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body bgcolor="0E257D" link="#FFFFFF" vlink="#FFFFFF" alink="#003366" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="MM_preloadImages('images/gifs/kleinpijltjeb.gif')"> <table width="770" height="0" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="images/header.jpg" width="770" height="147"></td> </tr> <tr> <td bgcolor="1182D2"><table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td> <?php include("inc/bovenrubrieken.php"); ?></td> </tr> </table></td> </tr> <tr> <td height="0" bgcolor="2CA5FF"> <table width="100%" border="0" cellspacing="0" cellpadding="0" valign="top"> <tr> <td valign="top"><font color="#3399FF" size="1" face="Verdana, Arial, Helvetica, sans-serif">.</font> <font color="#cccccc" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> <a id="myDiv1" href=" "></a><a id="myDiv2" href=" "></a><a id="myDiv3" href=" "></a><a id="myDiv4" href=" "></a><a id="myDiv5" href=" "></a> <script language="JavaScript1.2"> function ondertitels(input) { if (input=='wie') { document.getElementById('myDiv1').innerText="LVSV | " document.getElementById('myDiv1').href="lvsv.php" document.getElementById('myDiv2').innerText="Liberalisme | " document.getElementById('myDiv2').href="liberalisme.php" document.getElementById('myDiv3').innerText="Boeken over vrijheid | " document.getElementById('myDiv3').href="boekenvrijheid.php" document.getElementById('myDiv4').innerText="Hoog banier | " document.getElementById('myDiv4').href="hoogbanier.php" document.getElementById('myDiv5').innerText="Gij enkeling triomfant" document.getElementById('myDiv5').href="triomfant.php"} else if (input=="bestuur") {document.getElementById('myDiv1').innerText="Wie? | " document.getElementById('myDiv1').href="wie.php" document.getElementById('myDiv2').innerText="Contact | " document.getElementById('myDiv2').href="contact.php" document.getElementById('myDiv3').innerText="Lid worden" document.getElementById('myDiv3').href="lidworden.php" document.getElementById('myDiv4').innerText=" " document.getElementById('myDiv4').href="" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} else if (input=="activiteiten") {document.getElementById('myDiv1').innerText="Kalender | " document.getElementById('myDiv1').href="kalender.php" document.getElementById('myDiv2').innerText="Politieke activiteiten | " document.getElementById('myDiv2').href="polact.php" document.getElementById('myDiv3').innerText="Studentikoze activiteiten | " document.getElementById('myDiv3').href="student.php" document.getElementById('myDiv4').innerText="Foto's" document.getElementById('myDiv4').href="fotos.php" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} else if (input=="archief") {document.getElementById('myDiv1').innerText="Kalender | " document.getElementById('myDiv1').href="archiefkalender.php" document.getElementById('myDiv2').innerText="Foto's" document.getElementById('myDiv2').href="archieffotos.php" document.getElementById('myDiv3').innerText=" " document.getElementById('myDiv3').href="" document.getElementById('myDiv4').innerText=" " document.getElementById('myDiv4').href="" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} else if (input=="oudledenbond") {document.getElementById('myDiv1').innerText="Algemeen | " document.getElementById('myDiv1').href="olbalgemeen.php" document.getElementById('myDiv2').innerText="Activiteiten | " document.getElementById('myDiv2').href="olbactiviteiten.php" document.getElementById('myDiv3').innerText="Voorzitters | " document.getElementById('myDiv3').href="olbvoorzitters.php" document.getElementById('myDiv4').innerText="Foto's" document.getElementById('myDiv4').href="olbfotos.php" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} else if (input=="sympathisanten") {document.getElementById('myDiv1').innerText="Ereleden | " document.getElementById('myDiv1').href="ereleden.php" document.getElementById('myDiv2').innerText="Sponsors" document.getElementById('myDiv2').href="sponsors.php" document.getElementById('myDiv3').innerText=" " document.getElementById('myDiv3').href="" document.getElementById('myDiv4').innerText=" " document.getElementById('myDiv4').href=""} else if (input=="info") {document.getElementById('myDiv1').innerText="Lid worden | " document.getElementById('myDiv1').href="lidworden.php" document.getElementById('myDiv2').innerText="Erelid worden | " document.getElementById('myDiv2').href="erelid.php" document.getElementById('myDiv3').innerText="Inschrijving nieuwsbrief" document.getElementById('myDiv3').href="nieuwsbrief.php" document.getElementById('myDiv4').innerText=" " document.getElementById('myDiv4').href="" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} else if (input=="publicaties") {document.getElementById('myDiv1').innerText="Teksten | " document.getElementById('myDiv1').href="teksten.php" document.getElementById('myDiv2').innerText="Persberichten | " document.getElementById('myDiv2').href="persberichten.php" document.getElementById('myDiv3').innerText="Blauwdruk" document.getElementById('myDiv3').href="blauwdruk.php" document.getElementById('myDiv4').innerText=" " document.getElementById('myDiv4').href="" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} else {document.getElementById('myDiv1').innerText=" " document.getElementById('myDiv1').href="" document.getElementById('myDiv2').innerText=" " document.getElementById('myDiv2').href=" " document.getElementById('myDiv3').innerText=" " document.getElementById('myDiv3').href=" " document.getElementById('myDiv4').innerText=" " document.getElementById('myDiv4').href="" document.getElementById('myDiv5').innerText=" " document.getElementById('myDiv5').href=""} } </script></b> </font> </td> </tr> </table> </td> </tr> <tr> <td height="0" valign="top"><br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" scope="col"><div align="left"> <table width="605" height="0" border="0" cellpadding="0" cellspacing="0" valign="top"> <tr> <td valign="bottom"><p> <img src="images/tabellen/balkhoekjesboven_groot.gif" width="605" height="11" /></p></td> </tr> <tr> <td height="0" valign="top" bgcolor="142F97"><table width="100%" height="0" border="0" cellpadding="2" cellspacing="2"><tr><td valign="top"> <table width="100%" height="0" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="4%" rowspan="2"> <div align="center"><img src="images/gifs/notiebalklinks.gif" width="24" height="215" /></div></td> <td width="85%" height="0" valign="middle" bgcolor="1182D2"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong><font color="1182D2" size="1">.</font>KALENDER 2008-2009</strong></font></td> <td width="11%" valign="middle"><img src="images/tabellen/overgang2.gif" width="54" height="18" /></td> </tr> <tr> <td colspan="2" valign="top"> <?php if (isset($IDkalender)) { $sql4=mysql_query("SELECT * from kalender where IDkalender=$IDkalender"); if (!$sql4) { echo("Er deed zich een probleem voor, contacteer de webmaster"); exit; } else { while ($row=mysql_fetch_array($sql4)) { $indatum=$row["Datum"]; $inJaar = substr($indatum, 0, 4); $inMaand = substr($indatum, 5, 2); $inDag = substr($indatum, 8, 2); $indatum="$inDag-$inMaand-$inJaar"; $intitel=$row["Naam"]; $intitel=strtoupper($intitel); $inid=$row["IDkalender"]; $inlocatie=$row["Locatie"]; $instart=$row["Startuur"]; $infoto=$row["Foto"]; $inbeschrijving=$row["Beschrijving"]; $insprekers=$row["Sprekers"]; $ininkom=$row["Inkom"]; echo("<br><p align=\"left\" class=\"style1\"><span class=\"style16\">$intitel met $insprekers</span></p>"); echo("<table width='100%' border='0' cellspacing='2' cellpadding='2'>"); echo("<tr valign='top'>"); echo("<td width='16%' scope='col'><span class='style1'>"); if ($infoto!="") printf("<img src='$infoto'/></span></td>"); echo("<td width='84%' scope='col'><p class='style1'>$inbeschrijving</p>"); echo("<p class='style1'>"); if ($row["Dossier"] != '') echo "<span class='style7'>Dossier: </span><a href=http://www.lvsvleuven.be/dossiers/".$row["Dossier"]." target=_blank>".$row["Dossier"]."</a><br>"; echo("<span class='style7'>Inkom:</span> $ininkom "); if (($ininkom!='0') && ($ininkom!='')) { echo("euro</font>");} else echo("gratis"); echo(" <span class='style7'>| Locatie: </span>$inlocatie<span class='style7'> | Startuur: </span>$instart<span class='style7'> | Datum: </span>$indatum"); echo("</p></td></tr></table>"); echo("<hr size='1' noshade='noshade' color='#1182D2' />"); }} } else { ?><p class="style1"><br /> Hieronder het overzicht van onze activiteiten tijdens het academiejaar 2008-2009.</p> <?php } ?><table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="13%" scope="col"><span class="style9">DATUM</span></td> <td width="8%" scope="col"><div align="left"><span class="style9">UUR</span></div></td> <td width="40%" scope="col"><span class="style9">ACTIVITEIT</span></td> <td width="28%" scope="col"><span class="style9">LOCATIE</span></td> <td width="11%" scope="col"><span class="style7"></span></td> </tr> <?php $sql3=mysql_query("SELECT * from kalender where Datum>'2008-06-06' order by Datum desc"); if (!$sql3) { echo("Er deed zich een probleem voor, contacteer de webmaster"); exit; } else { while ($row=mysql_fetch_array($sql3)) { $datum=$row["Datum"]; $huidige=date("Y-m-d"); $Jaar = substr($datum, 0, 4); $Maand = substr($datum, 5, 2); $Dag = substr($datum, 8, 2); $datum="$Dag-$Maand-$Jaar"; $titel=$row["Naam"]; $titel=strtoupper($titel); $id=$row["IDkalender"]; $locatie=$row["Locatie"]; $start=$row["Startuur"]; printf("<tr valign='top'>"); printf("<td><span class='style1'>$datum</span></td>"); printf("<td><div align='left'><span class='style1'>$start</span></div></td>"); printf("<td><span class='style1'>$titel</span></td>"); printf("<td><span class='style1'>$locatie</span></td>"); echo("<td><font color='#0099FF' size='1' face='Arial, Helvetica, sans-serif'><a href='kalender.php?IDkalender=$id' onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('LinkTeksten14421','','images/gifs/kleinpijltjeb.gif',1)\"><img src='images/gifs/kleinpijltje.gif' name='LinkTeksten14421' border='0' align='absmiddle'/></a> Meer info </font></td>"); printf("</tr>"); }} ?> </table> <p> </p> <p> </p> <p> </p></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td valign="top"><img src="images/tabellen/balkhoekjesonderschaduw_groot.gif" width="605" height="20" /></td> </tr> </table> </div></td> <td width="160" valign="top" scope="col"><table width="100%" height="0" border="0" cellpadding="0" cellspacing="0" valign="top"> <tr> <td valign="bottom"><p> <img src="images/tabellen/balkhoekjesboven_klein.gif" width="160" height="11" /></p></td> </tr> <tr> <td height="0" valign="top" bgcolor="142F97"> <table width="100%" height="0" border="0" cellpadding="2" cellspacing="2"> <tr> <td valign="top"><p><img src="images/titels/volgendeevenement.gif" width="126" height="22" /><br /> <span class="style1"> <?php if ($datumvolgende!="") { printf("$datumvolgende: $titelvolgende</span><br />"); printf("<font color='#0099FF' size='1' face='Arial, Helvetica, sans-serif'>"); printf("<a href='kalender.php?IDkalender=$idvolgende' onmouseout='MM_swapImgRestore()' onmouseover=\"MM_swapImage('LinkTeksten1441','','images/gifs/kleinpijltjeb.gif',1)\"><img src=\"images/gifs/kleinpijltje.gif\" name=\"LinkTeksten1441\" width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" id=\"LinkTeksten1\" /></a> Meer info</font>"); } else { printf("Momenteel geen volgende evenement"); } ?></span><br /> <p><img src="images/titels/vorigeevenement.gif" width="126" height="22" /><br /> <span class="style1"> <?php if ($datumvorige!="") { printf("$datumvorige: $titelvorige</span><br />"); printf("<font color='#0099FF' size='1' face='Arial, Helvetica, sans-serif'>"); printf("<a href='kalender.php?IDkalender=$idvorige' onmouseout='MM_swapImgRestore()' onmouseover=\"MM_swapImage('LinkTeksten1441','','images/gifs/kleinpijltjeb.gif',1)\"><img src=\"images/gifs/kleinpijltje.gif\" name=\"LinkTeksten1441\" width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" id=\"LinkTeksten1\" /></a> Meer info</font>"); } else { printf("Momenteel geen vorige evenement"); } ?> </p> <p><font color="#0099FF" size="1" face="Arial, Helvetica, sans-serif"><img src="images/gifs/lijnkorthorizontaal.gif" width="146" height="7" /><br /> </font><img src="images/titels/lidworden.gif" width="126" height="22" /><br /> <span class="style1">Schrijf u nu in om lid te worden van onze vereniging. </span> </p> <p><font color="#0099FF" size="1" face="Arial, Helvetica, sans-serif"><a href="lidworden.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('LinkTeksten1442','','images/gifs/kleinpijltjeb.gif',1)"><img src="images/gifs/kleinpijltje.gif" name="LinkTeksten1442" width="10" height="10" border="0" align="absmiddle" id="LinkTeksten1" /></a> Inschrijvingsformulier</font></p> <p align="left"><font color="#0099FF" size="1" face="Arial, Helvetica, sans-serif"><img src="images/gifs/lijnkorthorizontaal.gif" width="146" height="7" /><br /> </font><img src="images/titels/nieuwsbrief.gif" width="126" height="22" /><br /> <span class="style1"><?php if (!isset($Submit)) { printf("Vul uw e-mail adres in en schrijf u in op onze nieuwsbrief!<br /> </span><form method='post'> <p> <input name='mailnieuwsbrief' type='text' id='mailnieuwsbrief' /> <input type='submit' name='Submit' value='Ok' /> </p> </form>"); } elseif ($test_nieuwsbrief=="nee") {printf("Registratie NIET geslaagd<br /> ");} elseif ($test_nieuwsbrief=="foutmailadres") {printf("FOUTIEF E-MAIL ADRES, probeer opnieuw<br /> </span><form method='post'> <p> <input name='mailnieuwsbrief' type='text' id='mailnieuwsbrief' /> <input type='submit' name='Submit' value='Ok' /> </p> </form>");} else {printf("U bent geregistreerd!<br /> ");} ?> </td> </tr> </table></td> </tr> <tr> <td valign="top"><img src="images/tabellen/balkhoekjesonderschaduw_klein.gif" width="160" height="20" /> </td> </tr> </table></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <table width="770" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="bottom"><img src="images/tabellen/balkhoekjesboven.gif" width="770" height="11"></td> </tr> <tr> <td height="0" valign="top" bgcolor="142F97"> <table width="100%" height="0" border="0" cellpadding="2" cellspacing="2"> <tr> <td valign="top"> <div align="center"><font color="#0099FF" size="1" face="Arial, Helvetica, sans-serif">© LVSV-LEUVEN 2004 | CREATIE DOOR EVERT GRUYAERT | CONTACT <a href="mailto:%[email protected]?subject=LVSV%20Website" class="linkinpagina">WEBMASTER</a> </font></div></td> </tr> </table></td> </tr> <tr> <td><img src="images/tabellen/balkhoekjesonderschaduw.gif" width="770" height="20"></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741035 Share on other sites More sharing options...
RichardRotterdam Posted January 20, 2009 Share Posted January 20, 2009 What is the error you recieve? can you turn on errors on the server? Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741039 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 Well, instead of generating a page for the event, it just reloads the calendar page... Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741041 Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 The problem appears to be that you have registrer globals enabled. A quick insecure fix is to simply add.... extract($_POST); at the top of your script. A better (more secure method) would be to find all these magically defined variables and reference them from the $_POST array. eg; $Submit becomes $_POST['Submit']. Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741042 Share on other sites More sharing options...
RichardRotterdam Posted January 20, 2009 Share Posted January 20, 2009 as trope said its registered globals. this is what i found you have the following code if (isset($IDkalender)) { $sql4=mysql_query("SELECT * from kalender where IDkalender=$IDkalender"); but you never asigned the value. a better fix would be to add the following $IDkalender=(int)$_GET['IDkalender']; Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741045 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 Thanks a lot 4 the help you all, I have been experimenting but I don't know where to change what. Could you please tell me what to replace where by what? Thanks! Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741101 Share on other sites More sharing options...
PFMaBiSmAd Posted January 20, 2009 Share Posted January 20, 2009 Every program variable $some_variable_name in your code must have a statement that assigns a value to it. Register_globals "magically" did this from POST/GET/COOKIE/SESSION data in a lazy-way attempt to make programming easier. Unfortunately, register_globals also "magically" allowed hackers to set session/program variables, so a lot of sites were taken over because a hacker could become logged in as an administrator to scripts where he knew or could guess what the variable names were that controlled the log in state. You can turn on full php error reporting and the variables that are no longer being "magically" populated will generate "undefined" error messages. However, to fix the code you will need to determine where each variable is coming from - POST/GET/COOKIE/SESSION. The functions session_register(), session_is_registered(), and session_unregister() also no longer work and any code using them needs to be fixed to use $_SESSION variables. The sad part of this is that register_globals were turned off in php4.2 in the year 2002 and no new code should have been written after that point in time that used register_globals and any code that existed at that time should have been updated long ago. Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741138 Share on other sites More sharing options...
redarrow Posted January 20, 2009 Share Posted January 20, 2009 well said wish everyone would read this. Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741146 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 I tried the function of PFMaBiSmAd in his signature... It says that the error is somewhere in here: while (($row=mysql_fetch_array($sql2))&& ($stop!="ja")) I'm really new to php, i just have to maintain a website with php-modules and I usually only have to fix a link or a picture... But this is a bit over my head... Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741157 Share on other sites More sharing options...
revraz Posted January 20, 2009 Share Posted January 20, 2009 In that line, you are grabbing the mysql rows from the database and putting them into the $row array, while also checking the $stop variable to make sure it does not equal to "ja". Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741160 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 In that line, you are grabbing the mysql rows from the database and putting them into the $row array, while also checking the $stop variable to make sure it does not equal to "ja". How do i fix that? Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741205 Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 In that line, you are grabbing the mysql rows from the database and putting them into the $row array, while also checking the $stop variable to make sure it does not equal to "ja". How do i fix that? If you seriously don't know what you are doing you might consider hiring someone. This script is pretty well riddled with errors and fixing one after the other by asking questions here is going to be a long slow process. Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741224 Share on other sites More sharing options...
dendjos Posted January 20, 2009 Author Share Posted January 20, 2009 Well, we are a student group, we really don't have a budget for hiring someone... Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741251 Share on other sites More sharing options...
revraz Posted January 20, 2009 Share Posted January 20, 2009 How is it broken? Without knowing your intentions, in syntax, there is nothing wrong with it. In that line, you are grabbing the mysql rows from the database and putting them into the $row array, while also checking the $stop variable to make sure it does not equal to "ja". How do i fix that? Link to comment https://forums.phpfreaks.com/topic/141570-php4-to-php5-but-what-is-php4-and-php5/#findComment-741374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.