473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

PHP 'smart' Redirect?

Hi guys.

I created a login script that will be used to view different pages, and so upon successful login I need to make a code that searches for a page name with 'index' in it.
page names are like index2, index3, index4 etc, but never in the same location.

im creating a redirect by using the sleep function.

<?php
sleep(5);
$url_go = <search for the index page here, even though it has a number in it>
header("Location: '$url_go'");
?>

Reason for this is so that I can more easily use this script on a lot of pages without having to edit everything every single time there is a change etc.

thx for any replies
Jul 17 '09 #1
3 5621
dlite922
1,584 Expert 1GB
This is hardly a "script", why don't you just redirect when you know where you're going. PHP can't help you if you have no clue where your program should go.

For your numbered index solution, just use glob() to find a file that has the word index in it.

this script on a lot of pages without having to edit everything every single time there is a change etc.
If you're index file changes, why not just use your IDE's Replace_All function to change the name of the index file.

Let me know if this is your intention,



Dan
Jul 17 '09 #2
Thanks for the answer.

I really just need a function that searches for a file that has 'index' in it and will so forth redirect there, but I have no clue how it the code would look like as I have never tried the glob() function before.
Jul 17 '09 #3
Markus
6,050 Expert 4TB
Search for the function on php.net.

RTFM.

Mark.
Jul 18 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: hal | last post by:
I have an application that includes an activex component that consumes resources that must be released when the a page is unloaded. Toward this end I subscribe to the unload event of the body...
1
by: Hal | last post by:
My most sincere gratitude to anyone who can help me work around this! I have work that needs to be done in javascript on the client whenever a page is unloaded. To this end, I subscribe to...
1
by: Devin | last post by:
I am having a problem of SmartNavigation, wher eit works fine on the test server, but not on the server that I load it up to. I tried placing "page.smartnavigation=false" right before I redirect, but...
2
by: Juan Gil | last post by:
I am a programmer of asp.net, and i have a problem when in a page I set the smart browsing property to TRUE and I use Responser.redirect(url) it don't work, it only show a blank page. I need...
4
by: aschmidt | last post by:
Another bug in smart navigation. If smartnavigation is enabled in the page and session timeout occurs, the framework redirects you to wrong location of login.aspx page if you use Forms...
8
by: Axter | last post by:
I normally use a program call Doxygen to document my source code.(http://www.stack.nl/~dimitri/doxygen) This method works great for small and medium size projects, and you can get good...
33
by: Ney André de Mello Zunino | last post by:
Hello. I have written a simple reference-counting smart pointer class template called RefCountPtr<T>. It works in conjunction with another class, ReferenceCountable, which is responsible for the...
0
by: =?Utf-8?B?eGVudQ==?= | last post by:
I am working on a big business application (dot-NET 1.1+legacy stuff), which is deployed in "SmartClient/no-touch-deployment" model. For some time on we have a problem that nobody was able to...
0
by: Ekart Laszlo | last post by:
Hi, there We have currently a Java Applet based solution that we would like to rewrite to a .NET solution. The scenario is the following: 1. Starter Client application opens up a web browser...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.