Search code examples
phphyperlinkauto-increment

Redirect to next page and increment page id


I have a link scanner in php, after checking current URL that looks like this

mydomain.com/scanner.php?url=http://external-domain.com/index.php?article_id=15423

The script should go to the next url by incrementing the article_id value with 1. I tried with a simple +, page_id=15423+1 but it can't generate the next id which should be 15424.

Any idea what should I try?


Solution

  • You can use this:-

    $value=current_value;
    $value=$value+1;
    header("location:http://mydomain.com/scanner.php?url=http://external-domain.com/index.php?article_id=" . $value);