• Post Reply Bookmark Topic Watch Topic
  • New Topic

Display text using javascript

 
Vani Sweety
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I want to display results from php by using javascript
but i am getting an error

<br />
<b>Notice</b>:  Undefined index: para1 in <b>C:\xampp\htdocs\webpage\cardetails.php</b> on line <b>8</b><br />
successfull


here is my code for javascript:



and here is my connection to php

 
Pedro Freitas
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with your code is that you are not posting anything with name "para1" in your requests. The notice PHP generated is pretty clear.

line 75 -> w= para1; should be w="para1="+para1; like you did above...
 
Vani Sweety
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have pass the parameter but it is giving me an error in php

<br /> <b>Notice</b>: Undefined index: para1 in <b>C:\xampp\htdocs\webpage\cardetails.php</b> on line <b>8</b><br /> successfull

Actually the value of para1 i am getting if from a javascript function
when clicking on a specific item for example clicking on ch in a list it display all the values comtaining this item form database.
Like
chocolate
choke
now when i click on chocloate it should display all the information about chocolate for example the colour.
here is the code for javascript:


and here is the code for php:
 
Vani Sweety
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Intead of retrieving the values and displaying them it is displaying successfull
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!