The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Undefined variable
tudsy
post Mar 27 2017, 01:04 AM
Post #1


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



Hi

I am having trouble with in trying to find out why this error is happening.
I have looked at the error log and it points to lines 50 and 52 in processmiddlepage.php.

I have attached the calling program ecovib2d1.php and processmiddlepage.php .

Any help will be greatly appreciated.


Thanks.


Attached File(s)
Attached File  ecovib2d1.php ( 10.57k ) Number of downloads: 479
Attached File  processmiddlepage.php ( 2.26k ) Number of downloads: 474
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Mar 27 2017, 01:52 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Well, seems to be exactly what the error message says. What really surprises me is that I pointed out this error before. Your query string is malformed (invalid). There should be a 'name=value' pair for each query item but this is your link:
CODE
document.getElementById('form').action='https://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/processmiddlepage.php?username&email&Person =' + personname + '&Price =' + Priceofart + '&Graphic =' + picname.replace('w.bmp','.bmp');

Look at username & email. It should be 'username=some_value' and 'email=some_value'
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Mar 27 2017, 07:45 PM
Post #3


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Ok, I have to ask this. Here is a function from processmiddlepage.php:
CODE
  <script>
  
function layout(){
  
  
<?php

$name = $_GET['username'];
$email = $_GET['email'];

?>


Price = <?php echo $_GET['Price']?>;
document.getElementById('price').innerHTML='Price (USD) $' + Price + 'including GST       CVV:';
Graphic = <?php echo $_GET['Graphic']?>;
document.getElementById('graphic').innerHTML='Graphic:' + Graphic  + '               Expiry: (mm\yy)';

};

</script>
.
What is your reasoning for the block of PHP code ('$name = ' and '$email = ') inside the Javascript function?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
tudsy
post Mar 27 2017, 11:21 PM
Post #4


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



Hi

Thanks for that.

I fixed the block of php code. smile.gif

Now, I was wondering what is wrong with this query string?



document.getElementById('form').action="http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/processmiddlepage.php?username1=username&email1=email&Person=" + personsnamejs + "&Price=" + Priceofart + "&Graphic=" + picname.replace('w.bmp','.bmp');


Thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Mar 28 2017, 11:28 AM
Post #5


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



'?username1=username&email1=email', where do the values username and email come from? Are they Javascript or PHP variables? The last time I asked this question you said they were PHP variables. I showed you how to echo the PHP variables into the Javascript query.

Once again I ask a question and I get nothing back from you. I ask these question for a reason. Based on the code I see you still don't understand server vs client side processing. You use WAY to much Javascript and not nearly enough PHP. You wouldn't need so much Javascript if you used PHP better.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
tudsy
post Mar 29 2017, 04:47 AM
Post #6


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



QUOTE(CharlesEF @ Mar 29 2017, 01:58 AM) *

'?username1=username&email1=email', where do the values username and email come from? Are they Javascript or PHP variables? The last time I asked this question you said they were PHP variables. I showed you how to echo the PHP variables into the Javascript query.

Once again I ask a question and I get nothing back from you. I ask these question for a reason. Based on the code I see you still don't understand server vs client side processing. You use WAY to much Javascript and not nearly enough PHP. You wouldn't need so much Javascript if you used PHP better.


Hi

Thanks for that.

It was a silly oversight.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th March 2024 - 11:04 PM