Jump to content

cavey5

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Everything posted by cavey5

  1. I have a subscription database that allows you to edit a subscribers data. For example, you enter a search term like "Bob" and it returns a list of everyone named Bob. You click the one you want and it goes to a subscriber detail page, where all of his data is populated to a form. You can directly edit this form and click save to overwrite it. The only issue is the select boxes (drop downs) - say I have four options in the drop down box, red, blue, green and black. On my details page for bob I end up with five, I have those four PLUS whatever was saved for his color, so it shows up twice. If Bob is green, my select box looks like: Green Red Blue Green Black How can I make it so that Green only shows up once?
  2. Heck, after a handful of Ibeuprofin and a shot of whickey I think I see my amatuer mistake. elseif ($_POST['cm_subtype'] = "can") and elseif ($_POST['cm_subtype'] = "for") only have one equal sign, thus setting the variable, not checking it lol... my bad.
  3. No, that would defeat the purpose of the if statement. The session is initiated on a previous page, that code is just checking to see if a session already exists. If it doesn't, it routes you back to the index and starts a session. This keeps people from typing in www.domain.com/cart.php and seeing an empty cart. I still cannot get this to work. For some reason the international selection is echoing the canadian data. Maybe my server is a smart ass and trying to tell me that Canada is international haha..
  4. Alright I changed my if statement around a little but still have a problem... I have five radio buttons, all with the same name but with five different values assigned to them, as follows: usa1 usa2 usa3 can for can is a Canadian subscription and it is $36.00 for is a foreign subscription and it is $45.00 No matter what i do though, when I select the foreign option, it echos the Canadian price and description to the database. The other four work fine, what gives? Is there something wrong with my if statement? I echod the values that the form is putting out to a blank page and it is perfect, if you select Foreign, echo $_POST[cm_subtype]; displays "for" Ideas? if ($_POST['cm_subtype'] == "usa1") { $cm_price = number_format (23.97,2); $cm_description = "USA Subscription - 1 Year"; } elseif ($_POST['cm_subtype'] == "usa2") { $cm_price = number_format (37.97,2); $cm_description = "USA Subscription - 2 Years"; } elseif ($_POST['cm_subtype'] == "usa3") { $cm_price = number_format (49.97,2); $cm_description = "USA Subscription - 3 Years"; } elseif ($_POST['cm_subtype'] = "can") { $cm_price = number_format (36.00,2); $cm_description = "CAN Subscription - 1 Year"; } elseif ($_POST['cm_subtype'] = "for") { $cm_price = number_format (45.00,2); $cm_description = "Foreign Subscription - 1 Year"; } else { $cm_price = number_format (25.00,2); $cm_description = "USA Subscription - 1 Year"; }
  5. I have a form that allows users to select one of five options via a radio button. All of the radio buttons have the same name, and different values. These are passed to a script via POST and inserted in a database. The problem is it is randomly selecting one of the five values, not always what the user selected. My code is below, what am I missing? It seems so basic, am I crazy? User Input Form <form name="cm_subscribe" action="addtocart.php" method="post" autocomplete="off" onSubmit="return checkit(this)"> <table width="448" cellpadding="0" cellspacing="0" align="center" valign="top" border="0"> <tr> <td width="28" height="30" bgcolor="#dcddd8" align="right"><input type="radio" name="cm_subtype" value="usa1"></input></td> <td width="105" height="30" bgcolor="#dcddd8" align="center">18</td> <td width="85" height="30" bgcolor="#dcddd8" align="left">3 Years</td> <td width="52" height="30" bgcolor="#dcddd8" align="left">$49.97</td> <td width="40" height="30" bgcolor="#dcddd8" align="left"><img src="images/cart/red_arrow.jpg" alt="Best Deal!" /></td> <td width="138" height="30" bgcolor="#dcddd8" align="left"><B>Only $2.77 an issue!</B></td> </tr> <tr> <td width="448" height="1" colspan="6" bgcolor="#333333"></td> </tr> <tr> <td width="28" height="30" bgcolor="#f5f5f5" align="right"><input type="radio" name="cm_subtype" value="usa2"></input></td> <td width="105" height="30" bgcolor="#f5f5f5" align="center">12</td> <td width="85" height="30" bgcolor="#f5f5f5" align="left">2 Years</td> <td width="52" height="30" bgcolor="#f5f5f5" align="left">$37.97</td> <td width="40" height="30" bgcolor="#f5f5f5" align="center"></td> <td width="138" height="30" bgcolor="#f5f5f5" align="center"></td> </tr> <tr> <td width="28" height="30" bgcolor="#f5f5f5" align="right"><input type="radio" name="cm_subtype" value="usa3"></input></td> <td width="105" height="30" bgcolor="#f5f5f5" align="center">6</td> <td width="85" height="30" bgcolor="#f5f5f5" align="left">1 Year</td> <td width="52" height="30" bgcolor="#f5f5f5" align="left">$23.97</td> <td width="40" height="30" bgcolor="#f5f5f5" align="center"></td> <td width="138" height="30" bgcolor="#f5f5f5" align="center"></td> </tr> <tr> <td width="448" height="1" colspan="6" bgcolor="#333333"></td> </tr> <tr height="10"> </td> </tr> <tr> <td width="28" height="30" bgcolor="#f5f5f5" align="right"><input type="radio" name="cm_subtype" value="can1"></input></td> <td width="420" height="30" bgcolor="#f5f5f5" align="left" colspan="5"> Canadian Order / $34.00 USD Per Year</td> </tr> <tr> <td width="28" height="30" bgcolor="#f5f5f5" align="right"><input type="radio" name="cm_subtype" value="int1"></input></td> <td width="420" height="30" bgcolor="#f5f5f5" align="left" colspan="5"> Foreign Order / $45.00 USD Per Year</td> </tr> </table> Add To Cart Script Dumps It In a Database Table <?php if (!$PHPSESSID) { header("Location: index.php"); exit; } session_start(); ?> <? // Makes initial connection to database @include ('sql_connect.php'); $cm_subtype = mysql_real_escape_string($_POST['cm_subtype']); $cm_sfirstname = mysql_real_escape_string($_POST['cm_sfirstname']); $cm_slastname = mysql_real_escape_string($_POST['cm_slastname']); $cm_saddress1 = mysql_real_escape_string($_POST['cm_saddress1']); $cm_saddress2 = mysql_real_escape_string($_POST['cm_saddress2']); $cm_scity = mysql_real_escape_string($_POST['cm_scity']); $cm_sstate = mysql_real_escape_string($_POST['cm_sstate']); $cm_szipcode = mysql_real_escape_string($_POST['cm_szipcode']); $cm_scountry = mysql_real_escape_string($_POST['cm_scountry']); $cm_sprovince = mysql_real_escape_string($_POST['cm_sprovince']); $cm_bfirstname = mysql_real_escape_string($_POST['cm_bfirstname']); $cm_blastname = mysql_real_escape_string($_POST['cm_blastname']); $cm_baddress1 = mysql_real_escape_string($_POST['cm_baddress1']); $cm_baddress2 = mysql_real_escape_string($_POST['cm_baddress2']); $cm_bcity = mysql_real_escape_string($_POST['cm_bcity']); $cm_bstate = mysql_real_escape_string($_POST['cm_bstate']); $cm_bzipcode = mysql_real_escape_string($_POST['cm_bzipcode']); $cm_bcountry = mysql_real_escape_string($_POST['cm_bcountry']); $cm_bprovince = mysql_real_escape_string($_POST['cm_bprovince']); $cm_email = mysql_real_escape_string($_POST['cm_email']); $cm_phone = mysql_real_escape_string($_POST['cm_phone']); $cm_cardtype = mysql_real_escape_string($_POST['cm_cardtype']); $cm_cardnumber = mysql_real_escape_string($_POST['cm_cardnumber']); $cm_expmon = mysql_real_escape_string($_POST['cm_expmon']); $cm_expyear = mysql_real_escape_string($_POST['cm_expyear']); $cm_promocode = mysql_real_escape_string($_POST['cm_promocode']); if ($cm_subtype == "usa1") { $cm_price = number_format (23.97,2); $cm_description = "USA Subscription - 1 Year"; } elseif ($cm_subtype == "usa2") { $cm_price = number_format (37.97,2); $cm_description = "USA Subscription - 2 Years"; } elseif (cm_subtype == "usa3") { $cm_price = number_format (49.97,2); $cm_description = "USA Subscription - 3 Years"; } elseif ($cm_subtype = "can1") { $cm_price = number_format (35.00,2); $cm_description = "CAN Subscription - 1 Year"; } elseif ($cm_subtype = "int1") { $cm_price = number_format (45.00,2); $cm_description = "Foreign Subscription - 1 Year"; } else { $cm_price = number_format (25.00,2); $cm_description = "USA Subscription - 1 Year"; } $insert_sub = "INSERT INTO cart (sessid, cm_subtype, cm_sfirstname, cm_slastname, cm_saddress1, cm_saddress2, cm_scity, cm_sstate, cm_szipcode, cm_scountry, cm_sprovince, cm_bfirstname, cm_blastname, cm_baddress1, cm_baddress2, cm_bcity, cm_bstate, cm_bzipcode, cm_bcountry, cm_bprovince, cm_email, cm_phone, cm_cardtype, cm_cardnumber, cm_expmon, cm_expyear, cm_promocode, cm_description, cm_price) VALUES ('$PHPSESSID', '$cm_subtype', '$cm_sfirstname', '$cm_slastname', '$cm_saddress1', '$cm_saddress2', '$cm_scity', '$cm_sstate', '$cm_szipcode', '$cm_scountry', '$cm_sprovince', '$cm_bfirstname', '$cm_blastname', '$cm_baddress1', '$cm_baddress2', '$cm_bcity', '$cm_bstate', '$cm_bzipcode', '$cm_bcountry', '$cm_bprovince', '$cm_email', '$cm_phone', '$cm_cardtype', '$cm_cardnumber', '$cm_expmon', '$cm_expyear', '$cm_promocode', '$cm_description', '$cm_price')"; $insert_sub_result= mysql_query($insert_sub) OR die(mysql_error()); header("Location: cart.php"); exit; ?> Then the cart displays the results in a table... the problem is when I select any radio button, it comes out wrong, most of the time it reads 1 year Canadian Sub $35.00... I did this on Mac Safari and Firefox with the same result, and the database is receiving the same data, it isn't a cache thing. Like I select the radio button for cm_subtype="usa1" and the price should be $23.97 and cm_description should be USA 1 year Subscription or whatever, but it is displaying $35.00 and 1 year Canadian Subscriotion
  6. Don't be shy! I need help here!
  7. mysql_affected_rows() just returns an integer count right? It doesn't / cannot specify which records changed? I guess if you wanted to keep the old data and new, you could append the old data with the new, and then cut the old and new apart, and display them separately.
  8. That's what I wanted to know, Ill just update all. Just wondering if there was a built in function to test for changes. Guess not.
  9. Now, how would you pass the value to the header redirect after an UPDATE, because that does not generate an auto-increment value, thus results in a value of 0. I need to redirect the user back to the Customer Details page using $_GET and the userid in the URL... but once the UPDATE has been ran, the $_GET value of $_GET['$cm_id']; seems to go null. See code and note in red. [pre] <?php // Makes initial connection to database define ('DB_USER', '***********'); define ('DB_PASSWORD', '******'); define ('DB_HOST', 'localhost'); define ('DB_NAME', '***********); $connect = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die('215 Our database is currently down for updates, please check back later.'); // or die(mysql_error()); $db = @mysql_select_db(DB_NAME, $connect) or die('216 Our database is currently down for updates, please check back later.'); // Aquires data source from form $cm_id = mysql_real_escape_string($_POST['cm_id']); $cm_company = mysql_real_escape_string($_POST['cm_company']); $cm_phone = mysql_real_escape_string($_POST['cm_phone']); $cm_email = mysql_real_escape_string($_POST['cm_email']); $cm_firstname = mysql_real_escape_string($_POST['cm_firstname']); $cm_lastname = mysql_real_escape_string($_POST['cm_lastname']); $cm_address1 = mysql_real_escape_string($_POST['cm_address1']); $cm_address2 = mysql_real_escape_string($_POST['cm_address2']); $cm_city = mysql_real_escape_string($_POST['cm_city']); $cm_state = mysql_real_escape_string($_POST['cm_state']); $cm_zipcode = mysql_real_escape_string($_POST['cm_zipcode']); $cm_country = mysql_real_escape_string($_POST['cm_country']); $cm_subtype = mysql_real_escape_string($_POST['cm_subtype']); $cm_source = mysql_real_escape_string($_POST['cm_source']); $cm_payment = mysql_real_escape_string($_POST['cm_payment']); $cm_code = mysql_real_escape_string($_POST['cm_code']); $cm_startissue = mysql_real_escape_string($_POST['cm_startissue']); $cm_endissue = mysql_real_escape_string($_POST['cm_endissue']); $cm_status = mysql_real_escape_string($_POST['cm_status']); $cm_notes = mysql_real_escape_string($_POST['cm_notes']); // Updates database $updateSubscriber = "UPDATE subscriber_data SET cm_company = '$cm_company', cm_phone = '$cm_phone', cm_email = '$cm_email', cm_firstname = '$cm_firstname', cm_lastname = '$cm_lastname', cm_address1 = '$cm_address1', cm_address2 = '$cm_address2', cm_city = '$cm_city', cm_state = '$cm_state', cm_zipcode = '$cm_zipcode', cm_country = '$cm_country', cm_subtype = '$cm_subtype', cm_source = '$cm_source', cm_payment = '$cm_payment', cm_code = '$cm_code', cm_startissue = '$cm_startissue', cm_endissue = '$cm_endissue', cm_status = '$cm_status' WHERE cm_id = '$cm_id'"; $updateSubscriber_result= mysql_query($updateSubscriber) OR die('QUERY ERROR:<br />' .$updateSubscriber. '<br />' .mysql_error()); header("Location: cm_subscriber_detail.php?cm_id=$cm_id"); <-- How do I get the value of $cm_id into this string? exit; ?> [/pre]
  10. There's no edit post function on these forums? Got it: $cm_id = mysql_insert_id(); header("Location: cm_subscriber_detail.php?cm_id=$cm_id"); exit; ?>
  11. I have an html form that is populated from my database so that users can change their data. What is the correct syntax to do an UPDATE query and only change the variables that the user updated, leaving the rest alone? Do you just UPDATE * and just overwrite the unchanged variables with the same value, or is there a cleaner way to pull this off?
  12. What is the syntax on that, i.e. where does it go. I cannot find any info on this.
  13. I have an INSERT that puts values into mt database, and a variable, a userid, is created by auto increment. Is it possible to do the insert, and then immediatly do a SELECT on the same page, to pull that userid out? What I have is echoing an empty variable, any advise? Why does this echo to getsubscriber_script.php?cm_id= with no value? [pre] // Aquires data source from form $cm_company = mysql_real_escape_string($_POST['cm_company']); $cm_email = mysql_real_escape_string($_POST['cm_email']); // Inserts data into database $addSubscriber = "INSERT INTO subscriber_data (company, email) VALUES ('$company', '$email')"; $addSubscriber_result= mysql_query($addSubscriber) OR die('QUERY ERROR:<br />' .$addSubscriber. '<br />' .mysql_error()); // Retreives data from database $getDetails = "(SELECT userid FROM subscriber_data WHERE email = '$cm_email')"; $getDetails_result = mysql_query($getDetails) OR die(mysql_error()); while ($row = mysql_fetch_array($getDetails)) { $userid = $row["userid"]; } // Routes user to details header("Location: getsubscriber_script.php?cm_id=$cm_id"); exit; ?> [/pre]
  14. I have a simple search form where the user can enter a word. It is just an html page that has one text box and one submit button. It uses POST to send the word to the next page. My problem is that when I echo the results to a blank html page, with no formatting or tables, all the data shows up. But when I echo the same exact code to my page that has tables, only one of the two values show up. My query is as follows: [pre] $findsubscriber = "(SELECT cm_firstname, cm_status FROM subscriber_data WHERE cm_firstname = '$cm_subsearchterm')"; $findsubscriber_result= mysql_query($findsubscriber) OR die('QUERY ERROR: (mysql_error())); [/pre] and here is my display code: [pre] <? while ($row = mysql_fetch_array($findsubscriber_result)) { $cm_firstname = $row["cm_firstname"]; $cm_status = $row["cm_status"]; echo" Name: $cm_firstname<br/> Status: $cm_status<br/> "; } ?> [/pre] The result is: Name: Status: Active There is never a value for Name: - however if I just echo this to a blank white html page it shows up. That value cannot be empty or null, the form alerts you to enter it when adding a record. Could it be my style sheet eating my code? What in the heck is eating my data? My entire page code is below: [pre] <!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" /> <title></title> <link rel="stylesheet" href="pimpstyle.css" type="text/css" media="screen" /> </head> <body> <div class="container"> <div class="header"></div> <div class="main_right"> <div class="padded"> <div class="subnav"> </div> </div> </div> <div class="subnav1"> <br/><br/><br/> <div class="subnav3"> </div> </div> <div class="main" background: #dcdcdc;> <div class="formpadded"> <table width="480" height="200" bgcolor="#dcdcdc" cellpadding="0" cellspacing="0" align="left" valign="bottom" border="0"> <tr height="10"> <td colspan="3" height="30" bgcolor="#dcdcdc"> </td> </tr> <?php // Makes initial conection to database define ('DB_USER', '********'); define ('DB_PASSWORD', '********); define ('DB_HOST', '********'); define ('DB_NAME', '********'); $connect = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die('Our database is currently down for updates, please check back later.'); $db = @mysql_select_db(DB_NAME, $connect) or die('Our database is currently down for updates, please check back later.'); // Aquires data source from form $cm_subsearchterm = $_POST['cm_subsearchterm']; // Selects data from the database $findsubscriber = "(SELECT cm_firstname, cm_status FROM subscriber_data WHERE cm_firstname = '$cm_subsearchterm')"; $findsubscriber_result= mysql_query($findsubscriber) OR die('QUERY ERROR:<br />' .$buy. '<br />' .mysql_error()); ?> <? while ($row = mysql_fetch_array($findsubscriber_result)) { $cm_lastname = $row["cm_firstname"]; $cm_status = $row["cm_status"]; echo" Name: $cm_firstname<br/> Status: $cm_status<br/> "; } ?> </table> </div> </div> <div class="clearer"><span></span></div> <div class="footer"> </div> </div> </body> </html> [/pre]
  15. I have thought about that. This is a subscriber database that my customer service people will use hundreds of times per day. Either someone calls to subscribe to the magazine and they enter a new subscriber (that code is done) or search an existing subscriber for a renewal, address change or other reason. How would sessions effect multiple searches back to back, as far as ending one session and starting another w/o closing the browser? I guess kill all sessions when you go to the search page again, but then you have multiple people on the same IP too... sessions are started by each browser though, so that might work, I just don't want to store data in another database, how do you store data in a session w/o putting it in db fields?
  16. That works (sorta) - is there no way to submit them via the POST or RESPONSE methods w/o showing them in the URL? Only reason is this is a subscriber database meant to be accessible from on the road and we don't want to leave people's names and addresses in the URL cache. But if I were to use this, I run into a problem. When I push the data out to a blank white page, it shows up correctly with the GET method. However when I put it into my page template, it only shows the second variable value. Here is my code: HTML Form [pre] html code <form action="cm_findsubscriber.php" method="post" name="cm_subsearch"> <input type="text" size="20" name="cm_subsearchterm"> <br/> <input type="submit" value="submit" name="cm_subsearchbutton"> </form> html code [/pre] Which is passed to a search script [pre] <?php // Makes initial connection to database define ('DB_USER', '*****'); define ('DB_PASSWORD', '*****'); define ('DB_HOST', '*****'); define ('DB_NAME', '*****'); $connect = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die('Our database is currently down for updates, please check back later.'); $db = @mysql_select_db(DB_NAME, $connect) or die('Our database is currently down for updates, please check back later.'); // Aquires data source from form $cm_subsearchterm = $_POST['cm_subsearchterm']; // Selects data from the database $findsubscriber = "(SELECT cm_firstname, cm_status FROM subscriber_data WHERE cm_firstname = '$cm_subsearchterm')"; $findsubscriber_result= mysql_query($findsubscriber) OR die('QUERY ERROR:<br />' .$buy. '<br />' .mysql_error()); while ($row = mysql_fetch_array($findsubscriber_result)) { $cm_firstname = $row["cm_firstname"]; $cm_status = $row["cm_status"]; } header("Location: http://www.mydomain.com/wordpress/?page_id=50?firstname=$cm_firstname&status=$cm_status"); exit; ?> [/pre] Which passes it back to the display page [pre] <?php /* Template Name: _subsdb_displayresults */ ?> <?php get_header(); ?> <div class="main_right"> <?php include (TEMPLATEPATH.'/cs_right.php') ?> </div> <?php include (TEMPLATEPATH.'/_subsdb_sidebar.php') ?> <div class="main"> <div class="formpadded"> <table width="480" height="200" bgcolor="#dcdcdc" cellpadding="0" cellspacing="0" align="left" valign="bottom" border="0"> <tr> <td colspan="4"> <table width="448" cellpadding="0" cellspacing="0" align="left" valign="top" border="0"> <tr> <td width="20" bgcolor="#dcdcdc"></td> <td width="240" bgcolor="#dcdcdc"> <?php echo $_GET["firstname"]; ?><br /> <?php echo $_GET["status"]; ?><br /> whiskey </td> <td width="188" bgcolor="#dcdcdc"> </td> </tr> </table> </td> </tr> <tr height="10"> <td colspan="4" height="60" bgcolor="#dcdcdc"> </td> </tr> </table> </form> </div> </div> <div class="clearer"><span></span></div> <?php get_footer(); ?> </div> </body> </html> [/pre] and the result is: Active whiskey Where 'Active' is the status of the name I searched and whiskey is the text I added as a marker. Where's the name value for $firstname? The value in the db is not null or empty, it shows up as 'Tim' when I push this to a blank page and not my template. I know it is a round about way of passing data but there is a reason behind my madness. I cannot connect to a databae directly from my blog, too many errors with mysql_close() and all that, so I keep the database code on script pages and the results on the template pages. Anyhow, is there a syntax error in passing my variables thru the URL, or in the delivery with the $_GET syntax? Ideas?
  17. I guess not. Here is what I have: How do I pass $cm_firstname and $cm_status to cm_display_subscriber.php? [pre]<?php // Makes initial conection to database define ('DB_USER', '****'); define ('DB_PASSWORD', '****'); define ('DB_HOST', '****'); define ('DB_NAME', '****); $connect = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die('Our database is currently down for updates, please check back later.'); $db = @mysql_select_db(DB_NAME, $connect) or die('Our database is currently down for updates, please check back later.'); // Aquires data source from form $cm_search = $_POST['cm_search']; // Selects data from the database $findsubscriber = "(SELECT cm_firstname, cm_status FROM subscriber_data WHERE cm_firstname = '$cm_search')"; $findsubscriber_result= mysql_query($findsubscriber) OR die('QUERY ERROR:<br />' .$buy. '<br />' .mysql_error()); while ($row = mysql_fetch_array($findsubscriber_result)) { $cm_firstname = $row["cm_firstname"]; $cm_status = $row["cm_status"]; } header("Location: cm_displaysubscriber.php"); exit; ?> [/pre]
  18. I know how do hidden fields but how do you pass them to the next page w/o a submit button? If I do a header redirect and exit at th end of the page, will it pass the data along with it?
  19. So the search function here was NO help... I run a magazine and we want to move away from the database software we use and build our own. I am almost done but I ran into one road block: We use Wordpress as the template for our website although it isn't all blog, we use many of the static pages. Anyhow, I have a search page that allows you to search the database but I cannot put the SELECT statement right on that page, it has to be in a separate file. So I take the search form and pass that data to a SELECT statement on the next page with POST method, but how do I then pass the results on to a third page where I can display them? Because we use templates, the scripts have to live at the root and data needs passed to the correct template file. So... Page 1 (search) --> Page 2 (script, no page) --> page 3 (results, html display) How do I pass data from a script to another page w/o a form showing up to the user?
  20. I don't like sloppy url's... the entire site is done using forms, and I still am curious what the space issue is here? Even when I get the icons to line up the <TR> is still 10. times the ight it should be
  21. Does an html form have an inherent line break built in and if so, how do I escape it?
  22. actually I do have some hidden fields that are being passed; they just were not in my code snippet. I cannot use just an ahref because I cannot pass php variables that way. <td width=\"10\" height=\"20\" align=\"left\" valign=\"top\"> <form name=\"rem_one_item\" method=\"post\" action=\"rem_one_item.php\"> <input type=\"hidden\" name=\"productid\" value=\"$productid\"> <input type=\"hidden\" name=\"qty\" value=\"$qty\"> <input type=\"image\" name=\"minusmark\" src=\"images/main/minus.jpg\"> </form> </td>
  23. Okay so I added a form style to the external style sheet and this is what I get, a little better: form { border: 0px; padding: 0px; } [img]http://www.timbercrawler.com/tim/screenshots/sc_stillnotok.jpg[/img]
  24. This is a simple html question. I am using images as form elements but when I do, it wigs out my table spacing. I guess I can use DIV tags but I am curious to solve this with html tables. My code with forms: [pre] echo " <tr> <td width=\"20\" height=\"20\" align=\"left\" valign=\"middle\"><font class=\"cart\">&nbsp;&nbsp;($qty)</font></td> <td width=\"180\" height=\"20\" align=\"left\" valign=\"middle\"><font class=\"cart\">&nbsp;&nbsp;$description</font></td> <td width=\"70\" height=\"20\" align=\"right\" valign=\"middle\"><font class=\"cart\">$itemtotal</font></td> <td width=\"25\" height=\"20\" align=\"right\" valign=\"middle\"> [color=red]<form name=\"add_one_item\" method=\"post\" action=\"add_one_item.php\"> <input type=\"image\" name=\"plusmark\" src=\"images/main/plus.jpg\"> </form>[/color] </td> <td width=\"25\" height=\"20\" align=\"left\" valign=\"middle\">&nbsp;&nbsp [color=red]<form name=\"rem_one_item\" method=\"post\" action=\"rem_one_item.php\"> <input type=\"image\" name=\"minusmark\" src=\"images/main/minus.jpg\"> </form>[/color] </td> </tr> "; } echo " <tr> <td width=\"320\" height=\"6\" bgcolor=\"#639B38\" colspan=\"5\"></td> </tr> <tr> <td width=\"320\" height=\"1\" bgcolor=\"#000000\" colspan=\"5\"></td> </tr>[/pre] Here is what it looks like when there are no forms, just unlinked images (the "+" and "-" are small jpgs): [img]http://www.timbercrawler.com/tim/screenshots/sc_ok.jpg[/img] And here is it when I insert the forms: [img]http://www.timbercrawler.com/tim/screenshots/sc_notok.jpg[/img] Any ideas what I can do to bring it all back in line?
×
×
  • 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.