Solved

onclick button

Posted on 2014-03-08
12
139 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can in rewrite this js anonymous function as a named function 26 32
Html Newline 7 21
AJAX, If No returns don't let the AJAX Call run again 2 21
JQuery Search Filter 2 32
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

829 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