
allworknoplay
Members-
Posts
385 -
Joined
-
Last visited
Never
Everything posted by allworknoplay
-
I think it's this line... Attach($_FILES['userfile']['tmp_name'][$key],$_FILES['userfile']['name'][$key]);
-
Thanks 2 questions.. 1) Should PHP output some kind of warning or error for this? $global_obj->my_value = 10; I mean, the "$global_obj->" doesn't even exist, yet alone allow you to set it a value to 10. 2) $a->my_value = 5 The class "my_class" has no property called "my_value", so I thought it should output an error? I thought properties had to be declared in classes before you can use them, let alone try to set a value? Is PHP implicitly creating the "my_value" for you in the "my_class" class?
-
I'm stumped. Hopefully someone who's had a lot of experience writing mail programs can chime in. I'd like to know myself as I know I will have to deal with this issue myself one day.....
-
Sorry for asking this, when I run it, the output is "5". But how is that possible? It seems like horrible code...then again I am still learning OO myself.. Could someone please explain to me how this code even works? <?php $global_obj = null; class my_class { var $value; function my_class() { global $global_obj; $global_obj = &$this; } } $a = new my_class; $a->my_value = 5; $global_obj->my_value = 10; echo $a->my_value; ?>
-
if (trim($_POST['age']) < 18) { echo "your statements here" }else{ header("Location: http://www.wokinghambikeathon.co.uk/register2.php"); }
-
You can grab whatever you want from another site if you know what you are looking for. But you can't grab variables since sites don't output variables they output the VALUE...
-
$http = "http://"; $www = "www"; $link = "some link"; if(strstr($link,$http) || strstr($link,$www)) { $new_link = "http://www" . $link; }
-
Hmm try removing the quotes just to see if it works... so just make it ($DBname,$db) Not sure why it won't work for you because I use this file all the time for my projects.
-
Ok so did you fill out your variables correctly? $select_db = mysql_select_db("$DBName","$db"); $DBName and $db....
-
Form input not sending to email address
allworknoplay replied to jprahst32's topic in PHP Coding Help
No problem... -
bad query...use this: <?php $query = "SELECT * FROM `phpforum_tutorial` WHERE `postid` = $id AND `area` = math"; ?>
-
Form input not sending to email address
allworknoplay replied to jprahst32's topic in PHP Coding Help
Well first of all, I'm just guestimating your issue since you haven't provided your code. But assuming your code is fine.. 1) if your domain is called: abc.com You have to call your ISP and create MX records and RDNS that points to abc.com so that mail coming from their server is checked properly against SPAM filters. 2) It takes at least 24 hours for info to propagate the internet so you won't see results right away... -
Now for your main file use this: <? // functions.php is required to connect to the database as usual require("./config/functions.php"); $link_id = dbconnect(); $query = mysql_query("SELECT * FROM `hp_flights` where flightnumber='".$DATA2."'"); $num_result = mysql_num_rows($query); if ($num_result > 0) { for ($i=0;$i<$num_result;$i++) { $result = mysql_fetch_array($query); echo "1|flightplan\n"; echo $result['departure']."\n"; echo $result['destination']."\n"; echo $result['alternate']."\n"; echo $result['route']."\n"; echo $result['pax']."\n"; echo $result['cargo']."\n"; echo $result['rules']."\n"; echo $result['aircraft']."\n"; } } else { echo "0|Flightnumber not found"; } ?>
-
That's because your DB file is wrong. Here's what you need to do. <?php function dbconnect() { Global $DBHost, $DBUser, $DBPass, $DBName, $dbconnect; $DBHost = 'host'; //Your host, usually localhost $DBUser = 'username'; //Your database username $DBPass = 'pass'; //Your database password $DBName = 'dbname'; //The database name you want/have the user system on $db = mysql_connect("$DBHost", "$DBUser", "$DBPass"); if (!$db) { echo "connect: mysql_error()"; exit; } $select_db = mysql_select_db("$DBName","$db"); if (!$select_db) { echo "select: mysql_error()"; exit; return ($dbconnect); } } ?>
-
Form input not sending to email address
allworknoplay replied to jprahst32's topic in PHP Coding Help
Yeah it's possible it's a reverse DNS issue. why it works for you locally, not sure why. But you can't willy nilly just create a form to send email unless your DNS and MX Records are setup properly at your ISP.... -
what does your functions.php look like? Are you getting any mysql errors?
-
Thank you!!
-
How about a little debugging.. Since your can't send the files, that pretty much means they aren't going into your array. Can you print out your array and make sure it's empty or not empty?
-
Well if you're not going to go the XML route then the best you can do is read the sister site and parse through the HTML code for everything that you are looking for, without any standard structure, that's going to be a pain...
-
Ok, in your php.ini do you have this set? file_uploads = On
-
What is your POST like in your FORM tag? are you using this? enctype="multipart/form-data"
-
Sorry bro, I would help you but that's quite a bit of code and I'm not very good with attachments just yet. I do see that you have the content type set correctly, or so it seems... Is "r" the right option? $fd = fopen($AttmFile, "r"); Maybe try "a+" ??
-
When I use that function, I get 65536 instead. "pow(16x4)" VS "16 << 4" So the first one, I think is doing 16x16x16x16 which gives me 65536... The second one is 256...
-
hahaha, I should have tried that, yes it is 256....I just want to make sure I get my facts straight, I'm basically saying, 16 to the power of 2, four times? 16 * 2 = 32 32 * 2 = 64 64 * 2 = 128 128 * 2 = 256
-
Sorry for this dumb math question, but what is the answer to this? $i = 16 << 4; Is $i = 256? I know that the left shift operator multiplies an integer by the powers of two and I have never been great at math...