Can anyone help me spot the error in this peice of code.....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rajpalyadav
Forum Newbie
Posts: 6
Joined: Mon Aug 11, 2008 4:48 am

Can anyone help me spot the error in this peice of code.....

Post by rajpalyadav »

Code: Select all

<?php <a href=result.php?admn_no=$_POST[admn_no]>$_POST[admn_no]</a> echo " ".$row['adm_no']. " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "; ?>
Hi everyone,
Above is the code for the stats of a php page.
Can anyone help me spot the error in there, please?
Any help will be appreciated.
Thanks.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Can anyone help me spot the error in this peice of code.....

Post by jayshields »

There are many errors in the code. I'm not going to point them out (because it looks like homework to me). If you read up on basic PHP syntax you'll be able to correct the code yourself.
rajpalyadav
Forum Newbie
Posts: 6
Joined: Mon Aug 11, 2008 4:48 am

Re: Can anyone help me spot the error in this peice of code.....

Post by rajpalyadav »

jayshields wrote:There are many errors in the code. I'm not going to point them out (because it looks like homework to me). If you read up on basic PHP syntax you'll be able to correct the code yourself.
Hi!

I have changed the code as

1. <a href=result.php?adm_no='$_POST[<?php echo " " .$row['adm_no']. " "; ?>]'> </a>
2. <a href=result.php?adm_no='$_POST[adm_no]'> <!--</font> -->
<?php echo " ".$row['adm_no']. " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "; ?> </a>

Now errors are not coming but problem is still unresolved
1. is not giving link at all
2. Link showing but value of adm_no is not sent

Can you help ?
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: Can anyone help me spot the error in this peice of code.....

Post by it2051229 »

<?php
echo "<a href='result.php?admn_no='".$_POST[admn_no]."'">".$_POST[admn_no]."</a>";
echo " ".$row['adm_no']. " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";
?>
rajpalyadav
Forum Newbie
Posts: 6
Joined: Mon Aug 11, 2008 4:48 am

Re: Can anyone help me spot the error in this peice of code.....

Post by rajpalyadav »

Thanks for the reply

<?php
echo "<a href='result.php?admn_no='".$_POST[admn_no]."'">".$_POST[admn_no]."</a>";
echo " ".$row['adm_no']. " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";
?>
but it is giving error
"Parse error: syntax error, unexpected '<'" at line no X

I have changed admn_no adm_no as this is the correct field name as written on first line if you notice there is one extra " in 1st line if I remove this then again it is giving error.

Pl suggest Thanks a lot
rajpalyadav
Forum Newbie
Posts: 6
Joined: Mon Aug 11, 2008 4:48 am

Re: Can anyone help me spot the error in this peice of code.....

Post by rajpalyadav »

:?: :?:
User avatar
idevlin
Forum Commoner
Posts: 78
Joined: Tue Jun 26, 2007 1:10 pm
Location: Cambridge, UK

Re: Can anyone help me spot the error in this peice of code.....

Post by idevlin »

"Parse error: syntax error, unexpected '<'" at line no X

Which line is X then? Is this all the code, or have you left some out?
rajpalyadav
Forum Newbie
Posts: 6
Joined: Mon Aug 11, 2008 4:48 am

Re: Can anyone help me spot the error in this peice of code.....

Post by rajpalyadav »

Hi,

I have slightly modified the

<?php
echo "<a href='result.php?adm_no=".$_POST[adm_no]." '>".$_POST[adm_no]. "</a>";
echo " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";
?>

Now we are getting the output but when we try to pass the value to result.php and psot the value of adm_no to result.php it is not getting transferred . you may please visit http://www.ismdhanbad.ac.in/result/result/adm_no.htm and enter 1 or 2 as adm_no and then click the submit you will get result page here you will get a link on Adm_No again click IT SHOULD DISPLAY the same output as I am calling the same result page with same adm_no but it is saying something else , which means that the value of adm_no has not actually been transfered to result.php

Hope to get suitable answer now.
rajpalyadav
Forum Newbie
Posts: 6
Joined: Mon Aug 11, 2008 4:48 am

Re: Can anyone help me spot the error in this peice of code.....

Post by rajpalyadav »

Hi All,

I want to display a new line in php after the result is displayed in a table at present it is giving on the same line after the table ends just like as a different col I want it to display on a new line just below the table i.e. where the table ends .

Help required pl
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Can anyone help me spot the error in this peice of code.....

Post by jayshields »

What table? You need to be more descriptive and post more code using [ php ] tags. If this is an unrelated problem, start a new thread.
Post Reply