Solved

onclick button

Posted on 2014-03-08
12
138 Views
Last Modified: 2014-03-27
I have a page and what I want to do is after the user clicks on up/down/left/right I need to return to the same page.  Is there a way that I can use php in the java script?

To explain this better.  It's a list of addresses.  The page shows an entire block (north/south/east/west)  What I want to do is when they click on "Up", it will show the same info for one block north. The same would work for down (south), left (east) and right (west).
0
Comment
Question by:breeze351
  • 6
  • 3
  • 3
12 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39915324
You can put PHP values into javascript, you can't run PHP at the browser with javascript.

Maybe if you gave a link to the page we may be able to help you.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39915950
Can you please show us a link to a page that does this?  It's doesn't have to be your web site, obviously, just something online that demonstrates what you're trying to achieve.  Thanks, ~Ray
0
 

Author Comment

by:breeze351
ID: 39916129
Web Site: langsystems.net
User: sales
Password: lsi

I have no problems with passing this information.  It is all test data.

After you login click on "Walk By Map"

Street #: 1300
Street Name: mad

What I want to do is add 4 buttons (West ,North, South & East).

When the user clicks on "North", reload the page with the same data for the previous block.  

As you can see from the data "echoed" at the top of the page,  I can figure out the information for the page that I need to load.

I'm worried that if I go to another page change the data and reload this page, what happens if the user hits the back button?

Is there a way I can reload this page without having to load another page?
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39916143
Let me try this question again...
Can you please show us a link to a page that does this -- something online that demonstrates what you're trying to achieve?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39916153
When the user clicks on "North", reload the page with the same data for the previous block.
That in itself goes against how someone would logically think looking at a map
Have your navigation buttons and a separate compass showing where north is.

What is the logic to know where you are going, how do you know what 'map' to load?

Is there a way I can reload this page without having to load another page?
No idea what you mean.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39916160
I'm thinking google maps would be a simple and better solution for you. (considering all the time you are putting into just this part of the website)
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39916171
+1 for Google Maps.  Easy to integrate and lots of built-in functionality.
0
 

Author Comment

by:breeze351
ID: 39916299
Ray:
North is always on top.
East to the right.
South on the bottom.
West to the left.

As far as Google maps, they are not accurate.  I have a database and I know where stores/buildings are actually located.

Google gives you a general location.  This is particular true in major cities.  A building in NYC can have 3 addresses.  One on "8th Avenue" and the second on "14th Street" and the third on "15th Street".  

Also Google does not have all the locations that I am looking for.  They don't have side streets and their data is out of date.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39916305
I understand standard compass notation.  If you want something more accurate and up-to-date than Google's free data, please tell us your budget to buy mapping data.  Armed with that knowledge we may be able to suggest some paid providers.  Also, back to this:
Can you please show us a link to a page that does this -- something online that demonstrates what you're trying to achieve?
Have you ever seen any web site that does what you're describing?  Or are you asking for original research?
0
 

Author Comment

by:breeze351
ID: 39918469
I have the data and it's better than Google's!!!!
I'm working with brokers in NYC, Maryland, and Washington DC.

As far as a website that does this, nobody does.  We have a product.

I think I've figured this out by myself.

Can you tell me the problem with this code?

                  header("Location:Walk_Map_Display.php?
                              SEQ=$ROW2['SEQ'] &
                              STORE=$ROW2['STOREKEY'] &
                              ADDRESS=$ROW2['BNMB']
                              ");
Thanks
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39918507
It would probably need to be constructed on a single line, so there are no line break characters, and the data fields would need to be URLEncoded.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39960104
Please see the Experts-Exchange Grading Guidelines which are part of the agreement we all make in this community.  You're required to explain a marked down grade.  Standing by for your explanation.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question