Jump to content

new page opened


Goose87

Recommended Posts

Hey guys,

 

I'm not sure if it's even possible in php, i think i need some kind of javascript, but i want the following to happen:

 

someone clicks a link on my site, i want it to open a page in a new tab/window and then i adjust the database when they have (its a voting site)..

 

I don't want people to feel like I'm asking for the answer and being lazy, as I'm not like that, so if you give me just advice, guidance, I will try and code around the problem :)

 

Thanks in advance for your help, I appreciate it.

 

Goose.

Link to comment
https://forums.phpfreaks.com/topic/100014-new-page-opened/
Share on other sites

Oh sorry, i forgot to state that the "update the database" part isn't significant.  The actual problem is:

 

What do i type to make the query actually work.

 

For example:

 

if(isset($_POST['submit'])) {

 

  $query;

 

}

 

What do i type instead of isset for the new page/window being opened?

 

 

EDIT:

 

I suppose I could have the submit one (have buttons on a page) but then how do i make the code open a new window? Thats javascript isnt it?

Link to comment
https://forums.phpfreaks.com/topic/100014-new-page-opened/#findComment-511463
Share on other sites

errr..you'll have to excuse me because I've had a very long day and i've driven across half the country, because I didn't understand that last post.

 

I'll try and explain the situation in it's literal sense:

 

I have a website, I want people to go to another website and vote for my website.  This involves loading a new page up.  When a person clicks the button and loads the new page up, I want to do a quick query to the database.  The query is a simple quantity=quantity+1 type query, so I don't need help with that.  What I need help with is what I type to execute the query.  i.e. How do I know the person has loaded the page up?

Link to comment
https://forums.phpfreaks.com/topic/100014-new-page-opened/#findComment-511483
Share on other sites

the links need to be rewritten in 1 of 2 ways

 

1) Javascript functions that onclick not only navigate the user forward but also run a query via AJAX

2) rewrite your links to go to a page on your server mysite.com?out=http://www.google.com  add a count to google and the header reloacte or meta refresh to google.com

Link to comment
https://forums.phpfreaks.com/topic/100014-new-page-opened/#findComment-511509
Share on other sites

I think I will try the second method.  The use of javascript and ajax is already getting me confused :)

 

So to sum it up, could i do it like the following:

 

if(isset($_POST['submit'])) {

$query; // Run the query to the database.

echo "<meta http-equiv=\"refresh\" content=\"0;URL=www.google.com\">";
exit();

}

 

..Or is the above a total pile of rubbish?  Please bare in mind I've had a long day, I just really want to make this code work before I go to sleep, or I'll prob be up thinking about it all night.

 

Thanks for understanding.

Link to comment
https://forums.phpfreaks.com/topic/100014-new-page-opened/#findComment-511571
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.