Archive for September, 2009
Programming Wich Language?
Ok im looking to get into programming. I want to make a basic text editor then maybe a game later in the future.
I know the basics of these langauges (if this helps)
HTML
CSS
Javascript
PHP
I want to get into programming like really bad.
Now what langauge should i learn? Pascal looks easy like really easy. C++ is like huge though and notepad++ is written in it. C# is good becouse it runs on windows. But my goal is to make it compatible with linux mac and windows.
Thank you in Advance
Ok should i learn pascal or c++ ?????
Python would do u good for all these factors : It runs on any platform, cool, easy, and yet powerful
Download :
http://www.python.org/download/
Tutorials:
http://docs.python.org/tut/
PHP Programming Help….?
Hi,
I’m working on a project for my company. The guy who started on this project created a file called master.php which is the main file for the project.
In master.php, I see something like following within <?php and ?> tags:
eval(gzinflate(str_rot13(base64_decode("[ CODE ]"))));
Can someone please help me find out what "[ CODE ]" is? I want to convert "[ CODE ]" to actual PHP code so I can make changes.
The guy who created this file is no longer with company (fired).
I really appreciate your help.
Thank you,
eval(gzinflate(str_rot13(base64_decode( " [ CODE ] " ))));
Somewhere, a constant has been defined as "CODE" (can be anywhere on the server, but more likely included in another file).
Most likely, it contains some "bomb": a piece of code that gives him back-door access to your server, or worse, damages the existing code.
"eval" will EXECUTE the code, whatever is in it!
It may be harmless, or conditional: a way to keep some sort of control.
The code might say "If my backdoor access is cancelled, destroy the other file and the DB, otherwise, do nothing…"
(Some programmers use these bombs in their code: should the client refuse to pay their bill, the code is activated… It is illegal, unless specified in the contract!)
help me write the other operator php program using the if..else statement. the output is same like program bel
the output is same like program below.
I want to use all operator but one operator in 1 program
<?
for ($i = 0; $i < 10; $i++) {
if (($i % 2) == 0) {
echo "Hello World<br />";
}
else
{
echo "Goodbye World<br />";
}
}
?>
You’ll need to clarify your question before anyone will be able to give you a meaningful answer.
java script or php?
i wanted to get into java programming
i have done core and advance java including jspl,servlet,ejb
(i am planning to learn (java script or phP)
please advice which will be better with their contrasting features)
also advise me for the study of sturts(ie of what importance it will be for me)
The two are not exactly comparable.
Javascript is an interpreted, client-side language (front end). All the code runs on the client side, and it is used mostly for User Interface features (the "J" in AJAX). Yahoo widgets are also written in a version of javascript, so you can learn it by writing widgets if you like.
PHP is a preprocessed language on the server side (back end), used primarily for fetching data from databases to display to the user. (The "P" in LAMP)
I would say since you already know some server-side code, go with the client-side javascript. Ultimately if you want to be a web developer, however, there’s a need for both front-end and back-end.
If you want to know which is in higher demand in your area, go to indeed.com or simplyhired.com and see how many job listings there are for each one. In my city, it’s 127 javascript vs. 98 php listings on indeed.com
PHP programming problem, Reading from text file!?
My .php file contains:
<?php
$f=fopen("welcome.txt","r") or exit("Unable to open file!");
while (!feof($f))
{
$x=fgetc($f);
If $x="<"
{
echo"oooooooooooooooooo";
}
echo $x;
}
fclose($f);
?>
and My welcome.txt file contains:
hello world
<title> its title </title>
When I run the php file in wamp, nothing happens, but If I remove the below part, it works!
If $x="<"
{
echo"oooooooooooooooooo";
}
But I dont want to remove this part, How can I fix it? Do you have the same problem?
Thank you
Your comparison statement is wrong.
The correct statement is:
If ($x=="<")
i need help with php programming, i want to build an online database program.?
i have already design the forms and the look and feel. I want the program to be able to generate the birthdays for the day based on the date column in the table and have a search engine to retrieve data based on criteria.
Hmm this question is too large for Yahoo Answers I think. My advice is go and buy a decent "learning PHP" type book, and spend a week or two learning from there. There’s quite a lot to learn and I think a book is still the best way to do so.
There are some learning PHP tutorials on the web if you dont want to spend any money, but books have advantages, ie you can read them while on the toilet etc
How do you make an algorithm in PHP?
How do you write a PHP program that randomly
generates a special hexadecimal string, like a proof of purchase?
You can use:
$my_id = dechex(rand());
// value: 6b90a1ea
If 8 hex digits (0 – 2147483647) is not enough for you, you can use it multiple times until your string is long enough:
$my_id = dechex(rand()) .dechex(rand()) . dechex(rand());
// value: 52d12463198342f5416b5a77
Hope that helps!
PHP programming problem? how to use mysql?
I have installed:
1- Windows XP
2- Wamp
3- Apache
4- MySQL
5- PHP
6- phpExpertEditor
When I run any php file in phpExpertEditor it works ok,
but when I try to connect php to mysql Im getting Error:
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\PHP Expert Editor\php3A.tmp on line 9
the php code is:
<html>
<body>
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
?>
</body>
</html>
I asked this question previously and someone said to check <Control Panel/Administrative Tools/Services> I checked it but mysql wasnt there.
=================================
my second question is that i can not run any php file (which is on my HardDisk) by my InternetExplorer !!
I have to upload them to my host (which supports php) and then only i can run them.
Is there any problem in Installation of PHP?
I didnt install Apache,Php,MySQL seperately!
I just installed WAMP which contains them, does it need any arrangement?
I could open file by my IE < http://localhost/test1.php > So i got the answer of my second question.
but still i cant run a php file which is trying to connect to mysql !? i get this error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘peter’@'localhost’ (using password: YES) in C:\wamp\www\bb.php on line 4
Could not connect: Access denied for user ‘peter’@'localhost’ (using password: YES)
and this is code of php file:
<html>
<body>
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
?>
</body>
</html>
It seems that problem is in connection of php to mysql, but i have activated mysql by wamp…
First, you should use mysql_pconnect, not mysql_connect, as mysql_pconnect is both recommended by Zend (the makers of PHP) and persists the connection for you, reducing load on the server.
Next, the user name and password you supply to connect to the MySQL database need to be the user name and password you assigned when creating the MySQL database. When you set up MySQL, you had to create a user and a password. Those are the values you should be supplying as arguments.
So, let’s assume the following is true of your MySQL installation:
1. You are running it under the localhost (probably true);
2. Your MySQL user name is peter;
3. Your MySQL password is password
In that case, this should work:
$con = mysql_pconnect( "localhost", "peter", "password" ) or die( mysql_error());
How can I get Java/PHP/MySQL programming job?
How can I get my foot on the door for Java programming job? Should I enroll to 1-2 years computer school just to get programming job?
Somebody suggest me to participate in the SourceForge.net Java project. Will the employer convince once I put the project in my resume? (After the completion of the project )
Enrolling in a school to get the required certificates would be the best option, this gives you actual qualifications for company’s to view, Major company’s will not look at you twice if you have no qualifications.
However if you are certain you have self taught yourself adequately you can try freelancing work, build yourself an on-line showcase to show off your works and talents search for a project on freelancing sites.
such sites are
www.freelancers.com or www.rentacoder.com
PHP programming?
write a program in php which can process the data from this HTML form. To convert a temperature in Fahrenheit to Celsius, 32 degrees need to be subtracted and the result needs to be multiplied with (5/9). For instance, 95 degrees Fahrenheit is 35 degrees in Celcius, and 20 degrees in Celcius is 68 degrees in Fahrenheit.
I cant really understand the guide from PHP user manual anyone can help me please
<?php
// This script has not been tested
$temp = $_REQUEST['temp'];
$units = $_REQUEST['units']; // multiple select for c or f
if ($units == ‘F’)
echo $temp .’ degrees F is equal to ‘. (($temp – 32)*(5/9)) .’ degrees C’;
if ($units == ‘C’)
echo $temp .’ degrees C is equal to ‘. ((9/5) * $temp + 32) .’ degrees F’;
?>