-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
There have been plenty of times i went to respond to a post and i spent some time and effort on it, enough to where when i go to click on submit and it gives me that warning, I get rather upset because damn, I just spent all that time responding, and someone beat me to it. So I can see how people might be tempted to say "fork that, I just spent all that time posting, I'm sending it through anyways" -- But I do believe that it should be discouraged nonetheless. Why? Because come on, we're here to help and to learn, not have a post count race. If you want to race other people to a million posts, go to one of the more relaxed boards where things like that are more the norm.
-
Seeking Your Genius: Parse error: parse error, unexpected $ in ...
.josh replied to ridiculous's topic in PHP Coding Help
no. the $ is arbitrary and changes depending on the error. it points to the first thing it sees that is unexpected, following something you have done. so when you get an 'unexpected blah' error, look to the previous lines for your error -
sorry, my crystal ball is broken. you'll have to display some code.
-
but i thought due to a recent revelation, you were going to leave the design part alone and concentrate on the coding? I still think you are spreading yourself too thin. People keep telling you it's better to be really good at one or two things than try to learn everything. And I can tell you from firsthand experience the truthfulness of this. But I can afford to do that cuz I'm not trying to make a career out of any of it. Can you say the same?
-
yay pixel town! I almost decided to submit something for it a whiles back. But I just didn't feel my skills were good enough :(
-
ha! kirupa.com! that was the first place i ever went to when i first got into flash! awesome place! haven't been there in years. I wonder if they are still doing that pixel town project?
-
i see 2 ways of going about this: a) pick a crappy site and everybody has a go at making their own new and improved version of it, submit your entry, vote on the best one. b) pick a crappy site and we have a "team" of people all work on it together, kind of like on the linkie I had in my previous post, where a "team" of people go and re-do a home and make it better.
-
You need to at least learn the basics of the design part of flash first. The whole point of actionscript is making your design more interactive and have more advanced properties, like "gravity" effects, etc... Actionscript is useless if you don't know how to make shapes and symbols and work with the timeline and layers. If you really want to get into flash, then play around with the design first. Get to know the timeline and manipulating it, and layers and masks and stuff. Get to know your drawing tools. Get to know the properties for each one. Do some basic animation and then work your way up from there. Make a button or 2 that jumps to a different frame. Make a simple dropdown menu. My 2 cents.
-
i totally dig the idea. kind of like an [url=http://abc.go.com/primetime/xtremehome/]Extreme Makeover: Home Edition[/url] for websites. Extreme Makeover: Website Addition
-
[quote author=steelmanronald06 link=topic=110244.msg445272#msg445272 date=1159801839] she is! she is soo hot! ha ha! I would also say the lead singer of The Vincent Black Shadow is hot...almost as hot as C_V's little butterfly avatar ;) ha ha [/quote] omg stop staring at my avatar you perv ::)
-
if you say so...
-
when you assign the query to a variable, the query returns a result source. It's like a magician's hat where it's dark and mysterious inside and you can pull out all kinds of crazy things like row data and rabbits and stuff. So in order to pull the rabbit out of the hat, you must reach in and fetch it. Here is one example of how to do that: [code] $query = 'SELECT totals FROM alpha where UserID="1"'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); while ($list = mysql_fetch_array($result)) { echo $list['totals'] . "<br>"; } [/code]
-
It's probably been like that since the beginning when SMF was installed. The reason why nobody's really noticed until now (I just recently noticed him too) is because if you do a members search, you will see that out of all the members here, there are only 9 people actually in the guru post count range, and out of those 9 people, only 2 of them are not a mod, so their post count class is not over-ridden.
-
You are more than welcome to make a post in the freelance section if you wish to employ someone to make a forum script for you. Perhaps you will get lucky and someone will offer to do it for free - I doubt it though. And it's not that nobody wants to help, it's just that asking for help on making a forum is kind of like someone who's barely getting into algebra asking for help on solving some calculus problem. I suppose it kinda depends on how robust you want your forum to be, actually. I mean, a guestbook is more or less the most bare-bones version of a forum you can make. Maybe you should start by looking for a guestbook tutorial.
-
you need to setup some error checking for your form. wrap that thing inside some more conditioning. VERY basic example: [code] if (!$_POST['name'] or !$_POST['email']) { echo "please fill out your form"; else { if (mail($to,$subject,$message,$headers)) header("Location: thankyou.php"); else echo "A problem occured"; } [/code]
-
you are getting 2 emails because you are sending 2 emails. [code] mail($to,$subject,$message,$headers); // take out this line if (mail($to,$subject,$message,$headers)) header("Location: thankyou.php"); else echo "A problem occured"; [/code] you need to take one of them out. i suppose you should take out the first one, so as to leave in some error handling. Also on your else statement, move the " you have your quotes wrapped around echo. (I changed it in the code I listed, for reference).
-
okay that script in and of itself does not need the ob_start/ob_end_flush functions. Is this script a code block in a larger script, or is it being included in another script? If so, again, there cannot be any html output before the header. you will have to extend your ob stuff to include the other stuff. If this script is in its own file and it's not being included into something else, then check to make sure you don't even have a blank line before your <?php tag, cuz that counts as html output
-
well if nothin' else you can do this: $result = mysql_query("SELECT * FROM site ORDER BY " . $column . " DESC"); though i'm not sure why it doesn't work as is. your code shows double quotes but the only reason i can really think of as to why it's literally using '$column' instead of the $column's value, is if you are in fact using single quotes. check to make sure that you are using double quotes: $result = mysql_query([color=green][b][size=15pt]"[/size][/b][/color]SELECT * FROM site ORDER BY $column DESC[color=green][b][size=15pt]"[/size][/b][/color]); not single quotes: $result = mysql_query([color=red][b][size=15pt]'[/size][/b][/color]SELECT * FROM site ORDER BY $column DESC[color=red][b][size=15pt]'[/size][/b][/color]); as mentioned by printf, when you use single quotes, variables used inside the single quotes will be parsed literally as a string. If you want it to be parsed to where the value of the variable is used instead of the variable name itself, then you need to use double quotes. If you are still stuck on using single quotes, then you need to close it and make a concactonated (closing the quotes, using dots, open new quotes) version of it like so: $result = mysql_query('SELECT * FROM site ORDER BY ' . $column . ' DESC');
-
yeah sure, you could do that if you want. dunno if that works for you [i]logically[/i], but syntatically that's correct.
-
normally when you pass a variable as an argument in a function, the function creates a local copy of that variable. Altering the variable inside the function will not change the original variable. when a variable is passed by reference, and you alter the variable inside the function, it affects the variable not only inside the function, but from the scope if came from. As far as passing the variables back to the page, a function can only return one thing. So you are going to have to create an array that holds both variable values and pass the array back, if that's what you want to do. If you are simply wanting to echo the variables, then you might consider simply echoing them inside that function instead of passing them back somewhere else. I suppose it really depends on how you have everything setup, as to which would be the best method for you.
-
try this: [code] <form action="targetscript.php" method="post" enctype="multipart/form-data"> [/code]
-
[quote author=jwk811 link=topic=110120.msg444547#msg444547 date=1159676415] do you mean if i have the redirect code in the script then i can't send the email? and where would i put the line? [/quote] no you can do a mail function. you just can't have any html output before a header. example: mail(...); header(...); is fine. mail(...); echo "blah"; header(..); is not.
-
Man I really need help! insert into sql table big problem.
.josh replied to 11Tami's topic in PHP Coding Help
Hi Tami, Are you getting any errors displayed? Can you give a description of what's "wrong?" -
now that you got it working, i thought i would mention that that's a quick and dirty way of doing it. i included the in_array statement as a security measure against certain hacking techniques, but there are additional things you can do for added security. For instance, instead of passing your actual field names to be used in your query where the whole world can see what your database fieldnames are, you might want to instead do like sortid=1 sortid=2, etc... and then in your code, assign $column to the column name, based on the sortid. like for instance this: [code] <a href="myscript.php?sortid=0">name</a> <a href="myscript.php?sortid=1">blah</a> etc.. [/code] and then in your query code you can do this: [code] if (isset($_GET['sortid'])) { switch ($_GET['sortid']) { case 0 : $column = 'name'; break; case 1 : $column = 'blah'; break; default : $column = 'name'; } } $result = mysql_query("SELECT name, sitelink, sitedownload, dateadded, publisher FROM site ORDER BY $column DESC"); [/code]
-
In headers listing: [code] <a href="myscript.php?sortby=name">name</a> <a href="myscript.php?sortby=blah">blah</a> etc.. [/code] then in your script, before the sql query, do something like this: [code] $allowed = array('name','blah'); $column = (in_array($_GET['sortby'], $allowed)) ? $_GET['sortby'] : 'Name'; $result = mysql_query('SELECT name, sitelink, sitedownload, dateadded, publisher FROM site ORDER BY $column DESC'); [/code]