Error |
Error |
tudsy |
Aug 19 2017, 12:35 AM
Post
#1
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
With this query string, I get the error: [19-Aug-2017 05:13:26 UTC] PHP Parse error: syntax error, unexpected '<' in /home/ecovibdc/public_html/ECOVIB2D/MYART/processmidpage.php on line 135 [19-Aug-2017 05:17:15 UTC] PHP Notice: Undefined index: username in /home/ecovibdc/public_html/ECOVIB2D/MYART/ecovib2d1.php on line 187 [19-Aug-2017 05:17:15 UTC] PHP Notice: Undefined index: email in /home/ecovibdc/public_html/ECOVIB2D/MYART/ecovib2d1.php on line 187 When I load ecovib2d1.php, load the graphic and hover over the buy button, I get a 'NaNNaN.........' type of output on the status bar. I do not know what is happening? I think I have defined username and email correctly in the query string? document.getElementById('form').action="http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/processmidpage.php?username=" + <?php echo $_GET['username'];?> + "&email=" + <?php echo $_GET['email'];?> + "&Person=" + personname + "&Price=" + Priceofart + "&Graphic=" + picname.replace('w.bmp','.bmp'); Thanks. Attached File(s) processmidpage.php ( 3.82k ) Number of downloads: 507 ecovib2d1.php ( 10.02k ) Number of downloads: 465 |
CharlesEF |
Aug 19 2017, 06:50 PM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
According to your code, in 'ecovib2d1.php' line 187, you should have 'username' and 'email' in the query string. I suspect that when 'ecovib2d1.php' loads there is no query string for the page. That is the reason for the 2 undefined index errors. If 'ecovib2d1.php' does have the query string then I would need to see the code for the page that loads it.
In 'processmidpage.php' this section of code is totally wrong: CODE <?php It should be: $name=<?php echo $_GET['username']?>; $email=<?php echo $_GET['email'] ?>; $graph=<?php echo $_GET['Graphic']?>; $Priceof=<?php echo $_GET['Price']?>; $pers=<?php echo $_GET['Person']?>; ?> CODE <?php And that is the reason for the parse error. You can't use, and don't need to use, PHP tags inside another PHP tag.$name=$_GET['username']; $email=$_GET['email']; $graph=$_GET['Graphic']; $Priceof=$_GET['Price']; $pers=$_GET['Person']; ?> Also, on line 112 I see this line of code: CODE <script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script> You might want to check the 'src' value to be sure it is correct.This post has been edited by CharlesEF: Aug 19 2017, 07:05 PM |
tudsy |
Aug 20 2017, 12:15 AM
Post
#3
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
According to your code, in 'ecovib2d1.php' line 187, you should have 'username' and 'email' in the query string. I suspect that when 'ecovib2d1.php' loads there is no query string for the page. That is the reason for the 2 undefined index errors. If 'ecovib2d1.php' does have the query string then I would need to see the code for the page that loads it. In 'processmidpage.php' this section of code is totally wrong: CODE <?php It should be: $name=<?php echo $_GET['username']?>; $email=<?php echo $_GET['email'] ?>; $graph=<?php echo $_GET['Graphic']?>; $Priceof=<?php echo $_GET['Price']?>; $pers=<?php echo $_GET['Person']?>; ?> CODE <?php And that is the reason for the parse error. You can't use, and don't need to use, PHP tags inside another PHP tag.$name=$_GET['username']; $email=$_GET['email']; $graph=$_GET['Graphic']; $Priceof=$_GET['Price']; $pers=$_GET['Person']; ?> Also, on line 112 I see this line of code: CODE <script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script> You might want to check the 'src' value to be sure it is correct.Hi Thanks for that. I have just on question. What do you mean 'username' and 'email' must be inside the query string? Thanks. |
tudsy |
Aug 20 2017, 05:39 AM
Post
#4
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
According to your code, in 'ecovib2d1.php' line 187, you should have 'username' and 'email' in the query string. I suspect that when 'ecovib2d1.php' loads there is no query string for the page. That is the reason for the 2 undefined index errors. If 'ecovib2d1.php' does have the query string then I would need to see the code for the page that loads it. In 'processmidpage.php' this section of code is totally wrong: CODE <?php It should be: $name=<?php echo $_GET['username']?>; $email=<?php echo $_GET['email'] ?>; $graph=<?php echo $_GET['Graphic']?>; $Priceof=<?php echo $_GET['Price']?>; $pers=<?php echo $_GET['Person']?>; ?> CODE <?php And that is the reason for the parse error. You can't use, and don't need to use, PHP tags inside another PHP tag.$name=$_GET['username']; $email=$_GET['email']; $graph=$_GET['Graphic']; $Priceof=$_GET['Price']; $pers=$_GET['Person']; ?> Also, on line 112 I see this line of code: CODE <script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script> You might want to check the 'src' value to be sure it is correct.Hi Thanks for that. I have just on question. What do you mean 'username' and 'email' must be inside the query string? Thanks. Hi Do you mean: document.getElementById('form').action='http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/processmidpage.php?username=' + username + '&email=' + email + '&Person=' + personname + '&Price=' + Priceofart + '&Graphic=' + picname.replace('w.bmp','.bmp'); |
Lo-Fi Version | Time is now: 24th April 2024 - 06:01 AM |