toopie Posted November 8, 2006 Share Posted November 8, 2006 I've been trying to make something handy for myself, but nothing shows on the page. I have no idea what is wrong with the code. Here it is:<?php$codeurl = $_GET["code"]; function getinfo($text){ $text = explode("^",$text); $pic = $text[0]; $name = $text[1]; $info = $text[2]; $www = $text[3]; $form = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'><title>test</title><link href='library/general.css' type='text/css' rel='stylesheet'></head><body><table width="367" border="0" cellpadding="0" cellspacing="0"><tr><td><h1>".$name."</h1><p><img src='images/artisten/".$pic." hspace='7' align='left'>".$info."</p></td></tr><tr><td height="25" align='right'><a href='http://".$www." target='_blank'>".$www."</a></td></tr></table></body></html>"; return $form; } switch ($codeurl){ case "G01": include "text.php"; echo getinfo($G01); break; } ?> Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/ Share on other sites More sharing options...
AbydosGater Posted November 8, 2006 Share Posted November 8, 2006 If the code is displaying NOTHING, and you check the source code, and it is just the basic html code,Its porbs that you have error reporting set to off on your server,Check your php error log, it should have an error in it!or set errorreporting to E_ALLAbydos Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/#findComment-121534 Share on other sites More sharing options...
toopie Posted November 8, 2006 Author Share Posted November 8, 2006 Thank you for your reply. Somehow it still doesn't show anything and there are no errors. The rest of the php files in the same folder are working fine. It's just this one that doesn't work. Anyway, this result supposes to show in the iframe. Does it have anything to do with this problem? Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/#findComment-121566 Share on other sites More sharing options...
trq Posted November 8, 2006 Share Posted November 8, 2006 You code makes little sense. You have a switch with only one option.. why? Your passing $G01 to the function getinfo, but where is $G01 defined? Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/#findComment-121570 Share on other sites More sharing options...
toopie Posted November 8, 2006 Author Share Posted November 8, 2006 In the 'switch' thingie, I have more than one option (of course). It's just a short version(otherwise I have to copy all the cases which is a lot! and all the cases are just the same except the name of the variable) to get the idea how the code works. '$G01' is a variable from 'text.php'. I don't know if I'm being clear enough and I'm trying to fix it now too and my time is running out. Thank you for your reply again. Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/#findComment-121585 Share on other sites More sharing options...
Psycho Posted November 8, 2006 Share Posted November 8, 2006 As thorpe stated there are problems with your code.1st) It would ONLY run the function if you passed "code=G01" on the query string.2nd) Even if you passed that value on the query string, when the function gets called it would send a null value to the function since you never set it's value3rd) There are problems in the HTML code that you assign to $form. For example in your image tag you include a single quote at the beginning of the src value, but then at the end (where you assign the $pic variable) you don't include a closing quote mark. Some thing for the web address. Plus you also include double quotes around the table properties, but since the string is inside double quotes the first one will end the string. Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/#findComment-121586 Share on other sites More sharing options...
toopie Posted November 8, 2006 Author Share Posted November 8, 2006 Thanks a lot!!! You are my hero!!, the problem is in the HTML code. Stupid me! Never try to make 3 websites in the same time! Link to comment https://forums.phpfreaks.com/topic/26572-help-nothing-on-the-page/#findComment-121601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.