CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2009
    Posts
    3

    Question Generator (blank page error)

    I've been working on this web page generator for a while that my friend would like to have on their page, but when I test on their ftp server I get a blank page. Can someone please help me and tell me what I am doing wrong? Any help is appreciated.

    Code:
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Web Page Generator</title>
    <script type="text/javascript">
    	function formReset()
    {
    document.getElementById("webPageGeneratorForm").reset()
    }
    </script>
    </head>
    <body bgcolor="purple">
    
    <center><h1>Web Page Generator</h1></center>
    
    
    <form action="webPageGenerator.php" method="POST" id="webPageGeneratorForm"> 
    
    <center><p><b>Directions:<br/>In order to design your own web page, please fill out and/or choose the apperance of your  web page</b></p></center>
    
    <center><b>Enter your page title:</b><br/> <input type="text" name="pageTitle" /><br /><br /></center>
    
    <center><br><b>Enter your page heading:</b><br/><input type="text" name="pageHeading" /><br /><br /></center>
    
    
    <center><b> Choose your background color:<b><br/> 
    <input type = "radio"
           name = "pageBackground"
           value = "pink" 
           checked = "checked" /><font color="pink">Pink</font><br />
    <input type = "radio"
           name = "pageBackground"
           value = "teal" /><font color="teal">Teal</font><br />
    <input type = "radio"
           name = "pageBackground"
           value = "blue" /><font color="blue">Blue</font><br />
    <input type = "radio"
           name = "pageBackground"
           value = "lime" /><font color="lime">Lime</font></a> <br/>
    <br/></center>
    
    <center><b> Choose your text color:<b><br/> 
    <input type = "radio"
           name = "textColor"
           value = "black" 
           checked = "checked" />Black<br />
    <input type = "radio"
           name = "textColor"
           value = "maroon" /><font color="maroon">Maroon</font><br />
    <input type = "radio"
           name = "textColor"
           value = "red" /><font color="red">Red</font><br />
    <input type = "radio"
           name = "textColor"
           value = "yellow" /><font color="yellow">Yellow</font></a> <br/>
    <br/>
    </center>
    
    
    <center>
    <b>Pick your font:</b></br>
    <select name = "pageFont">
      <option value = "arial">Arial</option>
      <option value = "helvetica">Helvetica</option>
      <option value = "times">Times</option>
      <option value = "serif">Serif</option>
      <option value = "verdana">Verdana</option>
    </select>
    </center><br/><br/>
    
    <div id="urls">
    <center><b>Enter up to 7 links:</b><br/>
    <b>Link 1:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    <b>Link 2:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    <b>Link 3:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    <b>Link 4:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    <b>Link 5:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    <b>Link 6:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    <b>Link 7:</b><input type="text" name="url[]" /><br /><br/> 
    <b>Label:</b><input type="text" name="label[]" /><br /><br/>
    </center></div>
    
    <p><center><b>Below you may fill out three (3) paragraphs with the desired content.</b></p></center>
    
    
    <center><b>Paragraph 1<b><br/><br/><br/><br/><textarea name="pageText[]" cols="40" rows="5"></textarea></center><br /><br /><br/>
    
    <center><b>Paragraph 2<b><br/><br/><br/><br/><textarea name="pageText[]" cols="40" rows="5"></textarea></center><br /><br /><br/>
    
    
    <center><b>Paragraph 3<b><br/><br/><br/><br/><textarea name="pageText[]" cols="40" rows="5"></textarea></center><br /><br /><br/>
    <center><input type="submit" name="submit" value="Make My Page"><input type="button" onclick="formReset()" value="Clear"></center>
    </form> 
    </body>
    </html>

    Code:
    <!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">
    
    <?php 
    $pageTitle = $_POST["pageTitle"]; 
    $pageBackground = $_POST["pageBackground"];
    $textColor = $_POST["textColor"];
    $pageHeading = $_POST["heading"];
    $pageFont = $_POST["pageFont"];
    
    
    
    $url = $_POST["url"];
     
    for ($u=0; $u <7; $u++) {
    if ($url[$u] != "" && $label[$u] != ""){
    {
    $urls = true;
    }
    print <<< link
    
    $label = $_POST["label"];
    $pageText = $_POST["pageText"];
    
    
    ?> 
    
    
    <html> 
    <head> 
    <title><?php echo $pageTitle; 
    ?>
    </title> 
    </head> 
    
    <body style="font-family: $pageFont; color: $textColor; background-color: $pageBackground">	
    
    
    text="<?php echo $textColor; ?>">
    <h1><?php echo $pageHeading; ?></h1>
    
    <?php echo $pageText; ?>
    
    
    </body> 
    </html>

  2. #2
    Join Date
    May 2009
    Posts
    3

    Re: Generator (blank page error)

    Sorry, I forget to mention, I am using php

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: Generator (blank page error)

    Blank pages usually mean that their is a PHP error. Did you try checking your PHP log first?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    Join Date
    May 2009
    Posts
    3

    Re: Generator (blank page error)

    No, I didnt try checking my php log first. How do I check it? I've been using notepad to do my php pages.

  5. #5
    Join Date
    May 2002
    Posts
    10,943

    Re: Generator (blank page error)

    Look for your error log within the PHP folder. That could depend on how you did your setup.

    Also, I would suggest using a PHP IDE instead of just notepad. That will give you syntax coloring so that you can better see your code.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    106

    Re: Generator (blank page error)

    Quote Originally Posted by PeejAvery View Post
    Also, I would suggest using a PHP IDE instead of just notepad.
    I would recommend this one http://www.zend.com/en/community/pdt

    Eclipse with php plugin, and free also (you will need java to run it)

  7. #7
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: Generator (blank page error)

    EasyEclipse for PHP (free, fast and powerfull): http://www.easyeclipse.org/site/dist...ons/index.html
    NetBeans for PHP (free, best community support, a bit slow): http://www.netbeans.org/downloads/index.html
    DreamWeaver CS4 (commercial software, best for html and css): http://www.adobe.com/products/dreamweaver/
    Last edited by Xeel; May 7th, 2009 at 07:27 PM.
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured