Jump to content

jonmy

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by jonmy

  1. I'll try that, see if I can locate the file with the relevant code in it Thnx
  2. I've located two documents relating to smarty in a lib file. Would these be standard lib documents or do I need to post them? I've also found another document called register.php, appended below, which I wonder if this is the one you mentioned. Hope this is right for the tags <?php ////////////////////////////////////////////////////////////////// error_reporting(E_ALL ^ E_NOTICE); ////////////////////////////////////////////////////////////////// // Strip HTML Code / Chars from User Input ////////////////////////////////////////////////////////////////// while (list ($key,$val) = @each ($_GET)) { if(!is_array($val)) { $_GET[$key] = htmlentities($val); } } while (list ($key,$val) = @each ($_POST)) { if(!is_array($val)) { $_POST[$key] = strip_tags($val); } } ///////////////////////////////////////////////////////////////// // Define & Get Admin Settings: ///////////////////////////////////////////////////////////////// define( 'CFG_LIB_PATH', 'libs/' ); define( 'CFG_PATH', 'configs/' ); require_once(CFG_PATH . "config.php"); require_once(CFG_PATH . "admin_config.php"); require_once(CFG_LIB_PATH . "Smarty.class.php"); require_once(CFG_LIB_PATH . "class.phpmailer.php"); require_once(CFG_LIB_PATH . "class.dbsession.php"); ///////////////////////////////////////////////////////////////// // Etc... ///////////////////////////////////////////////////////////////// $conn = mysql_connect(CFG_db_host,CFG_db_username,CFG_db_password) or die ('Error connecting to mysql'); $db = @mysql_select_db(CFG_db_name, $conn) or die(mysql_error()); ///////////////////////////////////////////////////////////////// // Set Session Support ///////////////////////////////////////////////////////////////// $sessions_in_db = CFG_Sessions_In_DB; if($sessions_in_db) { $session = new dbsession(); } else { session_start(); } ///////////////////////////////////////////////////////////////// $query = "select * FROM mm_settings"; $result = mysql_query($query); while ($data = @mysql_fetch_array ($result)) { $settings[$data[name]] = $data[setting]; } ///////////////////////////////////////////////////////////////// // Remove Remember Me Cookies: ///////////////////////////////////////////////////////////////// if($_POST[email]) { setcookie("email_address","$_POST[email]",time()+$settings[remember],"/","",0); setcookie("pass","0",time()+$settings[remember],"/","",0); } ///////////////////////////////////////////////////////////////// // Get Functions: ///////////////////////////////////////////////////////////////// require_once(CFG_LIB_PATH . "user_functions.php"); require_once(CFG_LIB_PATH . "user_add_functions.php"); require_once(CFG_LIB_PATH . "admin_functions.php"); $smarty = new Smarty; $todays_date = date("Y-m-d"); if($todays_date != "$settings[cycle_last_ran]") { daily_cycle(); } ////////////////////////////////////////////////////////////////// // Subscribe / Add e-Mail ////////////////////////////////////////////////////////////////// add_user(); exit; ?> 18646_.php
  3. Here's the whole file. Does that help? Unfortunately I'm not really a coder so please excuse my lack of knowledge in this area (still learning) - not familiar with smarty either... {include file='../interface/html_register_header.php'} <!-- CONTENT --> <form action="{$SCRIPT_NAME}" Method=Post> <table border="0" bordercolor="black" cellspacing="0" cellpadding="0" width="650" align="center"> <tr> <td> {section name=users loop=$Error start=0 max=1} <fieldset> <legend><font color="red">Registration Errors</font> </legend> {/section} <p> {section name=sec1 loop=$Error} <font color="red">- {$Error[sec1]}</font><br> {/section} {section name=users loop=$Error start=0 max=1} </fieldset> {/section} <br> <fieldset> <legend><font color="#4169E1">Register New Account</font></legend> <p> <table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr> <td width="35%">Your Name</font></td> <td> <input type=text name="name" value="{$name}" size="35"></td> </tr> {if $request_username} <tr> <td>Username</font></td> <td> <input type=text name="username" value="{$username}" size="35"><br></td> </tr> {/if} <tr> <td>e-Mail Address</font></td> <td> <input type=text name="email" value="{$email}" size="35"><br></td> </tr> <tr> <td>Confirm e-Mail</font></td> <td> <input type=text name="cemail" value="{$cemail}" size="35"><br></td> </tr> <input type=hidden name="html" value="1" {$html_email_checked}> <tr> <td> Membership Type </td> <td> <select name="type_chosen" size="1"> {section name=types loop=$pid} <option value="{$pid[types]}" {$type_selected[types]}> {$type_name[types]} {if $type_price[types]} (${$type_price[types]}) {/if} </option> {/section} </select> </td> </tr> </table> </fieldset> <p> <fieldset> <!--<legend><font color="#4169E1">Addirional Account details</font></legend>--> <p> <table border="0" cellspacing="3" cellpadding="3" width="100%"> {section name=customs loop=$fid} {if ($type[customs] == "checkbox") } <tr> <td width="35%" valign=top>{$question[customs]}</td> <td>{$answers[customs]}</td> </tr> {/if} {if ($type[customs] == "radio") } <tr> <td width="35%" valign=top>{$question[customs]}</td> <td>{$answers[customs]}</td> </tr> {/if} {if ($type[customs] == "textarea") } <tr> <td width="35%" valign=top>{$question[customs]}</td> <td> <textarea name="FIELD{$fid[customs]}" cols=33 rows=6>{$default_value[customs]}</textarea> </td> </tr> {/if} {if ($type[customs] == "dropdown") } <tr> <td width="35%" valign=top>{$question[customs]}</td> <td> <SELECT name="FIELD{$fid[customs]}"> {$answers[customs]}<br> </select> </td> </tr> {/if} {if ($type[customs] == "text") } <tr> <td width="35%" valign=top>{$question[customs]}</td> <td> <input type="text" name="FIELD{$fid[customs]}" size="35" value="{$default_value[customs]}"></td> </tr> {/if} {/section} <tr> <td colspan="2" align="right"> <input type="submit" name="save_user" value=" Register >> "> <br> </td> </tr> </table> </fieldset> </td> </tr> </table> <!-- /CONTENT --> <table border="0" height="70" width="100"> <tr> <td> </td> </tr> </table> {include file='../interface/html_register_footer.php'}
  4. Hi I'm reconfiguring a piece of code for a dropdown menu using the option tags. The dropdown is a simple 3 option dropdown. As it stands with the code below it always defaults to show the first option in the list. What I want is to be able to pre-select the option that shows (eg no 2 in the list). Normally of course with just option tags you use selected="selected" In this case though the code is a bit more complex and this coding is a bit beyond me. Any help would be appreciated. <td> Membership Type </td> <td> <select name="type_chosen" size="1"> {section name=types loop=$pid} <option value="{$pid[types]}" {$type_selected[types]}> {$type_name[types]} {if $type_price[types]} (${$type_price[types]}) {/if} </option> {/section} </select>
×
×
  • 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.