File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes PHP and the fly likes PHP Basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "PHP Basics" Watch "PHP Basics" New topic

PHP Basics

bala kan
Ranch Hand

Joined: Aug 20, 2012
Posts: 44
Hi Friends,

Good morning to you,

I have been creating simple index page in which i use one text box and submit button and i use php smarty also..

requirements are:
when i click after entering some text in text box, it should be posted into the another php ("companyinfo.php") ..

for instance, if i enter some company name in text box , it should fetch the corresponding row from the table.. and those records should be displayed in the "companyinfo.php"..

index.php codings are

javascript codings are:

companyinfo.php coding are

it shows the following error

Notice: Undefined index: search in C:\wamp\www\phpdemo\companyinfo.php on line 8

please rectify me..

Thanks in advance

Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 71

Why are you using javascript? Why not simply define the form on index.php as follows:

This will be sure to send a POST request to the server. You javascript on the other hand simply use a GET, which doesn't pass any form data.
I agree. Here's the link:
subject: PHP Basics
It's not a secret anymore!