Archive for the ‘programming with php’ Category
PHP Programming Loop Question?
Hi,
if i am retrieving the information in the database table using loop (While Loops and For Loops), and i want to add in a submit button in every row. How can i store the ID inside the submit button so i can post to another php page?
As the problem i am facing now is that, with every button display at every row, when i click submit button of one of the row, it supposedly should post the ID to the next page, but it isn’t doing it. Therefore i would like to know how to store the value inside the submit button in a loop.
Thanks so much!! =D
My code will be:
<td>
<form method=’post’ action=’doView.php?id=<?php echo $Course_id; ?>’>
<input type=’submit’ value=’More Information’ name=’<?php echo $Course_id; ?>’ />
</form>
</td>
You need to create the url that you are going to use for the button. The url is just a string with a variable in it. In fact the code for the button will just be a string.
"myPage.php?ID="
Now append to the above string your id. That is it. You may have to escape some quotes to get to that but that is all.
Have fun.
Do you know some Free Web Hosting with PHP?
i want a Free Web Hosting with PHP,for test some program.Must be real free.
Try this free web hosting provider 0fees.net, 000webhost.com, freehosting.com, byethost.com/free-hosting
Who installs/determines programming languages like PHP, HTML, CSS etc.?
I read somewhere something like this: "with the advent of PHP…" But how are they installed/implemented as a coding language understood by each computer?
This can turn out to be a stupid question if I read the answer lol.
HTML and CSS are markup languages used to create web pages. In a nut shell they combine to tell the browser how to display the data being sent to it.
PHP is a server side programming language that outputs HTML code that your browser can then display.
All browsers are designed to translate the HTML/CSS. PHP does not have to be installed on your machine because the program is actually run on the server then the HTML output is sent to your browser.
This is an overly simplistic explanation. I hope it helps.
Please Help me with php code?
hello, I know who can help me with the following problems of programming in php.
1. Calculate the area of a triangle knowing its base and its height and then display the results on screen.
2. Given a positive integer, say if it is even or odd.
3. Given two positive integers which is the largest print.
4. Given the three sides of a triangle, print if equilateral, scalene or isosceles.
$area = $base / 2 * $height;
if( $int1 > $int2 ) { print $int1; } else { print $int2; }
Now try the last one yourself
how to link image using PHP Programming language?
how can i link an image using php programming language by
looping statement.
ea. i have a table with 4 rows and 5 cols with images thumbnails with link..
don’t know the names of the table and rows but:
<?php
// Make a MySQL Connection
$query = "SELECT image FROM images";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo ‘<img src="’.$row['image'].’">’;
echo ‘<br>’;
}
?>
contact me and tell me the details of your table.
Can someone help with PHP/HTML programming?
I need to put an upload option onto a website for people to upload images to another page on the website. I am a pure beginner on the programming side and need assistance. Can someone give me the easiest ever instructions on how to write the script for this?
I can get the button and form into the webpage, but when I choose the file to upload it says that it can’t find the page it was searching for. I have no server to go through. I only have html files to work with. I need to be able to upload on one page and have it posted on a different page inside the same website.
Here bro, hope this helps.
http://w3schools.com/php/php_file_upload.asp
Is the following book good for learning PHP & MySQL?
Is the following book good for learning PHP & MySQL-
A)Beginning PHP5,Apache,MySQL Web development(Wrox Programmer to Programmer) By Elizabeth Naramore,Jason Garner ..& others
Also I have this book -
B)Beginning PHP5 (Wrox Publication) By Dave Mercer,Allan Kent,…and other authors
Are the above books sufficient or I should buy any of the following books to get a good grasp of PHP & MySQL?
I already know basics of HTML & conversant with C Programming & Pointers.
Please also suggest me on the following books -
1)Web Database Applications with PHP & MySQL(O’Reilly)
2)Programming PHP(O’Reilly)
3)PHP and MySQL Web Development (Addison-Wesley Professional)-By Luke Welling & Laura Thomson
4)PHP6 & MySQL5 for dynamic websites-Larry Ullman (Peachpit Press)
5)MySQL Visual Quick start guide(Peachpit Press)
6)Sams teach yourself MySQL in 21 days
Please guide me I will be extremely grateful as I want to learn these at home by myself.
I want to build dynamic websites and shopping carts.
Will be greatly obliged & 10 points for the best answer.
i think u can follow the book name is – PHP coding by Pritam Ganduuu & de nunu jaan & Ajay Kuttiya Khan
lol
Where can I find a "Contact Us" form written in PHP with Javascript validation and CAPTCHA?
Need "Contact Us" form written in PHP with Javascript validation.?
I need a "Contact Us" form written in PHP that does Javascript validation. It needs to have the following:
Name:
E-mail Address:
Subject: [ drop down where the user selects a subject]
Comment:
With all fields being required.
So it can be written in HTML with Javascript and then call a PHP program which would contain the e-mail address of where these messages go.
It also needs to have CAPTCHA. Thanks!
<form method="post" action="process.php">
<input type="text" name="name" />
<input type="text" name="email" />
<select name="subject">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
<textarea name="comment"></textarea>
</form>
process.php(page)
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['comment'];
if ($name == "")
{
echo "You did not enter your name."; //Repeat this changing the variable in the if statment.
header(‘Refresh: 4; url=contact.php’); //Redirects user back to content page 4 = 4
//seconds
exit();// stops the script going any further
}
if(!preg_match(‘/^[a-zA-Z0-9 ._+\-?,():?!$]{0,1000}$/’, $name)) // register of illegal
//characters.
{
echo "Your name contains illegal characters.";
header(‘Refresh: 4; url=contact.php’);
exit();
}
?>
after validation is complete I can not go any further as I do not know if your connecting to a database or sending it to an email address.
Get back to us on this if you like.
What programming language to star with?
I know html and css, but I know that that will get me nowhere. I want to learn PHP after I learn C++, because I hear that once you master C++, everything else comes easy. Is this true?
Bonus: How does a 14-year old boy like me learn programming with absolutely no money and parents that can barely pay the bills?
To get somewhere with web development, HTML and CSS is a great place to start. Don’t undermine the importance of those technologies; master them. When I was in your exact situation, I moved on by learning JavaScript, and then PHP, and onward from there.
After learning HTML, I leaned basic scripting with JavaScript. JavaScript is perfect for you because it is simple and you already understand the basic HTML/CSS environment it interacts with. JavaScript can teach you some very important concepts that are common to almost all languages, such as variables and data types. Also the syntax, or way it is written, is similar to many languages.
After learning the client-side of web development (HTML, CSS, JavaScript), I got into the server-side by learning some basic PHP scripting. After grasping the basics, learn about object-oriented programming in php. Eventually you should try to learn about programming in a more general sense. Learn about object-oriented design patterns. Experiment with other languages, such as Ruby, Python and Java.
If web development is your focus, you should keep in mind that programming languages are only part of it. As you learn PHP, you will also be learning about the HTTP protocol and SQL databases. You will also learn about software such as Apache and maybe MySQL.
If you work hard and you love it enough, you can give yourself a great education in the field of web development absolutely free! A computer and the internet is all you need. All of the software you need at this point is free. You should find a text editor you like, maybe try Notepad2, Notepad++ or Programmer’s Notepad.
How do I make an installer with PHP and XAMPP incorporated?
Here’s what I want to do:
I want to develop a network based app with PHP and MYSQL. But I want to make an installer (just like the installers in windows, one click and it installs everything necessary) which will place the XAMPP as the web server and put PHP files in proper places and also installs a browser which will only run that particular PHP program.
You just download it from the internet and install and start using like other desktop based applications. Any idea how should I go about it?
Thanks.
@Sergey: Thanks for your answer. But I already knew that. What I really want is to have my own php files in the appropriate folders. For example I make a website/application with index.php, admin.php and DB.php. Now I want to install this application like other applications. During the installation process the 3 .php files I mentioned will automatically go into the htdocs folder, a database will be created and a browser will open with my applications URL in its address bar (or have no address bar at all, will go directly to my apps URL only).
I hope you got my question right this time.
XAMPP comes with PHP already so there is no need to install it manually. You can simply use XAMPP installer as is (if their license allows redistribution of course).