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 10-21-2013, 08:40 PM   #1
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
super quick php question

Code:
	preg_match('/(USPS|UPS)\s+?(Postal|Ground|Priority)\s/i',$page,$matched);
					if (isset($matched[1])) {
						$shipper = $matched[1];
					}
					if (isset($matched[2])) {
						$shipping_method = $matched[2];
					}
I want $shipping_method to be redeclared as 'USPS Priority' if it is previously declared as 'Postal' I made the below if statement to redeclare it but it is basically declaring it no matter what, even if it was original declared 'Ground'. I know I am missing something really simple. Any help? Programmer is offline and wanted to get this done tonight.



I added

Code:
		if ($shipping_method='Postal')
					{
						$shipping_method='Priority Mail';
					}
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-21-2013, 08:50 PM   #2
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,066
if ($shipping_method='Postal')

should be:

if ($shipping_method=='Postal')

= is an assignment

== is a comparison

.

Last edited by sarettah; 10-21-2013 at 08:51 PM..
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-21-2013, 08:54 PM   #3
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
awesome, knew it was something simple, almost tried the == too thx so much
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-21-2013, 08:55 PM   #4
fitzmulti
I Like Depth Of Field!
 
fitzmulti's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: Las Vegas, NV, USA: 36.12318 N, 115.090219 W
Posts: 14,861
Neat. Actual help w/o BS in a thread!
Nice, sarettah ;-)
__________________


www.SexyGirlsCash.com


CONTACT // FITZMULTI AT GMAIL.COM //
{Please include a message so I know you are from GFY! I get too many spam "add requests"!}
fitzmulti is offline   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.