![]() |
new to php
i am making my own little programme for my members
lets start from the start: my members would like a page where they could put in a location and on the other page it shows good places around that area... this is how my code looks so far <?php include("global.php"); eval("dooutput(\"".gettemplate("places")."\");"); ///// START PLACES CODE ///// if ($Your_Town == "London") { $GoodSpot = "Bagleys night club"; } ///// END PLACES CODE ///// ?> this is all called from a "post" command and a text box on the page b4 this, so if they put london i want it just to say bagleys i know if i was not using the forums templates i could put print ="bagleys"; and just have a normal php page ... but i really like it intergrated into my forums, please help :) can someone tell me how to get it to print from the templates $goodspot i have put $goodspot in the template for this page but it wont get it :( |
the eval code must be below the define of goodspot.
|
thanks very much for your help could you just show how you mean i been learning php for 5 days now :)
i think i am learning fast, but i really could do with a bit of help thanks :) |
yes i got it to work ;)
thanks so much :) you are fantastic, thanks again i will be posting in here quite a bit so i will appologise now lol |
right i am using this code below but i get the same result from my page no matter what i put in it :(
the result is always your town is Manchester you should try bagleys night club here is the code if ($Your_Town == "London" or "london") { $goodspot = "bagleys night club"; } elseif ($Your_Town == "Manchester" or "manchester"){ $goodspot = "space consala"; } please note i am using another page b4 this one, and it uses a html form to post the $Your_Town infomation :) |
hey what you should do is create a form with lots of values in it for (name of each town) and that way the forms name=name will be $name and you can then have it user enabled :D
|
sorry m8 that went a little over my head ... do you mean make bigger arrays ????
with all the names in one array ??? |
yeah basically like do a mutli selection form and anyvalue set in that will then equal one $city instead of defining lots of seperate $londons , $manchester etc
you can have have (im too tired for exact code) if $city = london { echo "london is big"; } else echo "your town is poop" |
you cant use echo in a page that is intergrated into the forums because of the templates :(
but i have it sorted thanks to bane it was my coding i had the "London" or "london" and it never understood, so bane gave me a code that stoped the matter for capitolization (if thats how you spell it lol) working like a dream |
erm yes you can ive been writing admin cp hacks and echo is working fine for me lol
|
All times are GMT. The time now is 03:28 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|