Welcome to the Famous Internet Programmer Blog
Welcome, I created this site to allow Internet Marketers and Progammers a place to come for quality information on php programming, tips, and tricks that I and others use in our Internet Marketing.
Please stop back frequently and see all the new information I have to offer.
If you have questions or comments feel free to leave them on the posts or send a message to me in the contact page.
Sincerely,
Glen Barnhardt
I m writing Php code in html program. nw i need how to read value of input tag in php program?
Uhm….. more information would be very helpful. Possibly an example of your code and what you’re trying to do?
You might want to check out http://www.w3schools.com/php/php_post.asp
I wrote a program in PHP with so many variables. I don’t want to use submit button. is there anyway 2 use href?
when I use <a href> <a/> , it doesn’t POST the variable to the destination. it only go to that page without any process. I could also use dropdown list with 1 submit button.
Thanks in advance.
Use cookies, http-header, GET, POST, AJAX and I think that just about it.
Questions about learning to program in PHP?
How long does it take to learn how to program in php? Also, do you have to get special software etc. to do it? Or can someone write PHP in a program like Adobe Dreamweaver. Sorry if this is a really dumb question lol. Also, what are the differences in the different versions of PHP such as PHP 2X, 4X, and 5X? Thanks in advance for any answers!
Dreamweaver is very bad at dealing with any server-side script, like Php. Use DW to build your site, then Notepad++ and Php to "make it work".
Php is loosely based on "C", so if you have a little experience of C programming, Php will "look" very similar. It is relatively easy to learn. Go to http://www.php.net to get plenty of examples.
How long does it take to learn it? You can get the basics in a few days. Go to w3schools.com to get started.
There are two ways of running Php:
1. Upload your scripts to a server that has Php enabled (you can then see the results in your browser)
2. Download and install XAMPP on your own machine (google "Apache Friends XAMPP" to get the download. Once installed, you can run php scripts off-line.
please please help me in this PHP program problem.. please its urgent..please?
i created a div and set a background image in that div by using style tag and in that div i created a form… so i want to create a button with onclick event… so that whenever that button is clicked the background image of the div should be changed…so please please help me how to do this?
<div id="div3" style="background-image:url(../images/re… border:double; border-color:#666666; z-index:1; width:230px; height:350px;position:absolute; left:45px; top:15px;">
<form name="chatting1" action="chat1.php" method="post">
<textarea name="chat1" cols="25" rows="3"></textarea>
<br>
<input type="submit" name="submit" value="REPLY">
now create a button which changes the background image of the div whenever it is clicked…
<head>
<script>
bkgnew = new Image(); // preload the image!
bkgnew.src = "newimage";
function change_bkg()
{
var x = document.getElementById(’div3′);
x.style.background-image = "url(newimage)";
}
</script>
</head>
<body>
<div ….
<form …
<input … onmousedown="change_bkg(); return false;" />
Preload the image with the first two lines of the script.
Use "onmousedown" instead of "onclick": When you click, the form will be sent, and you will not have the time to see the change!
Get the free script "mini Chat" at http://www.web2coders.com
Where can I learn PHP and Mysql scripting/programming?
I am 15 years old, I have an interest in programming and web design, I can make websites with dreamweaver etc, and have used html scirpts and things but never actually learned how to do php and mysql, besides knowing how to use it, and use mysql database that i’ve used for ready made scripts. I always find the websites I want to make, need intermediate to advanced php/mysql programming to make such interfaces like even a simple CMS. Can anyone tell me where to start, it’s best to start younger, where can I learn? somewhere on computer at home? Also, someone siggested for me to download wamp which i’ve had for ages and xampp, I know how to use phpmyadmin etc and things, i’ve hosted websites and used web servers. I always use premade scripts, where can I learn from the begining how to write porgramme php and mysql? Thanks.
If you have WAMP, you don’t need XAMPP.
I studied PHP and MySQL from this book:
http://www.amazon.com/dp/1590598628/
I like it. It doesn’t bring you to ‘pro’ level, but gives you enough knowledge to help you get you there by yourself.
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):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Letter Grades</title>
</head>
<body>
<form action="LetterGrades.php" method="get">
<p>Grade: <input type="text" name="Grade" />
<input name="Submit" type="submit" id="Submit" />
</p>
</form>
</body>
</html>
And this is my PHP file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Letter Grades</title>
</head>
<body>
<?php
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");
?>
</body>
</html>
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!!!
I think you wrote a good script. The problem with this script i think will be at the last statement (echo checkGrade("A");).
Instead of you writing echo checkGrade("A"); I suggest you write
echo checkGrade("$Grade");
Ooh plus you haven’t linked the form with the php script
write something like:
<?php
function checkGrade($Grade) {
$Grade = $_GET['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("$Grade");
?>
When u enter url of a php file, program to do specific function?
and when u close web-page in middle of processing will php file will continue till end?
Yes. simple and straight answer.
please help me about this PHP program problem?
Hi i want to create a drop-down-list in PHP.
In yahoo answers’ home page there are some tabs like "MY activity" "browse categories" and these tabs have some sub tabs….so whenever mouse-pointer comes over these tabs so the sub tabs are displayed as a list….so how to do this…please help me please it is urgent.
ok but please give me the java code to resolve this problem…
You’d be better off using Javascript.
PHP has nothing to do with it.
Or you can try using css if you know what you’re doing.
Help! How do I do this in php?
I’m always getting tripped up in php because there’s no way that I know of to "call" or "run" from one php program to the next without form input.
I am collecting data on a Web form that needs to be passed to a server for processing. I have a form with action="calculate.php". When the user submits the form, calculate.php reads the form fields and does some calculations. This is where I need a "run" command. The calculated fields are to be processed by a program on the server. I don’t know how to fire off this program without another <form action=….> tag. In this case it’s stupid to have the user hit submit again just to send data to the server. There really isn’t anything for the user to review. And it’s not an option to do the calculations on the server because that’s a black box application (and I don’t have access to the server).
So the only way I can see it flowing is like this:
Enter data
Submit form
php program does calculations
Useless form appears
Submit form again
Server-side program does its thing
What am I missing here? Surely this has come up thousands of times.
Thanks,
Houyhnhnm
Deepak, I am totally ignorant in Ajax and very weak in JavaScript. I know how to do math in JavaScript but I have no idea how to pass the results to the server or the php script. I thought the whole idea of JavaScript was to keep everything local anyway…
can you use javascript to do calculations?
is it too complicated to do with client side ?
can you use ajax so that some other form does the calculation?
…………………..
if you can do math using javascript, then you can use hidden fields to send data to php script ..
i see that you say it is as a blackbox application, i wonder how can send input data to it. but hope you can use my suggestion..
ex: i assume that "F_Total" is input for your blackbox application! ( a post parameter for your application)
<input id="F_Tot" name="F_Total" type="hidden" />
( if you use "name" attribute in your html tag, you can get the value at php script after submit. this works in any server side languages)
do all calculations before you submit,
<script type="text/javascript">
function doyourcalculation(){
var result;
F_Tot = document.getElementById(’F_Tot’); // find hidden field
.
.
.
calculations
result = 3 + 2;
.
.
if (result){ //if result is not nothing
F_Tot.value = result;
return true;
}
else
return false;
};
</script>
use return true or false for validations…
<input type="submit" value="submit" onclick="doyourcalculation()" />
if doyourcalculation has no error and returns true, hidden field has the input for your blackbox application.
good luck..