relative linking in php

This is a discussion on "relative linking in php" within the PHP Forum section. This forum, and the thread "relative linking in php are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 12th, 2008, 23:24
Junior Member
Join Date: Dec 2007
Location: auckland
Age: 33
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
relative linking in php

i am using a self submitting for using php
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST" id="test2" name="registrationform">

the registration page starts with a lot of terms and other details about the registration and then the form fields for the user to fill the registration page. i have used php to validate the form, presently when a user clicks the submit button and if there are any validateions that need to be displayed to the user, then the user has to scroll from the top of the page all the way till they see the form elements with the validation message ex= Please enter your phone number.

my question is, as in html with relative linking ex
<a href="#link1"> click here</a>
<a name="link1"> </a>
Text here

the page can be moved to an exact location, can this be done more or less close to this relative linking using php so that the user need not scroll from the top of the page to see the validation message.

NOTE = since i am using a self submitting form just before the first form element
i have created a blank table row and in this table row the php validation message would appear if the user missed out some information

due to this the user has to scroll from the top of the page to see the php generated validation message. if i use the same php validation at the very top of the page the error message will be at the top and the form fields at the bottom and the user will have to scroll up and down to read the validation message.

please advice.

thanks.
Reply With Quote

  #2 (permalink)  
Old Mar 12th, 2008, 23:43
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: relative linking in php

You would want to use a mix of javascript and PHP.

Code: Select all
<?php if(!$validate) { ?>
<script type="text/javascript">
<!--

window.location = window.location + "#<?php echo $invalid_div; ?>";

//-->
</script>
<?php } ?>
Please note I'm not sure this will work, I've never done this sort of thing with javascript before.
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
positioning - relative or absolute? google Web Page Design 13 Nov 8th, 2007 16:00
Is it possible to position something relative something else? the newbie web designer Web Page Design 7 Feb 22nd, 2007 18:04
relative position problem antonyx Web Page Design 12 Dec 30th, 2005 21:19
can layers be relative? warmer Web Page Design 0 Nov 8th, 2005 18:42
Relative linking to Access... JohnMitch Classic ASP 6 Aug 10th, 2005 14:19


All times are GMT. The time now is 02:17.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43