Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-08-2009, 09:51 AM   #1
dirtysouth
Confirmed User
 
Join Date: Jul 2003
Location: Mobtown
Posts: 2,613
Story of my life! Little PHP help. WTF is wrong here?

Simple simple little script here has been giving me fits for 2 days. Any help is GREATLY appreciated.

I have a simple form like this:
Code:
<form action ="div2.php" method = "POST" />
	Div:  <select name = "div">
			<option value = "" selected>Choose Division</option>
			<option value = "div1">1 - 9</option>
			<option value = "div2">10 - 14</option>
			<option value = "div3">15 - 19</option>
			<option value = "div4">20 - 24</option>
			<option value = "div5">25 - 29</option>
			<option value = "div6">30 - 34</option>
			<option value = "div7">35 - 39</option>
			<option value = "div8">40 - 44</option>
			<option value = "div9">45 - 49</option>
			<option value = "div10">50 - 54</option>
			<option value = "div11">55 - 59</option>
			<option value = "div12">60 - 64</option>
			<option value = "div13">65 - 69</option>
			<option value = "div14">70 - 74</option>
			<option value = "div15">75 - 99</option>
			</select>
Note it POST's to div2.php. Here's the code on div2.php:

PHP Code:
print_r($_POST);
echo 
$div;


if(
$_POST['div'] = 'div1') {
    
$q "BETWEEN '1' AND '9'";
}    elseif (
$_POST['div'] = 'div2') {
      
$q "BETWEEN '10' AND '14'";
    }    elseif (
$_POST['div'] = 'div3')    {
        
$q "BETWEEN '15' AND '19'";
        }




echo 
$q;
echo 
$div
Notice I'm using print_r['$_POST'] to show the array. Here's the result:

Array ( [div] => div2 [race] => thin2009 [search] => Go! ) div2BETWEEN '1' AND '9'div2

Why the fuck is the if elseif not working? notice it's returning the same result no matter what division they choose, ie: choose div2 and it SHOULD switch $q = BETWEEN 10 AND 14.

WTF? There's no whitespaces around the POST values. Already checked. Thanks in advance gurus!
__________________
no sig
dirtysouth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 09:55 AM   #2
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
Should it be "==" to determine the "if"?
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 09:59 AM   #3
RadicalSights
So Fucking Banned
 
Industry Role:
Join Date: Mar 2009
Location: Europe
Posts: 1,595
you fail at php
RadicalSights is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 10:00 AM   #4
dirtysouth
Confirmed User
 
Join Date: Jul 2003
Location: Mobtown
Posts: 2,613
Quote:
Originally Posted by PR_Tom View Post
Should it be "==" to determine the "if"?
HOLY SHIT man. What a stupid ass mistake! That did it. Damn man can't thank you enough. Love this place sometimes!
__________________
no sig
dirtysouth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 10:01 AM   #5
dirtysouth
Confirmed User
 
Join Date: Jul 2003
Location: Mobtown
Posts: 2,613
Quote:
Originally Posted by RadicalSights View Post
you fail at php
And?

Wish I was a smart as you but oh well! The world needs stupid people like me too right?
__________________
no sig
dirtysouth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 10:02 AM   #6
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
Cool If you put the value you are checking against BEFORE the variable, then PHP would have generated an error. I'm not as clear as this:

http://www.php.net/manual/en/control-structures.if.php

Scroll down to the example by person called grawity.
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 10:04 AM   #7
dirtysouth
Confirmed User
 
Join Date: Jul 2003
Location: Mobtown
Posts: 2,613
Quote:
Originally Posted by PR_Tom View Post
Cool If you put the value you are checking against BEFORE the variable, then PHP would have generated an error. I'm not as clear as this:

http://www.php.net/manual/en/control-structures.if.php

Scroll down to the example by person called grawity.
Right on. Tried shifting things around to try and generate an error but never got one. Thanks for the link!
__________________
no sig
dirtysouth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 10:07 AM   #8
TurboAngel
H.B.I.C.
 
TurboAngel's Avatar
 
Industry Role:
Join Date: Jun 2003
Location: NC
Posts: 30,122
Quote:
Originally Posted by dirtysouth View Post
HOLY SHIT man. What a stupid ass mistake! That did it. Damn man can't thank you enough. Love this place sometimes!
GFY is great.


TurboAngel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-08-2009, 10:08 AM   #9
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Honest mistake, happens to me a lot.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.