-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Ah I know why. You named your submit button "button" not "submit" so your condition never evaluates true
-
You wrote your ternary wrong. It should be $_GET['user'] = ($_GET['user'] == NULL) ? 'roflwaffle' : str_replace(' ', '_', strtolower($GET['user'])); Assuming that you were wanting to assign 'roflwaffle' to it if it's null, str_replace if not.
-
look at the colors of that text string you will notice right there at the end "red" is in blue that's an indication that your quotes aren't right. Change the quotes around red to single quotes.
-
well I'll start out by saying that if($user_count = 1) needs two = signs like this: if($user_count == 1) = is assignment operator, == is equality operator. And I assume that since your form action is login.php that this script is login.php?
-
Look, I'm gonna be straight with you: You should be asking for 3rd party script help at the forum/community from which it came. You're more likely to get a solid answer from there. Nobody wants to look through a bunch of code for you when you yourself don't know what's going on. We can't ask you where xyz is coming from or why xyz is doing this or that, because you yourself don't know. This place is a free service, so we aren't going to waste our time on that sort of thing. Having said that, asking for help on a 3rd party script runs dangerously close to being considered freelancing. Therefore, moving threads like that to a 3rd party forum is doing you a favor - because otherwise we would just close your thread and tell you to hire someone. Overall, the 3rd party forum is a courtesy. Maybe someone might possibly have used / is using that script, and they might help you. I doubt it, but who knows? Point is, it's our way of saying that we aren't going to waste our time on that, post over there and hope for the best, buck up and learn it yourself, or hire someone. It's nothing personal, but you apparently don't seem to understand how free services work, because you seem to keep breaking the rules trying to get "your way."
-
Ok I Went to Die This Var and I got an Error In my DB_CONNECT
.josh replied to Dethman's topic in PHP Coding Help
It returns false if nothing is returned from the query. Otherwise, it returns the fetched results. If you had bothered to actually look at the code you would see that. -
Ok I Went to Die This Var and I got an Error In my DB_CONNECT
.josh replied to Dethman's topic in PHP Coding Help
Umm...grow up? Do you want help or not? I saw your original unedited code without the $r. Thorpe even commented on it. You went back and changed it after the fact. If it didn't work, then fine, just say it didn't work so we can figure out where the issue is; don't be all childish. -
Ok I Went to Die This Var and I got an Error In my DB_CONNECT
.josh replied to Dethman's topic in PHP Coding Help
Anyways, did you try return $r; ? -
Ok I Went to Die This Var and I got an Error In my DB_CONNECT
.josh replied to Dethman's topic in PHP Coding Help
You use the exact same code in one of your games, and your game works and yet this doesn't? Hmm, that's very interesting. -
Ok I Went to Die This Var and I got an Error In my DB_CONNECT
.josh replied to Dethman's topic in PHP Coding Help
well of course it's not displaying anything. You haven't echoed anything out. -
<?php $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); $query = "SELECT * FROM product_test"; $result = mysql_query($query) or die ("Error in query" . mysql_error()); while($row = mysql_fetch_assoc($result)) //for each entry in the product table { //Fetch Model $file = $row['model']; //Path to txt files $dir = './shortdesc'; //Use Model and create a filename $filename = "$dir/$file.txt"; // read into a string the file contents $contents = (file_exists($filename))? file_get_contents($filename) : ''; //write it back into the table in the description column - whatever it is called $updateQuery = "UPDATE product_test SET description_short = '$contents' WHERE model = '$file'"; mysql_query($updateQuery) or die ("Error in UpdateQuery" . mysql_error()); } ?>
-
I bought a dynex 37" lcd earlier this year (model# dx-lcd37 if you wanna google it). Not the best thing out there but I like it. Got it for like $600 I think.
-
not really a sql guru so I don't know if using LOAD DATA INFILE will be any help, but here's one thing you can do: Make a table with product name and description columns. For example lets call the table products and the columns product and description. I assume you will want to make the product column type varchar and the description blob or something. Also add an id column called product_id that's auto incremented, because you will probably make use of that later. Put all the files in the same directory as this script, and then run the script. runme.php <?php // connect to and select db. change it to your info $conn = mysql_connect('localhost','dbusername','dbpassword') or die(mysql_error()); $db = mysql_select_db('dbname', $conn) or die(mysql_error()); // for each file... foreach(glob("*.txt") as $filename) { // get contents of file into a string $content = file_get_contents($filename); // insert current file into table $sql = "INSERT INTO products (product_id, product, description) VALUES ('', '$filename', '$content')"; $result = mysql_query($sql, $conn) or die(mysql_error()); } // end foreach filename ?>
-
Multiplayer, simultaneous playing, multiple rooms. CHESS!
.josh replied to bilis_money's topic in Miscellaneous
For something like chess I would not recommend flash or Java, unless for some reason you wanted to focus on making it really flashy with lots of animation or whatever. If you're just looking to have a top view checkboard with little thumbnail pieces that dynamically move around onclick (or whatever), it would be way better to just use ajax. You're going to have to make use of a flatfile or database anyways (even if you go the flash or java route), in order to pass information back and forth between users. -
$get_topic_res = mysql_query($mysql, $get_topics_sql) or die(mysql_error($mysql)); You need to reverse the variables in your mysql_query argument. The argument should be querystring, connection $get_topic_res = mysql_query($get_topics_sql, $mysql) or die(mysql_error($mysql)); You also forgot the "s" in "topic". But that may not fix the problem. It for sure needs to be that way, but that may or may not be your only problem. If it still doesn't work (don't change it back), post the error.
-
it looks like your code checks whether your site has www. on it or not, but not any other ones, so your database could end up having at least http://www.somesite.com/ http://somesite.com/ in your table.
-
Creating a reservation system. In over my head.
.josh replied to ardyandkari's topic in PHP Coding Help
as for getting the month from your date: // example date $x = "2000-02-06"; // if you want the month numerically like "02" $now = date("m",strtotime($x)); // if you want the month alpha like "Febuary" $now = date("F",strtotime($x)); as for how to have indicators go on the calendar, what do you mean by "go on?" Are you wanting all your cabins to be displayed on each day of the month, with(out) an X next to them? -
[SOLVED] Has anyone made a function to merge more then 2 arrays?
.josh replied to Demonic's topic in PHP Coding Help
well if nothing else, you could just loop the array merge...guess it kinda depends on the naming convention of your arrays. -
assuming that that code is your index.php you need to actually echo out your message. You passed your message through the url via the GET method so you need to echo it out like so: echo $_GET['msg'];
-
sort, usort
-
Instead of that big condition statement that you will have to keep adding to as departments are added, just do this: $department = $_REQUEST['department']; $allowed = array('sales','marketing','support'); // add more departments here // change [email protected] to default email address $sendto = (in_array($department, $allowed))? $department . "@yoursite.com" : "[email protected]";
-
when you do $blah[something] php first checks to see if something is a constant. Since you did not make it a constant, it's throwing you that error. However, if php fails to find a constant, it will treat it will then attempt to use it as a string like $blah['something']. So...your code will work as intended, but you get that message. To fix it, use the quotes around it as njoj pointed out.
-
While you do have a problem with your query string (due to not using quotes properly), that is not what is causing the problem. The problem is that you are not successfully connecting to the database. Where is $mysql_connection being set? $mysql_connection should look like this: $mysql_connection = mysql_connect('localhost','dbusername','dbpassword'); // have to change the arguments to your info and then you need to select the database with $db = mysql_select_db('dbname',$mysql_connection); // have to change dbname to your database name
-
actionscript is based off javascript but seriously, why are we still comparing java to flash...? The OP was java vs. php and some dude misread and went on a rant about java vs. flash (which seriously, I don't see how the two can really be compared).
-
Okay for real, did you just like, drop it out of your hand while sitting in your chair, or did you like, open a cargo bay door and release it? What's the ship's year make and model? Is this a trick question? Because I have seen plenty of sci-fi movies where people have to be frozen into suspended animation in order to make this jump, so why would you be out of your pod? I mean, there's protocol for this, right? Tom would not be just randomly hitting the warp speed button without you knowing... Unless there was some kind of mutiny or maybe aliens are attacking and you guys are trying to get the fuck out of there, which leads me to ask: are you dropping the marble because you saw an alien and it was one of those knee-jerk reactions one does in a moment of shock, before he scrambles away? What do you mean by "drop?" Are you in space? Is there gravity or artificial gravity? Dropping something implies a "down" but "down," as we noted from Ender's Game, does not necessarily imply gravity. So if there is no gravity, "down" could be towards your enemies. So...were you in fact, throwing the marble at the aliens trying to chase you? Do you have some kind of info about marbles being fatal to aliens, or can this be further attributed to afformentioned knee-jerk moment? I bet you know something, don't you. The damn govt. is always hiding shit. Yeah I know all about that alien you got stashed in area-52. I bet that alien has a really big mouth and a really tiny throat, doesn't he. Really big, so you can easily throw something in it, but something small - just large enough to get stuck in the back of his throat, causing him to choke to death. Man, I thought you'd be using a frickin' laser by now, or something. So that's what happened: You were chilling with your friend Tom. Aliens attacked. Tom made a b-line towards the big red button, while you fended off aliens with your standard government issued marbles.