|
Web design and Programming Discuss website creation and other programming topics. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Help Me Please!
Anyone know wtf is wrong with this? I have no errors but it is not working when I type in the filename and ?view=search nothing happens!! See anything wrong?
PHP Code:
__________________
![]() ![]() ![]() ![]() |
#2
|
||
|
to access the submitted variable you use
PHP Code:
PHP Code:
Or, put this line at the begining of your script (I got it from the babstats code, and I use it a lot) PHP Code:
So using "script.php/?view=test" in your script you can use the variable "$view" and it will contain the value "test". Same thing applies to post variables, just substitute $HTTP_GET_VARS with $HTTP_POST_VARS, or if you use my first example $_POST['variable name']. Hope this helps, IcI |
#3
|
||
|
OK. Thanks for input.
I think my problem is that it is it is executing the if statements even if it is not falling under the if conditions. I'll mess around with your technique, is anything in my code bad that would cause if to execute everytime? Yah so if I put $view="search"; right into the code it will execute the first IF anyway.
__________________
![]() ![]() ![]() ![]() |
#4
|
||
|
hmm... it is displaying every thing, even when I try using view=search..
|
#5
|
||
|
Yeah, so it is screwed.
I put in the bottom If: echo ("goober"); and it did that too.
__________________
![]() ![]() ![]() ![]() |
#6
|
||
|
nvm, I think I fixed that part too...
use if ($view == "main") and if ($view == "search"), etc. IcI |
#7
|
||
|
hmm I thought I tried that.
__________________
![]() ![]() ![]() ![]() |
#8
|
||
|
NM it be working...thanks.
__________________
![]() ![]() ![]() ![]() |
#9
|
||
|
use this... note the ELSEIF statement... extract($_GET); is a simple way of doing
if($HTTP_GET_VARS) foreach($HTTP_GET_VARS as $Key=>$Value) $$Key = $Value; //code.. extract($_GET,EXTR_SKIP); If($view=="blah") { //do blah } Elseif($view=="blah2") { //do blah2 } Elseif($view=="blah3") { //do blah3 } Else { //do main } ![]()
__________________
![]() 04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#10
|
||
|
just curious, which would be better the if...elseif or using switch?
|
#11
|
||
|
everyone asks me that but i don't know which is better and why.. i think it's mostly just preference.. i personally like if and elseif
__________________
![]() 04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#12
|
||
|
i like if and else if, but if i make functions i simply do a switch... don't ask me why...
|
#13
|
||
|
![]()
__________________
![]() ![]() ![]() ![]() |
#14
|
||
|
redirect the forum variables?
what do you mean? |
#15
|
||
|
i believe if i understand, you could use a $_GET[]; ...
|
#16
|
||
|
Just part of my old post.
I just need to get a redirect script. It is simple... if I want the script to search the forum and the tutorial database... I just need to make it redirect to the search page with the variables in the address bar.
__________________
![]() ![]() ![]() ![]() |
#17
|
||
|
use get with hidden fields? like on our map db?
__________________
![]() 04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#18
|
||
|
Well if I am going to use hidden fields in the redirect page how do I use the get part of a form? I am confused.
__________________
![]() ![]() ![]() ![]() |
#19
|
||
|
i think it's like this
Code:
<input type="hidden" value="whatever" name="search_property"> |
#20
|
||
|
Yeah I know that part but how do I get the action so that it does it automattically?
__________________
![]() ![]() ![]() ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|