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>
?>

Recommended Answers

All 3 Replies

Member Avatar for diafol

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?

i didn't get any error.got the tempnum correctly but not tempname

Member Avatar for diafol
<?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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.