|
That doesn't look like a question, unless you count the "why clients prefer magento" line, which isn't really something we can answer.
Rants about "why insert technology here sucks" belong in the Lounge.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Its not a Rant. I have explained how magento works.
If you have worked on magento, you will understand what i am saying is true.
|
|
|
|
|
It's still not a question, though.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Magento and other shopping carts are there to make developing ecommerce applications easier and reduce development time. I have recently developed an ecommerce website from scratch and I can tell you its not easy. Not because the programming is hard but there is a lot of consideration and planning involved not to mention hours of testing.
|
|
|
|
|
The html designer is giving me html templates and i should add php code to it.
Both PHP and html are mixing up and becoming very ugly.
Hard to maintain or make changes in the future.
How to format properly?
I know Template engines, but i think it adds additional complexity.
|
|
|
|
|
By definition PHP and HTML should be mixed - that's the way PHP works. However the level of the mixing is up to you (or your template), you are the one who have to define what code is necessary to be in the HTML and what can be sit in pure PHP modules and called by the proper code from the HTML.
It's not clear from your question what HTML designer messing with your code, but in any case you can go for total control using some pure text editor ...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
This is to expand upon the previously given answer. Yes, HTML and PHP are mixed but there are methods you can follow to split design from content which is usually the way to go whether you are doing all of the site development and then maintaining it yourself or if you're developing the site to be handed over to content people.
Here is a VERY simple/rough sample of how I try to achieve this myself:
<?php include "modules.php >
<html>
<head>
<title>My Title</title>
<!-- link to external css file to control the layout/design of DIVs
</head>
<body>
<div class="menu_column">
<?php user_menu(); >
</div>
<div class="content_column">
<!-- content writer: Please enter all of your content in the section below -->
<!-- End Content Section -->
</div>
</body>
</html>
Note: I had to remove the closing PHP tags in the example because it was messing up the rest of the entire post.
Now this is the PHP page which you would give to whomever handles the content of each page. They can just keep making copies of the file and name them how they wish to create the multiple pages that make up the site. Now you have:
MODULES.php
<?php
function user_menu() {
echo '
<!-- the PHP and HTML code that would make up your user menu which will then be
printed to the very spot where you called the function -->
';
}
?>
In some of my sites I have membership service. If the visitor is not logged into the site, the user_menu function will print out the HTML to create the login form. If they have an account and are logged in then the user_menu function will print a table of links involving their account. All of the checking whether or not someone is logged in is handled in the function located in modules.php.
Now, you could do this as many times as is necessary throughout your php files. Just tell the content manager to not touch anything around/within the PHP tags. This will GREATLY minimize the amount of code that you want the PHP interpretor to process being shown within each physical PHP file that someone else will be working with.
This is something of a cheap templating system. If you have PHP modules that do not print anything out to the browser then it isn't as important where you place the function calls amongst the HTML tags. But this will give you more solid control over placement of HTML elements/objects that are created by your PHP.
I believe that it is the easiest and most efficient way to separate design/content from program code without having to try to use a full-blown templating engine which would just create more headaches if you really do not need the kind of 'power' that SMARTY and other engines offer.
I hope this was not too difficult to understand and that it helps at least a bit.
|
|
|
|
|
Hi,
You have to move on to the next level, a framework. I can recommend you take a look at CodeIgniter framework or Smarty. Simple, fast and robust for small and medium complexity apps. For enterprise I would go with Zend framework.
|
|
|
|
|
is it possible to make INSERT all checkbox values into database when there is not even one checkbox being checked since im using array_diff as shown below?
my problem currently facing is,
when there is a checkbox being checked, it will insert into checked_table and the remainder options which did not selected will insert into unchecked_table.
howewer, when all checkbox didnt being selected, and click on submit button, the value didnt send to my database unchecked_table.
<pre lang="PHP"><?php
include('connect.php');
$checked = ($_POST['date']);
$unchecked = ($_POST['nondate']);
$diff = array_diff($unchecked,$checked);
if(isset($_POST['date']))
{
foreach ($_POST['date'] as $dateValue)
{
$insert="INSERT INTO checked_table ($colm_ladate) VALUES ('$dateValue')";
mysql_query($insert);
}
echo header("location:home.php");
}
if (isset($_POST['nondate']))
{
foreach ($diff as $dateValue2)
{
$insert2="INSERT INTO unchecked_table($colm_lrdate) VALUES ('$dateValue2')";
mysql_query($insert2);
}
echo header("location:home.php");
}
?>
|
|
|
|
|
how to create invoices in PHP?
|
|
|
|
|
|
but here I was a beginner, who just understand the basic of PHP
|
|
|
|
|
Then go and buy a book and study it, or find some online courses. It is not possible to provide an answer to such a broad question.
|
|
|
|
|
I Need to create this XML using PHP:
<con:ContractOptions>
<con:ContractOption>
<con:Id>49</con:Id>
<con:Description>Diesel/Turbo</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>150.00</con:NetCost>
</con:ContractOption>
<con:ContractOption>
<con:Id>50</con:Id>
<con:Description>AWD/4WD</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>100.00/con:NetCost>
</con:ContractOption>
<con:ContractOption>
<con:Id>51</con:Id>
<con:Description>Commercial Vehicle</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>75.00</con:NetCost>
</con:ContractOption>
</con:ContractOptions>
Here is the section of my PHP code to build that XML:
$ContractOptionFields = array(
"con:Id" => $OptionId,
"con:Description" => $Surcharge_Description,
"con:IsSurcharge" => $IsSurcharge,
"con:NetCost" => $OPTION_NetRate
);
$ContractOptions = array(
"con:ContractOption" => new SoapVar($ContractOptionFields, SOAP_ENC_OBJECT)
);
$arcontract = array(
"con:ContractOptions" => new SoapVar($ContractOptions, SOAP_ENC_OBJECT), ...
My code will only produce one set of contract options like this:
<con:ContractOptions>
<con:ContractOption>
<con:Id>49</con:Id>
<con:Description>Diesel/Turbo</con:Description>
<con:IsSurcharge>false</con:IsSurcharge>
<con:NetCost>150.00</con:NetCost>
</con:ContractOption>
</con:ContractOptions>
How do I build more than one option into this XML using my PHP code sample? Do I need to use a PHP for Loop? Not sure how to set this up.
Thanks for your assistance.
|
|
|
|
|
what,s the new app today that demanded using php....????
|
|
|
|
|
|
how to work on chat app by using php........plz tell the coding
|
|
|
|
|
Please do your own research, Google will find you many samples.
|
|
|
|
|
Dear All,
I have already json file that have data EmpCode and EmpName. But how can I show the data in text box on my web page.Please help me.Here are my code.
<pre lang="text">
<html>
<head>
<title>Employee</title>
<?php
function getemployee()
{
$url = "http://localhost/1004.json";
$json = file_get_contents($url);
$data=json_decode($json, TRUE);
return $data;
}
?>
</head>
<body>
<form method="post">
Emp Code:<input type=text name="text1" />
<br>
Emp Name:<input type=text name="text2" />
<br>
<input type="submit" onclick="'<?php' getemployee(); '?>'" value="Get"/>
</form>
</body>
</html>
</pre>
|
|
|
|
|
<input type="text" name="text2" value="<?
echo $json = getemployee();
$json->var
?>"/>
obj is your Variable name
use print_r(getemployee()) view json Structure;
|
|
|
|
|
Dear All,
I'm a win app programmer but a very fresher in web. Now I have to do with web, so I am studying in web with PHP. I have to figure out the problem that I want to show data from Sql Database on PHP web page via web service by generating JSON file. I don't use the internet. All are in local only. I create web page two text box and one button. I type 01 employee code in textbox1 and click the button to get employee name from sql db. There are function in web services. When the button click, PHP page will send 01 to web service and then the function in web service will get the emp name from sql db and returns json file and finally PHP page will be read json file and show emp name in textbox2. So I can't control one round procedure PHP, Web Service, JSON and Sql db. Please help me. Very thanks everyone. I hope with great wish for that. Please.
Thanks you all
|
|
|
|
|
use function to send response to browser in json format or just echo response array in json
public function send_response($response_data){
//$resonse_date is of array type
echo json_encode($response_data);
}
catch json response in ajax callback for success .
$.ajax({
url: 'php service call' ,
type : 'POST',// type of call GET ,POST
data : JSON.stringify(params),//pramas array
success :function(data) {//call back functin
//reponse data in json format
//put here your logic
},
error : function(data){alert('if any error');}
});
|
|
|
|
|
I m installed sqlserver for my final project... i wanot installed properly.. i uninstalled it.. no i m installng it again but getting the following error when i click on the icon of "SQL Server Management Studio Express".. plz help me.. i would be very thnkful to you.
"The automatically saved settings file ' C:\Users\Bilal\Documents\ SQL Server
Management Studio Expres\Settings\CurrentSettings-2014-06-18.vssettings' cannot be found.You can change this file on the 'Import and Export Settings' Tools Options Page. the IDE will use the most recent settings for this session."
|
|
|
|
|
Hi,
f anyone tried a PHP framework, which you'll recommend please?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|