Jump to content

HTML in PHP problems


genista

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.