Archive for the ‘programming with php’ Category

I am new to PHP programming & Have a Question!?

Hello yahoo!

I am new to php programming, and bought a book and have been learning php with MySQL. However MySQL is not my main goal………..I really want to learn php with Microsoft SQL Server R2 (MSSQL) however there where no books on that.

My question is, if anyone has a ‘ConnectDB’ script for MSSQL? So I can use php to connect to a Microsoft SQL Server Database.

Many thanks!

http://php.net/manual/en/book.mssql.php

php.net is your friend. It will be more useful than any book you can read.

Cheers,
Gitlez

Website programming. PHP Beginner.?

I am making a start with PHP Website programming. I am using Windows XP.

Can I use Notepad that is already installed on my computer.

I need some help with php programming.
I have downloaded PDF Creator. Preferences PDF Writer. When I open Preferences. PDF Writer the User Default Folder Location box is checked. I click OK and nothing happens.

Any links of anything else I need to start PHP and step by step instructions would be great.
Do I need to get rid of PDF Creator?

You will need the following.

WAMP

http://www.wampserver.com/en/

AND

Notepad++

http://notepad-plus-plus.org/download/v6.1.html

And its the first link in green for notepad++.

WAMP is your server that you need for PHP. You code your PHP into Notepad++ and you save all your web files in the www folder which is located in your server .

start > computer > local disk c > wamp > www

All your web files should be saved in that folder.

And to run the files turn the server on.

start > (type)"wamp" press enter.

And finally open up your browser and type the following

localhost/index.php

index.php is what you should save your main page as.
———————————————

To make things simpler make your home page the site you are building. It will save you typing in localhost every time.

A lot of information there so if you get stuck give us a shout. Good luck

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.