Posts Tagged ‘php programming’
Where can I find some PHP programming exercises?
In the few computer sciences classes I took (long ago), I really liked the fact that assignments built on one another, getting progressively more complex. I now want to learn PHP and MySQL, but I’m having a hard time finding a good set of programming exercises to work on in building my skills. Can anyone point me to some PHP/MySQL programming exercises (or a book that includes exercises) that start with the basics and work their way up?
Thanks!
Website content
I need Cake PHP programming help?
I have an online store where the users have a budget and if they checkout over their allowed budget they pay the rest by credit card. For some reason the function isn’t subtracting the budget money and the whole amount is getting forwarded to the credit card, even if they have budget money
I have posted the current code. I really appreciate any help!
if ($user['company_id'] == 47 && $user['current_budget'] > 0) {
echo $form->labelTag(‘Order/ApplyBudget’, ‘Apply remaining balance ($’.number_format($user['current_budget'], 2).’)');
echo $html->checkbox(‘Order/ApplyBudget’);
if ($user['current_budget'] > $grand_total) {
echo “
Because your budget balance is greater than the order total, your credit card will not be billed if you apply your budget.
\n”;
}
}
?>
| Payment Options | |||||
|---|---|---|---|---|---|
|
if ($payments['Company']['payment_invoice']) { $options['invoice'] = 'Invoice'; $default = array('value' => ‘invoice’); } else { $default = array(‘value’ => ‘creditcard’); } if ($payments['Company']['payment_cc']) { $options['creditcard'] = ‘Pay now with a credit card’; } echo $html->radio(‘Order/PaymentMethod’, $options, ‘ |
|||||
input(‘Order/total’, Array(‘type’=>’hidden’, ‘value’=> $grand_total + $tax + $shipping)); ?>
input(‘Order/tax’, Array(‘type’=>’hidden’, ‘value’=> $tax)); ?>
input(‘Order/shipping’, Array(‘type’=>’hidden’, ‘value’=> $shipping)); ?>
PHP Programming Problem ?
I get this error in this code:
Error:
Notice: Undefined index: do in C:\Documents and Settings\me\Desktop\php examp\php38.tmp on line 4
Code:
$do=$_GET['do'];
if ($do == 'send') {
$name= $_POST['name'];
$comments= $_POST['comments'];
$check= $_POST['check'];
$which= $_POST['which'];
$what= $_POST['what'];
} else { ?>
}
?>
Caffeinated Content
PHP Programming: Reading file or URL?
$html = file_get_contents("http://www.yahoo.com");
echo $html;
?>
You just run this code, The page which is opening is not the real yahoo, It considers that we use old browsers, so suggests to use the new ones! But what I want is to get the source of original yahoo which I open by IE.
I’m using wamp.
Thanks
Caffeinated Content
PHP Programming Help?
Ok, I’m doing an assignment for school that is really confusing me. I made an htm form that is supposed to leave a box for you to enter a grade letter, and after doing so, you will get a different result depending on the letter you typed. I made the PHP file, but no matter what grade I type, it gives me the same result every time, “Your grade is excellent!”. I need help with making it give me different results depending on what I type, and I think the main problem is my call statement.
This is my html form (which is fine):
And this is my PHP file:
function checkGrade($Grade) {
switch ($Grade) {
case "A":
echo "Your grade is excellent.";
break;
case "B":
echo "Your grade is good.";
break;
case "C":
echo "Your grade is fair.";
case "D":
echo "You are barely passing.";
case "F":
echo "You failed.";
default:
echo "You did not enter a valid letter grade.";
}
}
echo checkGrade("A");
?>
Could someone please help me?
Thanks, Frank! I think it’s a step in the right direction, but the only problem now is that it’s giving me the default answer everytime now, which is, “You did not enter a valid letter grade.”
Do I need to define the A, B, C, D, F variables anywhere?
Ok, it works now, thank you, Frank!!!
php programming
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 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 ] ” ))));
Kansieo.com
PHP programming: Save As?
Hey guys,
I’m working in PHP and am not sure if this can be done. If I have 2 files: page1.html and page2.html, can I use PHP to save page1 as page 2 and page 2 as page1.
Thank you.
Caffeinated Content
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.
Caffeinated Content
Add Advanced File Upload in PHP in a few minutes
This upload tool from Aurigma works in any browser and is available at http://aurigma.com/Products/ImageUploader/FreeTrial.aspx
Duration : 0:7:37
Wise Choices in PHP Programming
If you have been browsing the web foir quite sometime, then you might have come across cookies which allows your browser to remember passwords and other information that may have anything to do with your actions on a particular website. These can be preferences that would allow the browser or webpage on the browser to determine your habits online allowing it to perform the requested operations faster and easier. A cookie is called a client-based information for it is stored on the client computer (yours when you browse the web) and is taken or stored intact along with all the information it contains for a specified amount of time or till you delete your browsing history and cookies. If you have come across tracking cookies, these are information that defines you to a particular web page which is called upon on your next visit. When creating cookies with your page, there are specific parameters (cookies by the way are created using user-made code in PHP) that must be remembered so as not to fill up the hard disks of your client computers as they visit your website page again and again. The function setcookie is used with the following syntax:
setcookie(var1, var2, time)
The var 1 stands for the name of the cookie you are creating, with the var 2 containing the value of the said cookie and the last parameter is the time which specifies the amount of time it takes for the function to kill (terminate/delete) the cookie. A more defined and elaborate explanation of the function can be found on this page.
There are a lot of programmers who share code and sample applications which you can use for free (provided you clear it up first) but for budding programmers, they’re all there for the taking. Sites like http://websitetips.com, http://Smartwebby.com and many other blogs and help sites allows access to tips from programmers like you making it a pleasant experience altogether. Can’t find a question, post questions to the many forums and you’ll get help from others in no time, you might even get help from the guru’s themselves who made the phenomenon that is PHP possible for all of us to use.
Thanks to the basic foundation on which PHP is founded on, the language being free of all legalities and other stuff that makes deployment of other languages on the many platforms quite expensive. But the many people who makeup the PHP community are not ones who keep knowledge to themselves for there are tons of free pre-made templates for applications and processes on the web available for programmers from all skill levels. They make it fun and easy to learn the language in no time and the community fosters growth to all of those who benefit from the use of PHP. Search online for help and you will surely get it in the form of forums and other helpful articles.
As stated in the previous entry, shortening or simplifying your source code makes it easier and better when you need to find bugs and a good example of this would be :
Example :
if ($Mickey == true) echo ‘Welcome to the Mickey Mouse Club House’;
elseif ($MainCharacter == false) echo ‘Hi Barney!’;
Making things a bit simpler, say by taking away the ‘==’ and ‘!=’ gives you;
if ($Mickey) echo ‘Welcome to the Mickey Mouse Club House.’;
elseif (!$MainCharacter) echo ‘Hi Barney!’;
Simplifying code should be the aim of each and every programmer (who’s head aches when you get some bugs you got to fix) so you get to code less and better than the other guy. Remember, we’re all on the same plane using the same free language so we should be helping others for the better.
Website content







