0

Hi

below code prints tempnum correctly but not tempname. Kinly look into this.

<html>
<head>
    <script type="text/javascript" src="jquery-2.0.3.min.js"></script>
    <script type="text/javascript">
                    $(document).ready(function(){
                    $(".mylinktempnum").click(function(){
                        alert($(this).attr('href').match(/tempnum=([0-9]+)/)[1]);
                        *alert($(this).attr('href').match(/tempname=([a-z]+)/)[1]);*

                    });
                    });
    </script >

</head>
<body>
</body>
</html>


<?php
<a class=\"mylinktempnum\" href=\"home.php?tempnum=$num&tempname=$name\"></a>
?>
2
Contributors
3
Replies
12
Views
3 Years
Discussion Span
Last Post by diafol
0

Have a look at the php.net manual about how to echo / print to the screen. I'm surprised you didn't get an error - or did you?

0
<?php
<a class=\"mylinktempnum\" href=\"home.php?tempnum=$num&tempname=$name\"></a>
?>

Shouldn't echo to the screen as you have no echo or print

You don't show where your $num and $name are coming from. So if $name is not set properly then tempname will not show.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.