Jump to content


Photo

Redirection problem php NEED SOME HELP PLS ???


  • Please log in to reply
14 replies to this topic

#1 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 14 October 2006 - 12:04 PM

Hi
I have auction script that I am working on, and I need some help with redirection.
I would like to redirect page like www.mydomain.com/item.php?id=12345 to www.mydomain/NEWDIRECTORI/item.php?id=12345
(Note that item.php?id=12345 is a some item that has been listed on that auction)
I did try to use .access file but I can not get it to work on individual item redirection it only works to redirect item.php and than redirects all items listed on auction to new directory not just one item that I want to redirect.
Thanks sinisaarijana@blic.net


#2 dymon

dymon
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 14 October 2006 - 12:13 PM

You can try to use a redirection like this:

header ("LOCATION: NEWDIRECTORI/item.php?id=12345");

If I remember right you can not use a full URL(www.mydomain/NEWDIRECTORI/item.php?id=12345), in security reason.
Web is the future ... desktop will die ...

#3 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 14 October 2006 - 12:24 PM

You can try to use a redirection like this:

header ("LOCATION: NEWDIRECTORI/item.php?id=12345");

If I remember right you can not use a full URL(www.mydomain/NEWDIRECTORI/item.php?id=12345), in security reason.

Where do I insert this in what page?
Thanks


#4 joshi_v

joshi_v
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 14 October 2006 - 12:34 PM


Include this line after the code , from where you want to redirect the file.

#5 dymon

dymon
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 14 October 2006 - 12:35 PM

You should use this before any printing functions like: print, echo. Otherwise you willl get an error saying that the headers allready sent.

You could provide a piece of code where you want this redirection
Web is the future ... desktop will die ...

#6 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 14 October 2006 - 12:43 PM

You should use this before any printing functions like: print, echo. Otherwise you willl get an error saying that the headers allready sent.

You could provide a piece of code where you want this redirection


Hi thanks for the reply s
The real url of the page is http://ebajba.com/it...17a188ef5293a23
but I need this page redirected to http://www.ebajba.co...17a188ef5293a23

Which page would you like me to send the code from?
Thanks


#7 dymon

dymon
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 14 October 2006 - 12:49 PM

Did I understand ritght, you want this redirection from the PHP file or from somewhere else?

If from the file than provide the code for the first url (http://ebajba.com/it...17a188ef5293a23), and indicate where the redirection should be.

Or you want just a simple redirection, like if someone enters here url (http://ebajba.com/it...17a188ef5293a23), automaticaly to be redirected here  url(http://www.ebajba.co...17a188ef5293a23)? If so just live the page item.php empty, just write in it:
header ("LOCATION: NEWDIRECTORI/item.php?id={$_GET['id']}");

And this should work.
Web is the future ... desktop will die ...

#8 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 14 October 2006 - 01:01 PM

Did I understand ritght, you want this redirection from the PHP file or from somewhere else?

If from the file than provide the code for the first url (http://ebajba.com/it...17a188ef5293a23), and indicate where the redirection should be.

Or you want just a simple redirection, like if someone enters here url (http://ebajba.com/it...17a188ef5293a23), automaticaly to be redirected here  url(http://www.ebajba.co...17a188ef5293a23)? If so just live the page item.php empty, just write in it:
header ("LOCATION: NEWDIRECTORI/item.php?id={$_GET['id']}");

And this should work.


I need that simple redirection but I can not live it empty, as there is only one item.php file and the id?=12345 (I get once I create new auction)
Please note that is one item that is listed in two different directories but it comes from one DB but difference between those directories is in (template_item_php.html file) as on firestone users can bet on item for free but on second one it is not for free


#9 dymon

dymon
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 15 October 2006 - 06:45 AM

I am a bit confused on what you want to do. Try to explain with more details and some examples, because I don't understand where you want this redirection. Try the code I wrote you in a blank page and see how it works and if it can help you.

Regards
  Dymon
Web is the future ... desktop will die ...

#10 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 15 October 2006 - 04:39 PM

I am a bit confused on what you want to do. Try to explain with more details and some examples, because I don't understand where you want this redirection. Try the code I wrote you in a blank page and see how it works and if it can help you.

Regards
   Dymon


Hi, it is bit confusing but here I will try to explain
I have auction web site www.ebajba.com  but also I have created new directory www.ebajba.com/phonauct  Now both of those sites have the same users, files, settings, itc… as the second site is just a copy of the first one and both sites are based on one DB directory. Now in second site I have created some modifications in the template_item_php.html file so when users try to bet on item they will have to pay for it as on the first one this function is for free. But none of these users do not know that second page exists. The thing that I want to do is that on some auctions on my first site I can set redirection so when user clicks on some item auction so that he can see its description I would like to redirect him to that the same item but on second page so if he wants to place bet on it he would first have to pay. So my problem is how to set up redirection of some item description page to its description on second site. I did try htacces file but it is not functioning for some reason
My htaccess file is:
RewriteEngine on Redirect item.php?id=dbc3cf805a08599972f031e6a7f21a95 http://www.ebajba.co...2f031e6a7f21a95

Regards
Sinisa


#11 dymon

dymon
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 15 October 2006 - 05:38 PM

Hi,

you could use JavaScript for this:

<a href="#" onClick="location.href='http://www.ebajba.com/phonauct/item.php?id=dbc3cf805a08599972f031e6a7f21a95'">The item you need</a>

try to use this and write the results.
Web is the future ... desktop will die ...

#12 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 15 October 2006 - 06:37 PM

Hi,

you could use JavaScript for this:

<a href="#" onClick="location.href='http://www.ebajba.com/phonauct/item.php?id=dbc3cf805a08599972f031e6a7f21a95'">The item you need</a>

try to use this and write the results.

Hi
I can not insert this script anywhere as the title of the auction or (The item you need) and its hyperlink is created automatically when user creates new auction and this link appears on many pages when users browse the site, I need something like htaccess that will work for redirection of that link no meter from which page users click on this link
Thank you

#13 sinisa

sinisa
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 16 October 2006 - 12:10 AM

Hi,

you could use JavaScript for this:

<a href="#" onClick="location.href='http://www.ebajba.com/phonauct/item.php?id=dbc3cf805a08599972f031e6a7f21a95'">The item you need</a>

try to use this and write the results.

Hi
I can not insert this script anywhere as the title of the auction or (The item you need) and its hyperlink is created automatically when user creates new auction and this link appears on many pages when users browse the site, I need something like htaccess that will work for redirection of that link no meter from which page users click on this link
Thank you


ANY IDEAS PLEASEEEEEE? :'(

#14 joshi_v

joshi_v
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 16 October 2006 - 09:38 AM

Hello,

Can u post a piece of code of u r first file and the second file name.So that any one could understand what u r trying to do.


Regards,

Joshi.

#15 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 16 October 2006 - 09:56 AM

There you go that easy ok.

<?php
header("location: www.mydomain.com/item.php?id=$id");
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users