Jump to content

HELP! Nothing on the page!


toopie

Recommended Posts

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

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_ALL

Abydos
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?
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.
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 value

3rd) 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.