|
-
Mar 8th, 2003, 02:35 PM
#1
Redirecting to an other URL....
I am not 100 % sure if this is a PHP or HTML question. But I am posting it here.
I am still working on my searching engine. And I have it working, but I want to modify it a bit. When you are searching this forum, you will first have a page up saying something like searching. And after it is finished then it is showing the results. How can I do that??? How can I redirect the page from the "Searching" page to the page with the results, and at the same time sending the results in variables????
-
Mar 9th, 2003, 09:08 AM
#2
Conquistador
header("location: blah.htm");
might work..
you could also write to the html document, when it's finished loading
<script>
window.location = "http://www.newlocation.com/";
</script>
Something like that might work..
-
Mar 9th, 2003, 09:27 AM
#3
So I guessed right. It wasn't PHP...but it seems to be working. I have to do some test later tonight. But thanks.
-
Mar 9th, 2003, 09:18 PM
#4
Conquistador
No worries
-
Mar 10th, 2003, 08:13 AM
#5
Stuck in the 80s
You could also use a meta refresh (like vbforums):
Code:
<meta http-equiv="Refresh" content="2; URL=http://www.blah.com/blah.html">
-
Mar 10th, 2003, 12:56 PM
#6
Yeah I was thinking of that. One of my friends made a script with meta refresh that autoamtically voted on a web page once...That was fun...the other band got 5000votes...my friends band got 1 000 000 votes...and that was on Norways biggest TV channels web page...
BTW nice avatar Hobo....
-
Mar 11th, 2003, 12:58 AM
#7
Conquistador
surely the poll should've required unique ip votes :|
-
Mar 11th, 2003, 02:37 AM
#8
Yes, but they didn't. I think they wanted people to spend time voting on their page. But I don't think that they thought of the possibility of being "hacked"...
-
Mar 11th, 2003, 02:45 AM
#9
Conquistador
it's more like exploiting it, not hacking it
it'd be hacking if you deleted all votes for the other band..
-
Mar 11th, 2003, 03:06 AM
#10
That is why I did put up the " " on the word. I know it's not hacking, but I'm not so good in English so hacking was the closest word I found...
-
Mar 13th, 2003, 10:23 AM
#11
Originally posted by da_silvy
header("location: blah.htm");
might work..
you could also write to the html document, when it's finished loading
<script>
window.location = "http://www.newlocation.com/";
</script>
Something like that might work..
OK...now I have tested it...and I have an other question. On the first page a person writes in a text tin a text box. He clicks submit, and it moves to the next page. With the variable. THen when he is finished searching, he moves to the next page. But then without the variable....is it possible for me to move the variable over to the 3. page???
-
Mar 13th, 2003, 02:36 PM
#12
Stuck in the 80s
You could either save to a database as you go and then delete the entry when you're done.
Or you can keep printing the values to each page, such as:
Code:
<?php
echo '<input type="hidden" name="age" value="' . $_POST['age'] . '">';
?>
Something like that.
-
Mar 13th, 2003, 05:06 PM
#13
Sorry but I am a kind of dumb here....but from the first page to the second one. It ads my variable name and variable value to the "address". If I use your line like this:
Code:
<?PHP
echo '<input type="hidden" name="author" value="massive">';
?>
<script>
window.location = "http://www.klubbscenen.com/searchpage2.php";
</script>
it doesn't do that. Is that becuase of the type is hidden? What should it be I want to see it in the address bar?
-
Mar 13th, 2003, 05:42 PM
#14
Frenzied Member
yoyu can't submit a form element just by doing a window.location.
if you want it in the address bar then you have to append it to the url.
not sure why you are using this but ok
<script>
window.location = "http://www.klubbscenen.com/searchpage2.php?val1=1&val2=2&val3=3...etc";
</script>
-
Mar 13th, 2003, 05:54 PM
#15
OK...here my problem is....I want a "waiting screen" to appear when my searching engine is searching my webpage. So my first though was that I had to send the search word to the waiting screen (this works fine). Then my PHP code would seach the site for that word (this works fine), but then I have to open up a new PHP site to show the results. So then I have to send the results to that page too...and I don't get how...Can anyone help me, or have an other idea on how to do this???
<script>
window.location = "http://www.klubbscenen.com/searchpage2.php?val1=1&val2=2&val3=3...etc";
</script>
I thought of that too...but I can't have the script in the PHP code, and my variables are losing scope ater the PHP tag is finished doesn't it??? Or can I use my PHP variables like you did in the Script???
-
Mar 13th, 2003, 06:06 PM
#16
Stuck in the 80s
You missed my suggestion completely.
The hidden field has to be within a form.
And the form needs to be submitted.
-
Mar 13th, 2003, 06:10 PM
#17
I actually saw that in my PHP book right now. So I gusess that I am not any closer to any solution yet...Becuase I can't use a submit button on the searching(the page where the user is sitting back and waiting for the result) page..
So how do this forum or any forum do this??? Anybody know?
-
Mar 13th, 2003, 06:20 PM
#18
Stuck in the 80s
Why do you want a waiting screen in the first place?
All it does is delay the user from getting to the results. There isn't anything going on in the background, the search is already complete.
It's just a waste of time.
Google, Altavista, Yahoo, MSN...they don't have waiting pages. They realize it's a waste of time.
Why do you want one? Because it's different or looks cool?
When you print your waiting page, use the meta refresh like I said:
Code:
<?php
$url = "http://www.blah.com/blah.php?search=" . $_REQUEST['query'];
echo '<html>
<head>
<meta http-equiv="Refresh" content="2; URL=' . $url . '">
</head>
<body>
Your search is in progress, please wait, blah blah...
</body>
</html>';
?>
So when it goes to the next page, it has the query.
If you can't figure out what I'm talking about or how to do it, you need to go learn some basic programming concepts.
It's not that hard to figure out.
-
Mar 13th, 2003, 06:27 PM
#19
I understand that code. Thanks you are great. I actually havn't though about pages like yahoo, altavista and other pages. I just though of other PHP forums like this one. So now I am not sure if I want that waithing page at all....but I will do some test and see what I will end up with.
Thanks
-
Mar 14th, 2003, 12:25 AM
#20
Frenzied Member
this forum doesn't have a waiting page. it has a page that delays you and tells you the search is started. then when it refreshes the search actually begins. like Hobo said, the waiting page is nothing, nothing is happening. then all they use is a meta tag refresh with the url of the search page. most of the time the waiting page is setting a cookie or something.
-
Mar 14th, 2003, 06:28 AM
#21
Thanks guys, you have been really helpfull. So I think I will drop the whole waiting screen....thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|