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
https://forums.phpfreaks.com/topic/38763-html-in-php-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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