Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Problem with anchor and name tags in php

    Hello,

    Does the fact that I am linking to a php file mean that I can not use and anchor name tag eg :
    Code:
    <a name="renew"></a>
    I am trying to give a refresh and show the form agian without the user having to scroll down.

    So I am using :
    Code:
    <a href="index.php#renew">Renew</a>
    Maybe I haven't done it correctly ?
    Any help, much appreciated.

    This is my php page :

    PHP Code:
    <Div class="formfill">
    <H2> Claim Your <span class="big_let_01">FREE</span> Entry NOW!</H2>
    <P><a name="renew"></a>
    <INPUT type="checkbox">
    <B>Fill out the form below</B> and
    you'll immediately receive <B>FREE</B> entry to our internet business coaching system.
    Put an end to the frustration. 
    <br>Start today: I am waiting to send you your free login details.
    </P>

    <form name="main_fm1" action ='index.php' method = 'POST'>
    <div class="form_table">
    <span><input type='hidden' name = 'run_mn1' value = 'yes' ></span>

    <span class="tab-cell-left">Enter Your First Name:</span>
    <span class="tab-cell-right"><INPUT name="x_contact" value= '<?php echo "$N_contact"?>' size="28" type="text"></span>

    <span class="tab-cell-left">Your <span style="text-decoration: underline;">main</span> Email Address:</span>
    <span class="tab-cell-right"><INPUT name="x_email" value= '<?php echo "$N_email"?>' size="28" type="text"></span>

    <span class="tab-cell-left">Give yourself a Password:</span>
    <span class="tab-cell-right"><INPUT name="x_pass" size="28" type="password"></span>

    <span class="tab-cell-left" style="height: 40px; vertical-align: center;">Verfication Image:</span>
    <span class="tab-cell-right"  style="height: 40px; "><img src="captcha.php"> <a href="index.php#renew">Renew</a></span>

    <span class="tab-cell-left">Enter 8 character key:</span>
    <span class="tab-cell-right"><input type="text" name="imgver" id="imgver"></span>

    <input class="button" type="submit" value="Give Me Free Entry Now"/>

    </div> <!-- END FORM TABLE -->
    </FORM>
    </Div> <!-- END FORM FILL -->
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    I don't see any error in it...It is working apparently,,it just ain't that visible enough..
    Maybe you can check it out if it's working by adding a number of <br/> tag before
    Code:
    <span class="tab-cell-right"  style="height: 40px; "><img src="captcha.php"> <a href="delete.php#renew">Renew</a></span>
    I just tested it here...and it works...or simply i'm not taking this right

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Well I ran it again and scrolled around
    it is going to the name ref
    so in a way, it works
    - but I wanted it to re-load the php
    so that I get a new captha image shown.
    maybe the href wont re-load the file if it is already loaded ?

    maybe I need to do this with js ?
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Now...i understand it
    You could either choose from this three codes:
    <span class="tab-cell-right" style="height: 40px; "><img src="captcha.php"><a href="index.php#renew" onClick="window.location.reload()">Renew</a></span>
    or
    <span class="tab-cell-right" style="height: 40px; "><img src="captcha.php"><a href="index.php#renew" onClick="history.go(0)">Renew</a></span>
    or
    <span class="tab-cell-right" style="height: 40px; "><img src="captcha.php"><a href="index.php#renew" onClick="window.location.href=window.locationi.href">Renew</a></span>

  • #5
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks
    That looks great

    I will use the first one:

    PHP Code:
    span class="tab-cell-right" style="height: 40px; "><img src="captcha.php"><a href="index.php#renew" onClick="window.location.reload()">Renew</a></span
    as it looks more intuitive ( big word )
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #6
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    No problem!...You're welcome

  • #7
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    If you want to refresh the image without reloading the page you can use something like this:
    PHP Code:
    <img src="captcha.php" id="captcha" /><br />
    <
    a href="#renew" onclick="javascript: document.getElementById('captcha').src = 'captcha.php?' + Math.random();">refresh</a

  • #8
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    well
    Mr Inigoesdr ... I suppose thats not bad .

    actually it really does the biz - brilliant

    Just one thing - why is the "+ Math.random()" needed ?

    Doesn't the captcha.php already randomize it ?

    Thanks
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #9
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    You need to add a random number to the URL so the browser considers it a different file, and consequently re-requests the image from the server.

  • #10
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    OH - I see - nothing to do with the capctha ramdomizer.

    ( Nice to get that sorted - just my email playing up now ...
    ... but thats another thread )
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •