Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,208,877 members, 8,004,168 topics. Date: Saturday, 16 November 2024 at 09:59 AM

Coldfusion Vs Php Code Battle - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Coldfusion Vs Php Code Battle (2086 Views)

Pls Help Me With This Php Code / Help On Php Code For A Dice Game / Help With This Php Code. (2) (3) (4)

(1) (Reply) (Go Down)

Coldfusion Vs Php Code Battle by naijafan(m): 2:34pm On Feb 16, 2007
Here, calling on all ColdFusion and PHP gurus out there to do write a piece of code that performs the same functionality in either language so we can judge which is more readable and optimized.

Let the battle begin!
Re: Coldfusion Vs Php Code Battle by boraddo(m): 2:43pm On Feb 16, 2007
lets start simple!

to read from a database in CF, the users table

<cfquery name="getUsers" datasource="#dsn#">
select * from users order by firstname asc
</cfquery>
<cfdump var=#getUsers# >
Re: Coldfusion Vs Php Code Battle by breeolan(f): 2:55pm On Feb 16, 2007
haba, your being too high, am sure this level is ok for beginners lke me, you will have to use this to get a list of employees from the database

<cfquery name=”GetEmployees” datasource=”#Request.MainDSN#”>
SELECT c.CompanyName,e.SSN,e.Firstname,e.Lastname,e.Salary,e.DateOfBirth
FROM Employee e INNER JOIN Company c
ON e.CompanyID = c.CompanyID
ORDER BY c.CompanyName,e.Lastname,e.Firstname
</cfquery>
<cfoutput>#getemloyees.companyname# </cfoutput>
Re: Coldfusion Vs Php Code Battle by naijafan(m): 3:04pm On Feb 16, 2007
@breeolan

after getting the list, what will we do with the variable? try to output it. and please enclose your codes in withing the code tag.
Re: Coldfusion Vs Php Code Battle by yommie07: 2:02pm On Feb 21, 2007
the battle between coldfusion and Php cant hold in a forum take it to real world with real problems and let see what you both can do.
Re: Coldfusion Vs Php Code Battle by skima(m): 5:04pm On Feb 21, 2007
Simple php mail function :

<?php

mail("test@example.com","Hello world","This is a mail from php mail function simple?"wink;

?>
Re: Coldfusion Vs Php Code Battle by alexis(m): 7:43pm On Feb 21, 2007
coldfusion hides alot of things from you, it does alot for you at the background. PHP let's you control everything; that is where the power lies.

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>


boraddo,

How did you create your datasource?
Re: Coldfusion Vs Php Code Battle by skima(m): 7:53pm On Feb 21, 2007
Dats even more complex,
How do u send mail in cfm?

The mail function drew me from asp to php!
Re: Coldfusion Vs Php Code Battle by boraddo(m): 9:40am On Feb 22, 2007
sending a mail in CF is this simple
  <cfmail to = "***@nairaland.com"  from = "anybody"  subject = "helloworld">
            This is a mail from coldfusion
   </cfmail>
Re: Coldfusion Vs Php Code Battle by naijafan(m): 9:44am On Feb 22, 2007
plain text mails:


<cfmail from="user@nairaland.com" to="user@nairaland" subject="Test Mail" server="nairaland.com" username="admin" password="admin">
this is how to send a plain text mail in coldfusion
</cfmail>


html mails:



<cfsavecontent variable="htmail">

<!--- html tags and stuff goes here--->

</cfsavecontent>

<cfmail from="xolubi@yahoo.com" to="xolubi@yahoo.com" subject="Test Mail" server="nairaland.com" username="admin" password="admin" type="html">
             <!--- reference the saved variable --->
             #htmail#
</cfmail>


plain simple
Re: Coldfusion Vs Php Code Battle by boraddo(m): 9:55am On Feb 22, 2007
file upload in CF

<cffile action = "upload"   fileField = "FileContents"   destination = "c:\files\upload\"     nameConflict = "MakeUnique">

how do you do that in PHP 
Re: Coldfusion Vs Php Code Battle by naijafan(m): 12:24pm On Feb 22, 2007
major advantage of administrator controlled DSNs

ColdFusion supports different database types out there (almost all of 'em out there). You can create your database in any of these and reference it via a datasource name set in the ColdFusion Administrator. Just in case you need to change your your database platform or something, this change will just require changing where the DSN is pointing to in the CF Administrator and no change at all in your code. Beat that?!
Re: Coldfusion Vs Php Code Battle by penyng: 7:46am On Feb 24, 2007
creating a simple flash form in coldfusion

<cfform format="flash" width="200" height="150">
<cfinput type="text" name="fahrenheit" label="Fahrenheit" width="100"
value="68">
<cfinput type="text" name="celsius" label="Celsius" width="100">
<cfinput type="button" name="convert" value="Convert" width="100"
onClick="celsius.text = Math.round((farenheit.text-32)/1.8*10)/10">
</cfform>
Re: Coldfusion Vs Php Code Battle by adzcqe: 9:20am On Nov 01, 2010
coldfusion hides alot of things from you, it does alot for you at the background. PHP let's you control everything; that is where the power lies.

You have the full functionality of all java components at your finger tips.
coldfusion can run java code live and direct

and why do you want to make your life complex?
Re: Coldfusion Vs Php Code Battle by binkabir(m): 10:38am On Nov 01, 2010
writing different code will not help those who are learning

i will prefer that the moderator to select some very important real life application components (eg, authenication, SEO, OOP, security etc, ) then every programmer will submit he/her code that can implement that concept.
that will be more useful to all

thanks kiss kiss
Re: Coldfusion Vs Php Code Battle by candylips(m): 11:29am On Nov 01, 2010
Quick question is it possible to run a cold fusion or php code in debug mode from an IDE ?
Re: Coldfusion Vs Php Code Battle by Jcomtech: 12:05pm On Nov 01, 2010
I luv this topic.
Am begining to like cf.
Re: Coldfusion Vs Php Code Battle by instinctg(m): 4:24pm On Nov 01, 2010
i have seen the both sides (CF & PHP) and voile CF reigns! more object oriented (components based), easier learning curve and faster development time. drawback of ColdFusion is that its not open-source and quite unpopular in this part of the world.
Re: Coldfusion Vs Php Code Battle by Jcomtech: 5:16pm On Nov 01, 2010
Pls i like to learn coldfusion.
Any help?
Re: Coldfusion Vs Php Code Battle by Nobody: 9:17pm On Nov 01, 2010
I don't think Coldfusion is still in use, i thought it was Flex that took over Coldfusion now,
Re: Coldfusion Vs Php Code Battle by Mobinga: 12:26am On Nov 02, 2010
Re: Coldfusion Vs Php Code Battle by Youngichou(m): 5:37am On Nov 02, 2010
boraddo:

file upload in CF

<cffile action = "upload"   fileField = "FileContents"   destination = "c:\files\upload\"     nameConflict = "MakeUnique">

how do you do that in PHP 


this is it
<?php

$file=$_FILES['uploadedfile']['name'];
if($_FILES['uploadedfile']['error'] =0){
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], "uploading-folder".$file)  }

(1) (Reply)

What Do You Do When Your Brain Gets Jammed While Coding / Java Programming & Android App Development Tutorials / Who Knows About Pypyodbc Or Pyodbc?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 22
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.