Page 1 of 1

URGENT:! Echo don´t work as supposed

Posted: Tue Aug 17, 2010 5:03 pm
by Goofan
Code:

Code: Select all

<form action="Home.php?Action="<?php echo $Action; ?>." method="post" ENCTYPE="multipart/form-data">
This will show in the URL:
http://localhost/***/Home.php?Action=

Please help (What am i doing wrong?)

Re: URGENT:! Echo don´t work as supposed

Posted: Tue Aug 17, 2010 5:45 pm
by db579
I'm not sure what's happening with yours but I'd suggest trying

Code: Select all

 <?php

echo "<form action='Home.php?Action=$Action' method='post' ENCTYPE='multipart/form-data'>";
?>
See if that gets you any further

Re: URGENT:! Echo don´t work as supposed

Posted: Tue Aug 17, 2010 5:47 pm
by shawngoldw
echo works fine, $Action must not be defined there. Also, why is there a " before <?php and a . after ?>

Provide some more code, it will be helpful.


Shawn

Re: URGENT:! Echo don´t work as supposed

Posted: Wed Oct 06, 2010 3:59 am
by Goofan
I got an input to the action, and i got <php... and an end but still it outputs clean... what might be the problem? nothing wrong with that point of the code?



To provide with full code i assign this code:

Code: Select all

<?php session_start() ?>
<!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
	//User checking\\
	if ($_SESSION["inloggning"] == true){
	}elseif ($_SESSION["inloggning"] == false){
		header("Refresh: 5; url=Index.php");
		exit();
	}
	
 	//Includes\\
 	require_once('Menu-OOP.php'); 
	  $Action = ($_GET['Action']);
	require_once('database/OOP.Database.Login.php'); 
	  $db = new database() 
?>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Banner - Home</title>
	<link href="Style.css" rel="stylesheet" type="text/css">
 </head>
 <body>
 <form action="" method="post" ENCTYPE="multipart/form-data">
     <p class="PosFixedTop1">
         <div class='BoxLeft'>
             <?php
                if (isset($_POST["Submit"])){
                    if ($_POST['message'] == "") {
                    }else{
                        $Msg = $_POST['message'];
						$mysql = "INSERT INTO instant_message (message) VALUES ('$Msg')";
						$query = $db->dbquery($mysql);
						
						$mysql = "SELECT * FROM instant_message";
						$result = $db->dbquery($mysql);
						
						while($array = $db->fetchArray($result)){
							$db_Msg = $array['message'];
						}
						echo "<b class='Color'>$db_Msg</b>";
                    }
                }
             ?>
         </div>
     </p>
     	 
     <p class="PosFixedTop2">
     	<div class='BoxRight'>
             <b class='Color'>Message: </b>
             <input type="text" name="message">
             <input name="Submit" type="submit" value="Submit">
         </div>
     </p>
 </form>
     
     <table width="100%" height="100%" cellspacing="1">
     	<td height="25px">
        </td>
         <tr>
         </tr>
         <tr>
             <td width="15%" height="100%" valign="top">
                <?php //Left Empty Side\\ ?>
             </td>
             <td>
                <table width="100%" height="100%" cellspacing="1">
                    <tr>
                        <td class="TdColor" colspan="2" height="130px" valign="top">
                            <?php //Top Picture\\ ?>
                        </td>
                    </tr>
                    <tr cellspacing='0'>
                        <td class="TdColor" width="18%" height="513px" valign="top">
                            <?php //Label Picture\\ ?>
                            
                            <?php //Menu\\ ?>
                        <p class="PosFixed">
                            <?php
                            	$links = new Index();
							?>
                        <br><b class="Color"> Menu </b><br>
                            <?php
								if ($Action == "Home") {
									
									echo implode('<br> ', $links->getLinks("Normal"));
								}
								elseif ($Action == "Overview") {
									
									echo implode('<br> ', $links->getLinks("SubOne"));
								}
								elseif ($Action == "LinkTwo") {
	
									echo implode('<br> ', $links->getLinks("SubTwo"));
								}
								elseif ($Action == "LinkThree") {
						   
									echo implode('<br> ', $links->getLinks("SubThree"));
								}
								
							?>
                        </p>
                        </td>
                        <td class="TdColor" valign="top"> 
     						<?php //Top\\ ?>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="15%" valign="top">
                <?php //Right Empty Side\\ ?>
            </td>
         </tr>
         <tr>
         </tr>
 	</table>
 </body>
 </html>

Re: URGENT:! Echo don´t work as supposed

Posted: Wed Oct 06, 2010 9:04 am
by s.dot
Access $Action using $_GET['Action']

Re: URGENT:! Echo don´t work as supposed

Posted: Wed Oct 06, 2010 11:22 am
by tof
You just seem to have one double-quote after Action= that you have to remove and the dot (".") before method=
the right syntax is this :
<form action="Home.php?Action=<?php echo $Action; ?>" method="post" ENCTYPE="multipart/form-data">