Jump to content

vote-for-pedro

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vote-for-pedro's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes this would be the way i was thinking... simple is fine and good it's not got to be very clever.. i would be using matches rather than dates i think match 1, 2 ,3 ,4, per month. Would using a forum to control the user login and their availabilty form be a good move or do you think it will cause much problems.
  2. Hi not sure if this is in the right place but hopefully someone can recommend somthing. Ive been given the challenge by my local hocky team to create an availabillity calender. My idea is to have a forum to begin with so players can log in. from there they can see a list of matches which they can either tick if they are available or leave blank if they are not. up to as many as 40 people. then on another page all the info can be displayed. Anyone know of somthing i could use to do this, or how to go about starting maybe? All suggestions welcome please it really dosent have to be a very clever system but im not sure on the best way to layout the database etc.
  3. the code below is for a search box with an image as the submit button (button_quick_find.gif). how can i change it so instead of an image, the word search is the submit link? <?php $hide = tep_hide_session_id(); echo '<form name="quick_find" method="get" action="' . tep_href_link (FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; echo $hide . '<input type="text" name="keywords" size="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH); echo '</form>'; ?>
  4. Changed it to this for it to work.. is it as safe as ive removed the ssl part... can it be put back in <?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . tep_image(DIR_WS_IMAGES_BUTTONS . 'header_account.gif', IMAGE_BUTTON_ACCOUNT) . '</a>'; ?>
  5. hi, what am i doing wrong here im trying to get my images: header_account.gif & header_checkout.gif to be links. for some reason the hand come up to suggest the link is working but nothing happens when its clicked. this is for an oscommerce site so maybe i need to define it somewhere else? Thanks <?php if (tep_session_is_registered('customer_id')) { ?> <a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"> <?php echo HEADER_TITLE_LOGOFF; ?></a><?php } ?> <a href=" <?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"> <?php echo tep_image_submit('header_account.gif', IMAGE_BUTTON_ACCOUNT); ?></a> <a href=" <?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"> <?php echo tep_image_submit('header_checkout.gif', IMAGE_BUTTON_CHECKOUT); ?> </a>
  6. Great thats kinda worked, only problem is it thinks there are 14 check boxes when there are only 2. This means clicking ok 14 times when really i would like one popup for the checkbox field. 1 error message as they should have checked one or the other checkboxes. ive included the code below im using with the checkbox function in it. <script language="JavaScript" type="text/javascript"> <!-- function checkform ( form ) { // see http://www.thesitewizard.com/archive/validation.shtml // for an explanation of this script and how to use it on your // own website // ** START ** if (form1.name.value == "") { alert( "Please enter your full name." ); form.email.focus(); return false ; } // ** END ** // ** START ** if (form1.address1.value == "") { alert( "Please enter your full address (line 1)." ); form.email.focus(); return false ; } // ** END ** // ** START ** if (form1.address2.value == "") { alert( "Please enter your full address (line 2)." ); form.email.focus(); return false ; } // ** END ** // ** START ** if (form1.postcode.value == "") { alert( "Please enter your full postcode." ); form.email.focus(); return false ; } // ** END ** // ** START ** if (form1.tell.value == "") { alert( "Please enter a telephone number we can contact you on." ); form.email.focus(); return false ; } // ** END ** // ** START ** if (form1.voucher.value == "") { alert( "Please enter your voucher number." ); form.email.focus(); return false ; } // ** END ** // ** START ** { var formblock= document.getElementById('form1'); var forminputs = formblock.getElementsByTagName('input'); for(i=0;i<forminputs.length;i++){ if(forminputs[i].checked) { alert("checkbox"+i+"=checked"); }else{ alert("checkbox"+i+"=not checked"); } } } // ** END ** // ** START ** if (form1.vmake.value == "") { alert( "Please enter your vehicle make and model." ); form.email.focus(); return false ; } // ** END ** return true ; } //--> </script> <body> <p><img src="images/header-clearview.jpg" /><img src="images/header-mirror.jpg" /></p> <form action="insert.php" method="post" name="form1" class="style3" id="form1" onsubmit="return checkform(this);"> <p><span class="style8">*</span> DENOTES REQUIRED FIELD</p> <table width="70%" height="609" border="0" cellpadding="0" cellspacing="0" > <tr> <td width="31%" height="22"><strong>Name: </strong></td> <td width="69%"><input name="name" type="text" id="name" tabindex="1" size="50" /> <span class="style8">*</span> </td> </tr> <tr> <td><label></label></td> <td><label></label></td> </tr> <tr> <td height="88" valign="top"><strong>Address:</strong></td> <td><label> <input name="address1" type="text" id="address1" tabindex="2" size="50" /> <span class="style8">*</span> <br /> <input name="address2" type="text" id="address2" tabindex="3" size="50" /> <br /> <input name="address3" type="text" id="address3" tabindex="4" size="50" /> <br /> <input name="address4" type="text" id="address4" tabindex="5" size="50" /> </label></td> </tr> <tr> <td height="22"><label><strong>Post Code:</strong></label></td> <td><label> <input name="postcode" type="text" id="postcode" tabindex="6" size="8" maxlength="7" /> <span class="style8">*</span> </label></td> </tr> <tr> <td height="33"><strong>Contact Number:</strong></td> <td><label> <input name="tell" type="text" id="tell" tabindex="7" size="25" /> <span class="style8">*</span> DAY-NIGHT NUMBERS</label></td> </tr> <tr> <td height="22"><strong>Fax number</strong>:</td> <td><label> <input name="fax" type="text" id="fax" tabindex="8" size="25" /> </label></td> </tr> <tr> <td height="22"><strong>Email Address:</strong></td> <td><label> <input name="email" type="text" id="email" tabindex="9" size="50" /> </label></td> </tr> <tr> <td height="32"> </td> <td><label> </label></td> </tr> <tr> <td width="31%"><strong>Voucher Number:</strong></td> <td width="69%"><label> <input name="voucher" type="text" id="voucher" size="7" tabindex="10" maxlength="6" /> <span class="style8">*</span> </label></td> </tr> <tr> <td><strong>Location of install:</strong><br /></td> <td><input type="checkbox" name="fitting" value="Garage" tabindex="11" /> Garage <input type="checkbox" name="fitting" value="Home" /> Home<span class="style8">*</span> </td> </tr> <tr> <td><strong class="style4 style7">Fitting address if <br /> differnt from <br /> home address</strong></td> <td><label> <textarea name="fittingaddress" id="fittingaddress" cols="50" rows="5" tabindex="12"></textarea> </label></td> </tr> <tr> <td class="style3"><div align="left"><strong>Ideal Date/Time:</strong></div></td> <td><label> <input type="text" name="date" id="date" tabindex="13" /> </label></td> </tr> <tr> <td class="style3"><div align="left"><strong><br /> </strong></div></td> <td><label></label></td> </tr> <tr> <td class="style3"><strong>Vehicle<br /> Make and model:</strong></td> <td><input name="vmake" type="text" id="vmake" size="50" maxlength="50" tabindex="14" /> <span class="style8">*</span> </td> </tr> <tr> <td valign="top" class="style6"><div align="left">Registration Number:</div></td> <td><input name="reg" type="text" id="reg" size="8" maxlength="8" tabindex="15"/></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><label> <div align="center"><strong>Extra Info:<br /> </strong><span class="style5">Please Specify for example<br /> body kits ect.</span></div> </label> <div align="center" class="style4">MAX 255 CHARACTERS</div></td> <td><textarea name="notes" id="notes" cols="50" rows="5" tabindex="16"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" id="submit" value="Submit" tabindex="20" ></td> </tr> </table> </form>
  7. ok if i change echo "<a href='voucherview.php?id=$row->id'>$row->name</a>"; to echo "<a href='voucherview.php?id=$row->id'>anythingelse</a>"; it shows a list of links above the table (same amount of links as database entries) with the code as you had it no links appear in the id field. do i need to incorporate the echo "\n<tr >"; as well, but as mentioned if i remove the entire ... start a TABLE row ... section the table is still created succesfully.
  8. thanks mmarif4u think thats on the right line but it dosent seem to work (no link at all) ive noticed you can remove the // ... start a TABLE row ... echo "\n<tr >"; completely and its still works the same. can you explain your code a little more thanks
  9. Hi, im using the following code to output everything in a database table under headings in an html table untill theres no more data left. The headings are things like name address etc. could i make it so when all the data is shown each name or ID becomes a link and when clicked takes the user to a more detailed page on the selected client. because of the way the table is generated there is no where to place link tags. is there a more appropriate way that is more editable? it would be nice to have checkboxes at the edge of each customer also to enable a complete status or deleting a client from the table. // Show the customer in an HTML <table> function displayStock($result) { // Start a table, with column headers echo "\n<table border=\"0\">\n<tr bgcolor=\"lightblue\">\n" . "\n\t<th>ID</th >" . "\n\t<th>Name</th>" . "\n\t<th>Address</th>" . "\n\t<th>Address2</th>" . "\n\t<th>Address3</th>" . "\n\t<th>Address4</th>" . "\n\t<th>Post code</th>" . "\n\t<th>Tell Number</th>" . "\n\t<th>Fax Number</th>" . "\n\t<th>Emaill Address</th>" . "\n\t<th>Voucher Code</th>" . "\n\t<th>Fitting Method</th>" . "\n\t<th>Fitting Address</th>" . "\n\t<th>Ideal fitting Date</th>" . "\n\t<th>Vehicle Model</th>" . "\n\t<th>Vehicle Reg</th>" . "\n\t<th>Notes</th>" . "\n\t<th>Date form submitted</th>" . "\n</tr >"; // Until there are no rows in the result set, // fetch a row into the $row array and ... while ($row = @ mysql_fetch_row($result)) { // ... start a TABLE row ... echo "\n<tr >"; // ... and print out each of the attributes // in that row as a separate TD (Table Data). foreach($row as $data) echo "\n\t<td bgcolor=\"silver\" > $data </td>"; // Finish the row echo "\n</tr>"; } // Then, finish the table echo "\n</table >\n"; } if (!($result = @ mysql_query ("SELECT * FROM mirrorcam ORDER BY id desc", $connection ))) showerror( ); // Display the results displayStock($result); // Close the connection if (!(mysql_close($connection))) showerror( ); ?>
  10. Hi im using the code below to check if form fields have been filled in at all. its very basic but that ok. I have 2 radio buttons in the form and i would like to be able to check if one or the other has been selected also. Is there a simple way of editing the code below so it will check a radio button field. thanks // ** START ** if (form.checkbox.value == "") { alert( "Please enter your email address." ); form.email.focus(); return false ; } // ** END ** return true ; i guess it would be changing this bit if (form.checkbox.value == "0") {
  11. //New Query $sql = "INSERT INTO $table_name (name, address1, address2, address3, address4, postcode, fitting) VALUES ('$_POST[name]', '$_POST[address1]', '$_POST[address2]', '$_POST[address3]', '$_POST[address4]', '$_POST[postcode]', '$_POST[fitting]')"; and all fields were filled correctly in the database with the name , lines of address and post code.
  12. thanks but it didnt work, Solved by removing ' ' from around the table names worked. //New Query $sql = "INSERT INTO $table_name (name, address1, address2, address3, address4, postcode, fitting) VALUES ('$_POST[name]', '$_POST[address1]', '$_POST[address2]', '$_POST[address3]', '$_POST[address4]', '$_POST[postcode]', '$_POST[fitting]')"; //Old Query $sql = "INSERT INTO $table_name ('name, address1, address2, address3, address4, postcode, fitting') VALUES ('$_POST[name]', '$_POST[address1]', '$_POST[address2]', '$_POST[address3]', '$_POST[address4]', '$_POST[postcode]', '$_POST[fitting]')"; simple really very annoying when you cant see it thanks for your help.
  13. ithink your right about the syntax problems how can i see where the errors appear
  14. Hi there im having a bit of trouble with entering a small amount of info in to my sql database. the table sructure looks like so. im not sure if i need enter a value in to 'id' to create the auto_increment -- Table structure for table `mirrorcam` -- CREATE TABLE `mirrorcam` ( `id` int(255) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `address1` varchar(255) NOT NULL default '', `address2` varchar(255) NOT NULL default '', `address3` varchar(255) NOT NULL default '', `address4` varchar(255) NOT NULL default '', `postcode` varchar(255) NOT NULL default '', `fitting` varchar(255) NOT NULL default '', UNIQUE KEY `id` (`id`) ) TYPE=MyISAM AUTO_INCREMENT=1 ; -- -- Dumping data for table `mirrorcam` -- and my php like so.. it echos the results out fine so it's posting ok. <? //check for required fields if ((!$_POST[id]) || (!$_POST[format]) || (!$_POST[title])) { header( "Location: /show_addrecord.html"); exit; } //set up database and table names $db_name = "test"; $table_name = "mirrorcam"; //connect to MySQL and select database to use $connection = @mysql_connect("xxx.xxxxxxx.co.uk", "xxxx", "xxxx") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); //create SQL statement and issue query $sql = "INSERT INTO $table_name ('name, address1, address2, address3, address4, postcode, fitting') VALUES ('$_POST[name]', '$_POST[address1]', '$_POST[address2]', '$_POST[address3]', '$_POST[address4]', '$_POST[postcode]', '$_POST[fitting]')"; $result = @mysql_query($sql,$connection) or die(mysql_error()); ?> <p>Name: <br /><? echo "$_POST[name]"; ?></p><br /> <p>address:<br /> <? echo "$_POST[address1]"; ?><br /> <? echo "$_POST[address2]"; ?><bR /> <? echo "$_POST[address3]"; ?><br /> <? echo "$_POST[address4]"; ?></p><br /> <p> </p> <p>postcode: <br /><? echo "$_POST[postcode]"; ?></p><br /> <p>fitting: <br /><? echo "$_POST[fitting]"; ?></p><bR /> <p> </p> Thanks for your help
  15. Dragen that worked great thanks for the promt reply what a great forum!
×
×
  • 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.