Jump to content

Include(Otherfile.php#anchor)


Johnny2

Recommended Posts

I'm trying to include a file, but want to show the file at a specific location. I figured I'd just use a named anchor in my include, but it doesn't seem to work. Is there a way to do this?... or am I once again trying to do something impossible? I know I can probably use a regular link to go to that specific location on the page, but in my situation I need to "include" the other file (so that my variables will still be defined).

 

include(otherFile.php#anchor);

 

 

Thanks!

Link to comment
Share on other sites

Unfortunately that isn't the way that includes work.

 

I'm not quite sure what you have in mind... you might look into AJAX instead, where you use Javascript to insert content from a file into a page (for example: http://api.jquery.com/jQuery.get/) or using a session and session variables to keep certain variables defined while switching pages.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...