Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PHP Basics

 
bala kan
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
chang_page.js



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



Regards,
Bala
 
Nick Charles
Ranch Hand
Posts: 71
Linux PHP Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic