|
When you POST variables, they are encapsulated in a $_POST array. Each value can be called by its key or $_POST['name of field']. In your example, $_POST['selectedOption'] would contain an integer 1-4. For more information, you can take a look at:
http://www.w3schools.com/php/php_post.asp[^]
Good luck!
Ranjit Viswakumar
Professional Services Specialist
rviswakumar@hostmysite.com
HostMySite.com[^]
|
|
|
|
|
I notice its popular for some scientific and ai programming which perks my interest but I've never tried it and wikipedia and other sites are kind of vague about what it can do. So what can python do or do better than a language like vb.net or c#?
|
|
|
|
|
There are many great things about python, a few key points are:
1. well implemented internal data structures
2. great brevity of code - constructs like list comprehensions allow very concise and easy to read code
3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want)
4. it's interpreted and yet it is really fast
5. simple integration with C.
If you agree with the idea that the cost of development is directly linked to the number of lines of code (which there are a lot of studies to support) then Python is a winner. I would generally expect to be able to write a Python app in about 20% of the lines required for C#.
Python was designed as a teaching language and so it is very "pure" and orthogonal (ie no shortcuts to enhance performance). This makes it easy to learn and write and yet it is suprisingly fast when executing. For tight-loop, time critical sections it is easy to implement function in C that can be mapped in Python.
Some people prefer Ruby (which is sort-of an evolution of Python).... but especially in the case of Ruby-on-rails the performance tends to be very limiting.
Paul Coldrey
http://www.lumient.com.au/
|
|
|
|
|
Thanks for your reply, I'll have to look into it. I'm not sure what you mean by statement 3 though.
Paul Coldrey wrote: 3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want)
thanks,
Mike
|
|
|
|
|
Lots of languages have restrictions on certain types that stop you treating them as genuine objects. For example C# won't let you inherit an int or override any of its methods. The reason they do this is for speed because it means that for these "special" types they don't need to do any virtual function lookups. In Python everything is a "real" object. Hence when you say 1+1 Python goes off and does a virtual function lookup for the (int) + (int) function,... and you can override this function if you are insane. The clever thing is that because Guido knew this could be a performance issue he optimised the VF lookup really well and this is part of the reason why Python is so much faster than you would expect. All the VF lookups (And other object oriented overheads) are outrageously fast and they more than offset the extra calls that are required to keep the language clean. Obviously making 1+1 implement 1-1 is not a good idea,... however, suppose you want to count how many additions are happening in a given piece of code as an optimisation metric,.. in Python you can override '+' and add some code to count the number of times it is called. Sounds like a small thing,... but you would be surprised how many optimisation-based limitations there are in C# and some of them get really annoying when you are trying to write pretty mundane code.
Paul Coldrey
http://www.lumient.com.au/
|
|
|
|
|
I agree.
I would add that it has a LARGE library to chose from, so for many things, you don't need to write new components/libraries, but just find the one that fits.
Also, from my point of view (C++ programmer) Python is just fun to code in. Not sure why, but have noted others say the same thing.
-Mike
|
|
|
|
|
Some cool apps are written in Python -- Mozy backup, lots of the Google apps, Eve (if I remember right -- MMORPG space multiplayer game) and others.
Lots of neat libraries and such. Fun to program in.
As to what it can do better than vb.net or c#, not totally sure, but that would be like asking the same of any language. The answer will depend on what you think and like of any of the languages.
Check out Guido van Rossun's (creator of Python) site http://www.blogger.com/profile/12821714508588242516[^]">Python blogs "History of Python" and Neopythonic for some interesting insights from him.
-Mike
|
|
|
|
|
Python doesn't have a claim to fame.
Unlike the languages you referred to - C#, VB, and many others,
Python is a scripting language.
I know this site is primarily about Microsoft technologies, but Python isn't from Microsoft!
It's very easy to learn, and has a great many uses.
Projects than incorporate/written in Python:
mod_python (Apache's python module)
Sid Meier's Civilization IV
Gentoo's Portage package management system
Various NASA systems
A large percent of Google products and in-house systems
Youtube
Mercurial (Hg)
PyPy
and a great many others.
Enjoy!
|
|
|
|
|
Python is NOT 'just a scripting language' - It can be compiled just the same as any java program, you can have it interpreted or whatever you like. It can use c libraries and can even be embedded into c programs.
py2exe compiles windows python apps
freeze compiles the linux equiv
and py2app compiles the mac equiv.
|
|
|
|
|
i want information about kernel module programing, how to insert & compile own module in linux kernel? and i want code of address resolution protocol in linux
|
|
|
|
|
I am new to Linux platform, i want to know that,
From where i can get Dot Net Framework for Linux platform ? and how i can run my dot net programs on to the Linux platform ?
please guide me.
|
|
|
|
|
download mono from www.mono-project.com
here u get mono version which is a .net framework and can made program on it
|
|
|
|
|
|
I have been looking at the GRUB stage1 code and from this it seems that the BIOS Parameter Block in the MBR is populated with zeros. What actually populates the BPB with relevant data?
I am the handsome one in the crowd.
|
|
|
|
|
i have this perl code which is not working for some reason-
#!/usr/bin/perl
open(IN1, "< t1");
open(IN2, "< t");
open(out, "> bond_pad.tcl");
while (<in1>) {
if(/(.*)bp_(.*)/) {
chomp;
@array1=split(/ /);
print " first: $array1[0]\n";
while (<in2>) {
chomp;
if(/(.*)bp_(.*)/) {
@array2=split(/ /);
print " sec: @array2 $array2[3]\n";
while (($_=<in2>) !~ /(.*)echo_status(.*)/) {
if($array1[0] eq $array2[3]) {
if (/(.*)origin(.*)/) {
$_=~ s/(.*)origin(.*)/\1 origin $array1[1] $array1[2]/;
print ;
} else {
print ;
}
}
}
}
}
}
}
close (IN1);
where file t1 contains :
{"bp_left_2"} {-70 401}
{"bp_left_1"} {-70 321}
{"bp_left_0"} {-70 241}
and file t contains:
set obj [get_mark {"bp_left_0"} -all]
attribute $obj origin {38.000 269.000}
attribute $obj echo_status echo
set obj [get_mark {"bp_left_1"} -all]
attribute $obj origin {38.000 349.000}
attribute $obj echo_status echo
set obj [get_mark {"bp_left_2"} -all]
attribute $obj origin {-38.000 429.000}
attribute $obj echo_status echo
the code is changing numbers for one of the match and not for all matches in file t, plz help
|
|
|
|
|
Use code block when you post code.
Explain what the code does do when you run it.
Explain what you expect it to do.
|
|
|
|
|
#!/usr/bin/perl -w
open(IN1, "< t1") || die "oops t1 not found\n";
open(IN2, "< t") || die "oops t1 not found\n";
open(OUT, "> bond_pad.tcl") || die "oops bond_pad.tcl not found\n";
while (<IN1>) {
if(/(.*)bp_(.*)/) {
chomp;
@array1 = split(/ /);
print " first: $array1[0]\n";
while (<IN2>) {
chomp;
if(/(.*)bp_(.*)/) {
@array2 = split(/ /);
print " sec: @array2 $array2[3]\n";
while (($_ = <IN2>) !~ /(.*)echo_status(.*)/) {
if($array1[0] eq $array2[3]) {
if (/(.*)origin(.*)/) {
$_ =~ s/(.*)origin(.*)/$1 origin $array1[1] $array1[2]/;
print ;
} else {
print ;
}
}
}
}
}
}
}
close (IN1);
close (IN2);
close (OUT);
Produces the following output
cjts-imac-2:T cjt$ ./testperl
first: {"bp_left_2"}
sec: set obj [get_mark {"bp_left_0"} -all] {"bp_left_0"}
sec: set obj [get_mark {"bp_left_1"} -all] {"bp_left_1"}
sec: set obj [get_mark {"bp_left_2"} -all] {"bp_left_2"}
attribute $obj origin {-70 401}
first: {"bp_left_1"}
first: {"bp_left_0"}
cjts-imac-2:T cjt$
IS this what you want ??? as output ???
Thanks Guys/Girls
|
|
|
|
|
Hi there.
I used phpmailer[^]class to send mail in php on IIS on windows server
this is my code :
require("include/mailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = "me@communitymx.com";
$mail->FromName = "My Name";
$mail->AddAddress("mds_soft@yahoo.com");
$mail->Subject = "Test PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->Send();
echo $mail -> ErrorInfo;
But each time I just see this error : Could not instantiate mail function
How can I solve it ?
Thanks in advance.
|
|
|
|
|
I've got the answer by contact phpmailer group.
On IIS we have to use sth like this script for sending mail.
require("include/mailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = "me@communitymx.com";
$mail->FromName = "My Name";
$mail->AddAddress("mds_soft@yahoo.com");
$mail->Subject = "Test PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->Subject = "PHPMailer Test Subject via smtp";
$mail->Host = "mail.sth.com";
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Username = "smtp Username ";
$mail->Password = "smtp password";
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
Although these file are in /include/mailer/
class.smtp.php
class.phpmailer.php
class.pop3.php
|
|
|
|
|
Hi, i want to install pgadmin3 to fedora8
i have found this link
http://rpmfind.net/linux/RPM/fedora/updates/8/ppc/pgadmin3-1.8.4-1.fc8.ppc.html
Do i need to install all rpms there(required ones) or is there a way that i can install pgadmin3 with yum?
thanks...
|
|
|
|
|
Hello all.
I saw somewhere this function:
function char_cube3d(&$bitmaps, $letter)
{ ... }
What's the meaning of & sign ?
Thank you.
|
|
|
|
|
The parameter will be passed to the function by Reference. (the second parameter will be passed by Value)
|
|
|
|
|
|
Just as a side note...PHP 5+ always pass objects & arrays by reference so you don't need to use them if you are doing PHP5 development.
I'm finding the only constant in software development is change it self.
|
|
|
|
|