The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
pass url to php
i need to pass a url to a php page and i need the php tag to take the code in the url and perform an action on the page
ok let me explain a little better if a member clicks this link below http://www.mysite.com/forum/store.php?item=ipod i want to be able to send that url to the store.php and where it says ipod i want the php page to display ipod listings from my store i am not bothered about displaying the stuff as i can work that but i need to know how to make urls be able to make the php page work (i know it already works because the search engine on that page can display all this from my store page) i know some php but i would really appreicate some help with this Regards Mickie D |
#2
|
|||
|
|||
PHP Code:
|
#3
|
|||
|
|||
yeah cheers danny i was reading through the php manual and found the
PHP Code:
and one last thing can you tell me what the clean_gpc code at the top does thanks very much for the reply im very greatful because i dont know alot of the vbulletin built in codes as much as i am confident with the php stuff and one last thing aswell can you tell me would it be easier to make a switch if i have alot of codes instead of using lots of if's and can you tell me the best way to do it in vbulletin Regards Mickie D |
#4
|
|||
|
|||
PHP Code:
About the $vbulletin->GPC thing, your code must follow this standard or else the code will not work. The sanitized variable resulting from the $vbulletin->input->clean_gpc() is assigned to it. However in the case of checking if the request == something, you can still use $_REQUEST['whatever'], but I would reccomend following vbulletin's coding standards and using $vbulletin->GPC[]. |
#5
|
|||
|
|||
one last last thing and i will be so happy lol
i have been trying to take a profile field (which i made [field5]) but when i try and make the url in the postbit template http://www.mysite.com/forums/store.php?item=$post['field5'] i get an error in the templates about a parse error and also is that the right conditional to get the profile field entered into a url so it can add to the rest of my code ? thanks again for the help |
#6
|
|||
|
|||
Hm, I'm not really sure if the below will work but try:
PHP Code:
|
#7
|
|||
|
|||
managed to get it working with the $post[field5] but me being silly and jumping the gun found out that it posts the url as it should but the script does not recognise the actual $post[field5] because its not been added by myself in the if statement
i could never add them all to the php file it would be silly and we have alot of signups all with different stores (hence what the $item is for) is it possible to make the script turn anything that is entered in a url be searched for as $item instead of having to know from the script what it is ? i.e http://www.mysite.com/forums/store.php?item=anything and then it will search a product (because i can search using a form from my search page aimed at its self (store.php) and it will look for anything because in the form the variable is $item) but thanks very much danny you have been a great help and made me code nice and tidy Regards Mickie D |
#8
|
|||
|
|||
Well you would do some sort of mysql query using a where clause and the 'anything' being what it's looking for.
|
#9
|
|||
|
|||
Quote:
you mean like because the profile field is stored in the database i can do a call to the database looking for the profile[field5] and then returning that as the $item ill get looking into this im not great with mysql but i know where to start and you have helped me greatly. top man danny can see why you are a mod here ! Regards Mickie D |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|