Simple Form Code, Just Can't Find It! Help?

Discussion in 'HTML & Website Design' started by GH Fever, Dec 15, 2008.

  1. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Okay, so for 1001 I have -

        case 1001:header('Location: /edwardon/index.php');exit;break;
    Code (markup):
    In those header() files. I have it pointing to the /edwardon/ folder and index.php and I think I have it placed correctly.

    But I'm still getting that Cannot find [PHP_SELF] bit. *This is why I stay away from PHP, LOL!*

    Any ideas?
     
    GH Fever, Dec 16, 2008 IP
  2. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #22
    Oh by the way, thank you for being so patient with me. I'm new to PHP =X
     
    GH Fever, Dec 16, 2008 IP
  3. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #23
    Ok, are thoose really your Abs?
     
    SiteTalkZone, Dec 16, 2008 IP
  4. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #24
    Can you post all of your file that you have put that PHP into please?
     
    Yesideez, Dec 16, 2008 IP
  5. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #25
    This is the entire page -

    
    <?
    $msg='Please enter a code';
    $intNumber=intval($_POST['codenumber']);
    if ($_POST['subcode']) {
      switch ($intNumber) {
        case 1001:header('Location: /edwardon/index.php');exit;break;
        case 1002:header('Location: /marcosds/');exit;break;
        case 1003:header('Location: url3.php');exit;break;
        case 1004:header('Location: url4.php');exit;break;
        default:$msg='Code not recognised';
      }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
    
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
    <meta name="description" content="description"/>
    <meta name="keywords" content="keywords"/> 
    <meta name="author" content="author"/> 
    <link rel="stylesheet" type="text/css" href="default.css"/>
    <title>Wineberg, Lopez & Rodriguez Company</title>
    </head>
    
    <body>
    
    <div class="main">
    
    	<div class="main_left">
    		
    		<div class="header">
    		<h1><a href="index.html">Wineberg,<br>
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lopez<br>
    		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; & 
    
    Rodriguez Company</a></h1>
    		</div>
    
    		<div class="link_menu">
    			<a href="index.html" accesskey="1">Home</a>
    			<a href="form.html" accesskey="2">Forms</a>
    			<a href="process.html" accesskey="3">Process</a>
    			<a href="contact.html" accesskey="4">Contact</a>
    		</div>
    
    		<div class="content">
    			
    			<h1>Wineberg, Lopez & Rodriguez Company</h1>
    			<br>
    
    <?=$msg?><br /><br />
    <form action="array(<?=$_SERVER['PHP_SELF']?>)" method="post">
      Access Code: <input type="text" name="codenumber" value="<?=$intNumber?>" /><br />
      <input type="submit" name="subcode" value="Send" />
    </form>
    			
    
    		</div>
    
    	</div>
    
    	<div class="main_right">
    
    		<div class="link_project">
    
                    <img src="./img/sidebar.jpg"><br><br>
    		<br>
                    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CALL US TODAY TO GET YOUR LOAN 
    
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MODIFICATION PLAN STARTED</p><br>
    	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CALL US AT 
    		<br><big><big><big><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(407) 854-
    
    5222</b></big></big></big><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bu
    
    siness Hours: 9:00 AM - 9:00 PM (EST)
    
    		<br><br>
    
    		<div class="link_menu">
    			<a href="http://pleaselowermypayment.org/lists/?p=subscribe" 
    
    accesskey="1">Subscribe to our E-Mail List!</a>
    		</div>
    
    		<br><br>
    
    		<a href="http://pleaselowermypayment.org/hcl/module.php?
    
    module=HelpCenter"><img src="http://pleaselowermypayment.org/rep.jpg" border="0"></a>
    
    		<br><br>
    		
    		<a href="http://pleaselowermypayment.org/clientarea.html"><img 
    
    src="./img/call.gif" border="0"></a>
    <BR><BR>
    		</div>
    
    	</div>
    
    	<div class="footer">
    
    		<div class="left"> <a href="index.html">Weinberg, Lopez & 
    
    Rodriguez&copy</a> | Developed by <a href="http://designs-by-dm.com/">Designs by DM 
    
    2008&copy</a>
    
    		
    
    	</div>
    
    </div>
    
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : 
    
    "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' 
    
    type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-6613077-1");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    
    </body>
    
    </html>
    
    Code (markup):
    And yes SiteTalk, my abs indeed :D:D
     
    GH Fever, Dec 16, 2008 IP
  6. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #26
    First, use <?php and not <? as not all servers have the latter enabled - just a precaution and could stop you coming back later if you move your site to a different server.

    Next change this back:
    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
    PHP:
    Try that and see how it goes.
     
    Yesideez, Dec 16, 2008 IP
  7. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #27
    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
    Access Code: <input type="text" name="codenumber" value="<?=$intNumber?>" /><br />
    <input type="submit" name="subcode" value="Send" />
    </form>
     
    SiteTalkZone, Dec 16, 2008 IP
  8. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #28
    Oh, in the "/edwardon/" folder - is it index.php in there? If you've got index.html in there use that instead.
     
    Yesideez, Dec 16, 2008 IP
  9. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #29
    Yes it is I looked before.
     
    SiteTalkZone, Dec 16, 2008 IP
  10. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #30
    lol I meant on the server - my bad :D
     
    Yesideez, Dec 16, 2008 IP
  11. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #31
    Why use both ;exit;break; and break out of curiosity, I don't follow that?
     
    SiteTalkZone, Dec 16, 2008 IP
  12. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #32
    Okay, I've made it <?php now and changed that one line - when I enter 1001 and hit send it still brings me to this page: http://pleaselowermypayment.org/%3C?=$_SERVER[%27PHP_SELF%27]?%3E


    Here is my updated code reflecting the changes -

    <?php
    $msg='Please enter a code';
    $intNumber=intval($_POST['codenumber']);
    if ($_POST['subcode']) {
      switch ($intNumber) {
        case 1001:header('Location: /edwardon/index.php');exit;break;
        case 1002:header('Location: /marcosds/');exit;break;
        case 1003:header('Location: url3.php');exit;break;
        case 1004:header('Location: url4.php');exit;break;
        default:$msg='Code not recognised';
      }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
    
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
    <meta name="description" content="description"/>
    <meta name="keywords" content="keywords"/> 
    <meta name="author" content="author"/> 
    <link rel="stylesheet" type="text/css" href="default.css"/>
    <title>Wineberg, Lopez & Rodriguez Company</title>
    </head>
    
    <body>
    
    <div class="main">
    
    	<div class="main_left">
    		
    		<div class="header">
    		<h1><a href="index.html">Wineberg,<br>
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lopez<br>
    		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; & 
    
    Rodriguez Company</a></h1>
    		</div>
    
    		<div class="link_menu">
    			<a href="index.html" accesskey="1">Home</a>
    			<a href="form.html" accesskey="2">Forms</a>
    			<a href="process.html" accesskey="3">Process</a>
    			<a href="contact.html" accesskey="4">Contact</a>
    		</div>
    
    		<div class="content">
    			
    			<h1>Wineberg, Lopez & Rodriguez Company</h1>
    			<br>
    
    <?=$msg?><br /><br />
    <form action="<?=$_SERVER['PHP_SELF']?>" method="post">
      Access Code: <input type="text" name="codenumber" value="<?=$intNumber?>" /><br />
      <input type="submit" name="subcode" value="Send" />
    </form>
    			
    
    		</div>
    
    	</div>
    
    	<div class="main_right">
    
    		<div class="link_project">
    
                    <img src="./img/sidebar.jpg"><br><br>
    		<br>
                    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CALL US TODAY TO GET YOUR LOAN 
    
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MODIFICATION PLAN STARTED</p><br>
    	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CALL US AT 
    		<br><big><big><big><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(407) 854-
    
    5222</b></big></big></big><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bu
    
    siness Hours: 9:00 AM - 9:00 PM (EST)
    
    		<br><br>
    
    		<div class="link_menu">
    			<a href="http://pleaselowermypayment.org/lists/?p=subscribe" 
    
    accesskey="1">Subscribe to our E-Mail List!</a>
    		</div>
    
    		<br><br>
    
    		<a href="http://pleaselowermypayment.org/hcl/module.php?
    
    module=HelpCenter"><img src="http://pleaselowermypayment.org/rep.jpg" border="0"></a>
    
    		<br><br>
    		
    		<a href="http://pleaselowermypayment.org/clientarea.html"><img 
    
    src="./img/call.gif" border="0"></a>
    <BR><BR>
    		</div>
    
    	</div>
    
    	<div class="footer">
    
    		<div class="left"> <a href="index.html">Weinberg, Lopez & 
    
    Rodriguez&copy</a> | Developed by <a href="http://designs-by-dm.com/">Designs by DM 
    
    2008&copy</a>
    
    		
    
    	</div>
    
    </div>
    
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : 
    
    "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' 
    
    type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-6613077-1");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    
    </body>
    
    </html>
    Code (markup):
     
    GH Fever, Dec 16, 2008 IP
  13. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #33
    SiteTalkZone, Dec 16, 2008 IP
  14. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #34
    I'm not sure? That's what the guy on the first page said, should I take one out?

    Yep, index.php is on the server. The link is http://pleaselowermypayment.org/edwardon/index.php


    I'm smashing my head through a wall guys, thanks so much for helping me with this.
     
    GH Fever, Dec 16, 2008 IP
  15. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #35
    Is PHP actually enabled? Change <?=$_SERVER['PHP_SELF']?> to the name of the file you've pasted that code from (index.php) or whatever and see what happens.
     
    SiteTalkZone, Dec 16, 2008 IP
  16. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #36
    No the question was aimed at "the guy". I'm sure he has a good reason for it.
     
    SiteTalkZone, Dec 16, 2008 IP
  17. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #37
    You lost me, LOL. Change the SERVER code to index.php your saying?
     
    GH Fever, Dec 16, 2008 IP
  18. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #38
    exit should always follow a redirection header - I've read somewhere about code continuing execution sometimes when a redirect fails or at least I think that's why.

    GH Fever, can you make this file on your server please and try it?
    <?php
      phpinfo();
    ?>
    PHP:
    Upload that as a file on its own and call it from the browser unless you're definitely certain PHP is actually enabled and you can use it - not all web space does.

    What you can do is change the line to this:
    <form action="index.php" method="post">
    Code (markup):
     
    Yesideez, Dec 16, 2008 IP
  19. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #39
    Yup - we're saying the same ;)

    btw, that phpinfo(); bit should give you a LOT of text :)
     
    Yesideez, Dec 16, 2008 IP
  20. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #40
    Ah OK, never heard of that.
     
    SiteTalkZone, Dec 16, 2008 IP