Problem Implementing Html code to php

Discussion in 'PHP' started by essens, Nov 18, 2009.

  1. #1
    My Form Code

    
    <form method='post'>
    <input type='hidden' name='token' value='{$tok_id}'>
    <table>
    	<tr>
    		<td>Username:</td>
    		<td><input type='text' name='1' id='username' value='{$username}' class='input'></label></td>
    	</tr>
    	<tr>
    		<td>Password:</td>
    		<td><input id='password' type='password' name='2' value='' class='input'></td>
    	</tr>
    	<tr>
    		<td colspan='2'><small>Your password must be alphanumeric characters A-Z and/or 0-9.</small></td>
    	</tr>
    	<tr>
    		<td>Confirm Password:</td>
    		<td><input id='cpassword' type='password' name='3' value='' class='input'></td>
    	</tr>
    	<tr>
    		<td>Email Address:</td>
    		<td><input id='email' type='text' name='4' value='{$email}' class='input'></td>
    	</tr>
    	<tr>
    		<td>Alertpay Address:</td>
    		<td><input id='alertpay' type='text' name='5' value='{$alertpay}' class='input'></td>
    	</tr>
    	<tr>
    		<td>Referral:(optional)</td>
    		<td><input id='referral' type='text' name='6' value='{$ref}' class='input'></td>
    	</tr>
    	<tr>
    		<td>Detected Country:</td>
    		<td>{$country_name}</td>
    	</tr>";
    if($set['pcaptcha']) {
    $contents .= "
    <tr><td>&nbsp;</td></tr>
    <tr>
    
    	<td colspan='2' align='center'>
    		<table style='border-top: 1px solid #000000; border-bottom: 1px solid #000000;'>
    			<tr>
    				<td>Type the letters you see below:</td>
    			</tr>
    			<tr>";
    if($ref) {
    		$contents .= "<td><img src='../image.php?$res' /></td>";
    	}else {
    		$contents .= "<td><img src='image.php?$res' /></td>";
    	}
    }
    $contents .="<td><input type='text' size='3' maxlength='3' name='code' autocomplete='off' class='securitycode' value=''></td></tr></table></tr>";
    if($set['recaptcha_enabled']) {
    $contents .= "
    <tr>
    	<td colspan='2'>{$recaptcha}</td>
    </tr>";
    }
    $contents .= "
    <input type='hidden' name='7' value='{$country_name}'>
    <tr>
    	<td align='center'><br /><br /><input type='submit' value='Register Account'></td>
    </tr>
    </form>
    Code (markup):
    Implementing the Form style:

    i put this code under the top of the script

    <!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=utf-8" />
    <script language="javascript" type="text/javascript" src="niceforms.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />
    </head>
    Code (markup):
    in html you need to write this on top of the form and the style works

    <form action="vars.php" method="post" class="niceform">
    Code (markup):
    in php it dosen't can anyone help please?
     
    Last edited: Nov 18, 2009
    essens, Nov 18, 2009 IP
  2. pixmania

    pixmania Peon

    Messages:
    229
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    
    echo '<form action=\"vars.php\" method=\"post\" class=\"niceform\">';
    
    
    
    PHP:
    Assuming your file is a .php one ?
    You echo html and backslash quotes \"
     
    pixmania, Nov 18, 2009 IP
  3. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Show us the php codes you used.
     
    ads2help, Nov 18, 2009 IP
  4. essens

    essens Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    My Form Code

    
    <form method='post'>
    <input type='hidden' name='token' value='{$tok_id}'>
    <table>
    	<tr>
    		<td>Username:</td>
    		<td><input type='text' name='1' id='username' value='{$username}' class='input'></label></td>
    	</tr>
    	<tr>
    		<td>Password:</td>
    		<td><input id='password' type='password' name='2' value='' class='input'></td>
    	</tr>
    	<tr>
    		<td colspan='2'><small>Your password must be alphanumeric characters A-Z and/or 0-9.</small></td>
    	</tr>
    	<tr>
    		<td>Confirm Password:</td>
    		<td><input id='cpassword' type='password' name='3' value='' class='input'></td>
    	</tr>
    	<tr>
    		<td>Email Address:</td>
    		<td><input id='email' type='text' name='4' value='{$email}' class='input'></td>
    	</tr>
    	<tr>
    		<td>Alertpay Address:</td>
    		<td><input id='alertpay' type='text' name='5' value='{$alertpay}' class='input'></td>
    	</tr>
    	<tr>
    		<td>Referral:(optional)</td>
    		<td><input id='referral' type='text' name='6' value='{$ref}' class='input'></td>
    	</tr>
    	<tr>
    		<td>Detected Country:</td>
    		<td>{$country_name}</td>
    	</tr>";
    if($set['pcaptcha']) {
    $contents .= "
    <tr><td>&nbsp;</td></tr>
    <tr>
    
    	<td colspan='2' align='center'>
    		<table style='border-top: 1px solid #000000; border-bottom: 1px solid #000000;'>
    			<tr>
    				<td>Type the letters you see below:</td>
    			</tr>
    			<tr>";
    if($ref) {
    		$contents .= "<td><img src='../image.php?$res' /></td>";
    	}else {
    		$contents .= "<td><img src='image.php?$res' /></td>";
    	}
    }
    $contents .="<td><input type='text' size='3' maxlength='3' name='code' autocomplete='off' class='securitycode' value=''></td></tr></table></tr>";
    if($set['recaptcha_enabled']) {
    $contents .= "
    <tr>
    	<td colspan='2'>{$recaptcha}</td>
    </tr>";
    }
    $contents .= "
    <input type='hidden' name='7' value='{$country_name}'>
    <tr>
    	<td align='center'><br /><br /><input type='submit' value='Register Account'></td>
    </tr>
    </form>
    Code (markup):
    Implementing the Form style:

    i put this code under the top of the script

    <!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=utf-8" />
    <script language="javascript" type="text/javascript" src="niceforms.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />
    </head>
    Code (markup):
    in html you need to write this on top of the form and the style works

    <form action="vars.php" method="post" class="niceform">
    Code (markup):
    in php it dosen't can anyone help please?
     
    essens, Nov 18, 2009 IP
  5. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #5
    You still did not show us the full php codes =x

    Anyway, I think you messed up the quotes. Learn more here

    Below is my guess on how you write your codes. try this.

    <?php
    
    $contents .= '<!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=utf-8" />
    <script language="javascript" type="text/javascript" src="niceforms.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />
    </head>';
    
    $contents .= "<form method='post' method='post' class='niceform'>
    <input type='hidden' name='token' value='$tok_id'>
    <table>
    	<tr>
    		<td>Username:</td>
    		<td><input type='text' name='1' id='username' value='$username' class='input'></label></td>
    	</tr>
    	<tr>
    		<td>Password:</td>
    		<td><input id='password' type='password' name='2' value='' class='input'></td>
    	</tr>
    	<tr>
    		<td colspan='2'><small>Your password must be alphanumeric characters A-Z and/or 0-9.</small></td>
    	</tr>
    	<tr>
    		<td>Confirm Password:</td>
    		<td><input id='cpassword' type='password' name='3' value='' class='input'></td>
    	</tr>
    	<tr>
    		<td>Email Address:</td>
    		<td><input id='email' type='text' name='4' value='$email' class='input'></td>
    	</tr>
    	<tr>
    		<td>Alertpay Address:</td>
    		<td><input id='alertpay' type='text' name='5' value='$alertpay' class='input'></td>
    	</tr>
    	<tr>
    		<td>Referral:(optional)</td>
    		<td><input id='referral' type='text' name='6' value='$ref' class='input'></td>
    	</tr>
    	<tr>
    		<td>Detected Country:</td>
    		<td>$country_name</td>
    	</tr>";
    if($set['pcaptcha']) {
    $contents .= "
    <tr><td>&nbsp;</td></tr>
    <tr>
    
    	<td colspan='2' align='center'>
    		<table style='border-top: 1px solid #000000; border-bottom: 1px solid #000000;'>
    			<tr>
    				<td>Type the letters you see below:</td>
    			</tr>
    			<tr>";
    if($ref) {
    		$contents .= "<td><img src='../image.php?$res' /></td>";
    	}else {
    		$contents .= "<td><img src='image.php?$res' /></td>";
    	}
    }
    $contents .="<td><input type='text' size='3' maxlength='3' name='code' autocomplete='off' class='securitycode' value=''></td></tr></table></tr>";
    if($set['recaptcha_enabled']) {
    $contents .= "
    <tr>
    	<td colspan='2'>$recaptcha</td>
    </tr>";
    }
    $contents .= "
    <input type='hidden' name='7' value='$country_name'>
    <tr>
    	<td align='center'><br /><br /><input type='submit' value='Register Account'></td>
    </tr>
    </form>";
    PHP:
     
    ads2help, Nov 18, 2009 IP