vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   new to php (https://vborg.vbsupport.ru/showthread.php?t=50726)

Mickie D 03-23-2003 06:52 PM

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 :(

Xenon 03-23-2003 09:07 PM

the eval code must be below the define of goodspot.

Mickie D 03-23-2003 09:20 PM

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 :)

Mickie D 03-23-2003 09:28 PM

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

Mickie D 03-23-2003 09:45 PM

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 :)

colicab-d 03-23-2003 10:10 PM

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

Mickie D 03-23-2003 10:14 PM

sorry m8 that went a little over my head ... do you mean make bigger arrays ????

with all the names in one array ???

colicab-d 03-23-2003 10:26 PM

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"

Mickie D 03-23-2003 10:58 PM

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

colicab-d 03-24-2003 08:03 PM

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
  • Page Generation 0.01784 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete