genista Posted February 16, 2007 Share Posted February 16, 2007 Hi all, I have some html that is dependant on certain criteria being met, ie if the supplier does a particular service then the html should give a text box for the supplier to update how much that service costs. The first problem I have is that the html I below does not work - it displays but whatever value I enter does not get submitted to the insert into database query. However, when I have set up the text box as static html below my php it works fine, telling me it is a problem with the way it is written: if (($facials == "true")){ echo "<p>Your price for service1 is: £'$service1price' use this field to update your price:</p><p><input type=\"text\" name=\"service1price\" value=\"\" maxlength=\"25\"></p>"; } else{ echo "<br>You do not offer service 1<br/>"; The static html looks like so: <input type="text" name="facialsprice" value="" maxlength="25"> problem 2 is the fact that I will need to echo the value for service1price in the html, otherwise when the user submits without a value in there it will update the database with empty data, wiping out any price they have entered previously. How can I echo php within html that is rendered in php? Thanks, G Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 16, 2007 Share Posted February 16, 2007 where is $facials set? if you have 'facialsprice' in your html.... Quote Link to comment Share on other sites More sharing options...
genista Posted February 16, 2007 Author Share Posted February 16, 2007 Sorry my mistake, facialsprice is another one of the options it should read service1price. Apologies again, G Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.