-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
search 'php breadcrumbs' p.s.- in the future, please use a more meaningful subject for your thread.
-
okay so now that you have your old script back...problem solved?
-
okay if you already know your query string then just do a simple connection and query script: [code] <?php $conn = mysql_connect('localhost','username','password'); $db = mysql_select_db('dbname',$conn); $sql = "query string here"; $result = mysql_query($sql, $conn); ?> [/code] that's a barebones version. dunno if you wanna throw in some error trapping/logging or whatever. Anyways. just make a file called blah.php or whatever and point your cron job to it. edit: p.s.- I guess this belongs in the php forums after all ;D
-
remove the ' ' from your table and field names. [code] $query = "SELECT * FROM table01 NATURAL JOIN ID WHERE table01.Name like '%$qstring%'"; [/code]
-
we have no way of giving you an exact query string without knowing what your fields are or how it is you are going about keeping track of banned people. please give some more info. p.s.- moving to sql forums.
-
Will costly web designs be defunct thanks to new software tools?
.josh replied to extrovertive's topic in Miscellaneous
point of sale? ;D -
okay yes you are right about the !
-
slight modification to your code Timbo: [code=php:0] <?php $number="1"; $filename="test"; while(!file_exists($filename.$number.'.txt')) { $number++; } ?> [/code] you forgot the ! in the condition, and a . between your $filename and $number, and also forgot some quotes for the .txt
-
What do these few php fields mean in my email form?
.josh replied to 11Tami's topic in PHP Coding Help
getenv() function gets an environment variable. in this case, it's getting HTTP_REFERER. from the manual: [quote] 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. [/quote] so your code block is first making a variable called $http_referrer that holds the HTTP_REFERER value. Then it has a condition that checks to see if $_POST['email'] exists. $_POST is an array that holds data from your form. 'email' is one of your fields in your form. If it does not exist, it is assumed that the user did not fill out the form, and the script then sends the user over to some page that is held in $formurl, wherever that is. there isn't anything in those lines of codes that you have supplied that actually has anything to do with your mail() function, so I'm a little unsure as to what it is you are actually asking here... well, i kinda know what your asking, but that code you just showed isn't really linked to your mail() function, wherever it is. You're gonna have to show some more code. -
Why is this returning 'Not Valid Resource' error?
.josh replied to simcoweb's topic in PHP Coding Help
also you need quotes around the data in your query. try it this way: [code] $sql4 = "SELECT * FROM plateau_pros WHERE username='{$_SESSION['username']}'"; [/code] -
lol p.s.- brown2005, if you really wanted to see your thing implemented, perhaps you should go to SMF's forum and make a suggestion there. Maybe they will implement it in future versions or maybe someone will make a mod. In other words, the best place to ask for a change/addon for a script is to go the people who made it in the first place.
-
The only reason why I really cared about the PMs being re-enabled was to allow users to defend themselves against moderation, so I'm glad it's back. See, I do care about all you little people ;D j/k
-
or you could like, use your mouse to highlight what you want, then right click and click on copy. or after highlighting, press Ctrl+C [quote author=brown2005 link=topic=110489.msg446722#msg446722 date=1159980338] thanks, nice to see someone that wants to help and explains.... [/quote] well we aren't really here to explain how to use your OS and/or browser shortcuts either...do you really think we should go out of our way to make a new mod/hack for everybody's personal shortcut preference?
-
[quote author=Jocka link=topic=110264.msg446690#msg446690 date=1159975463] i think it might be best to maybe do some kind of random pick from the users in the database. Assign like 3-5 on one team and 3-5 on the other. [/quote] Problem with picking random 3-5 people from the db is that the vast majority of people in the db are people who come here looking for help on some issue and leave, never to return. Or maybe return half a year later with some new question. That's why we'd have a sign-up list and randomly shuffle everybody into teams from there. [quote author=ober link=topic=110264.msg446657#msg446657 date=1159969406] Yeah, but the thing I don't like about that is that if WE pick who gets planted on x piece of the project, what if someone wants to try out their stuff but we don't think they're a good fit? [/quote] So should we randomly assign people to certain aspects of the website building, as well? I think that it would probably be best to allow the teams to work out how they wanna go about accomplishing the task themselves, and that would include deciding amongst themselves who does what. If everybody wants to be the coder and nobody wants to be the designer, because everybody feels that they are good at coding and suck at design.. well I personally feel that trying something new is the best way to learn something new, don't you? But not everybody thinks that way. My suggestion would be to let the teams work it out for themselves. If there is a disagreement, flip a coin and be done with it. Or inside the team, majority rules. If you have 5 people on your team and you want to do one thing and other people disagree, take a vote. Majority rules. Or maybe a combination of majority rules and flip a coin, especially if you are on an even numbered team. If you still can't live with that, then maybe you shouldn't be participating in this teamwork based contest in the first place. We will definately have to put something like that into the list of rules for this contest. [quote author=ober link=topic=110264.msg446657#msg446657 date=1159969406] If we get enough people interested, we could have competitions for seperate parts of one site. We judge the best from each and pull them all together. [/quote] Not sure what you mean by this. Care to elaborate?
-
well the pendulum swings the other way two, Red. Maybe someone is good at design, but sucks at coding, or at least, sucks worse. The reason why I want to include all aspects of the website into this contest, is because in the real world, a website is not just made up of the code, nor is it strictly design. A nice looking car is useless without an engine, and (most) people aren't gonna buy a car, no matter how powerful or reliable it is, if it looks like a bunch of rust and bolts and torn up carpet thrown together with duct tape. The code and the design go hand-in-hand. The goal of my idea is to promote this hand-in-hand reality. So what if you suck at design. Stick with what you know best. Good idea for the teams when they first get together is to figure out who's best at doing what. Assign people to different aspects accordingly. The idea is to promote real-world situations, so that this contest [i][b]can[/b][/i] become a viable resource for learning, and maybe with a bit of luck, something you can put on your resume.
-
yes i thought about that, and to an extent, we are going to have to limit our themes to things that can be made into demos, in order for it to work. Some db interaction is feasable. I mean, lots of scripts are "portable." take this very board script, for example: SMF. Maybe as part of the contest, one of the rules and/or sections of judging would be "portability". Easy installation mostly out of the box, plugging in a few key things into fields like db name/pass/etc..(like installing SMF), multi-db/apache ver. compatable? 10/10 in that section! etc... Also, as far as the demos are concerned, we could simply 'turn off' some of the features of the themes, so to say, for demo purposes. We obviously don't want to have scripts that enable people to do something malicious to things. I see online demos for front ends and back ends all the time, that allow certain interaction with the db. Just gotta keep security in mind, that's all. edit: ps.- also, for demo purposes, never under-estimate the power of "spoofing" certain functions. The idea is to give an idea of what something can do. That doesn't necessarily mean it has to do it for real, in order to get the point across ;)
-
So I've been thinking about this whole "website-makeover" contest for a while now, and I don't think it's very feasable to do a "makeover" of some site, because too much politics might come into play. For instance, I have already seen people hinting at the idea of putting businessman's website on the list of makeover sites. While I will not disagree that it certainly needs a makeover, I don't think it's entirely fair to go re-doing people's site. If we do that, then next thing you know, everybody is gonna want to jump on the "get my site (re)done for free by a bunch of people" bandwagon, and various people might want to try and exert some kind of influence on getting their name next on the list. This is not so much a 'trust' issue; more of a 'peace of mind' issue. Best way to rule out any kind of possibility of foul play is to eliminate ways of doing it, right? And what if we start to get people out there trying to scam the contest? I mean seriously, if someone needed a nice site built for their business/hobby/whatever, and they heard about a community that is doing this "makeover" contest thing, how many people out there might think to themselves, "hey, I can throw together a piece of crap temp site and then go join this community and try to submit my site to the list of makeover candidates and try to coerce people into picking mine for a 'makeover.'" In addition, I don't think it's entirely fair to go and re-do other peoples' sites, because of the fact that many of the people here are freelancers. This is what many of you guys and gals do for a living. Why should you go re-working someone else's site for free (or even bragging rights), when you can be using that time to re-work a site that you could be getting paid for? Not much incentive... and honestly, what kind of incentive can we possibly offer to the winners? Who foots that bill? Why should Eric foot it? What does he get out of it? In short, I believe there's too much abuse potential and not enough incentive for this "makeover" contest. So I've been thinking about this for a while, and I have come up with an alternate idea to this whole "website makeover" contest. First, each "round" we make a list of everybody who wants to participate. Then, depending on how many people sign up, randomly divide everybody up into 2 or 3 teams (or more, if we get an assload of people). I say randomly because I think this is the only way to be truly fair and impartial. That is not to say that a team of gurus vs. a team of noobs [i]won't[/i] happen, but at least this way, it won't be anybody's fault, and nobody's feelings will get hurt, and people(s) can't somehow worm their way onto/form some kind of dream-team. Someone(s) decides on a theme for the contest (seasonal/holiday, fan-site, some kind of game, whatever). Who? I dunno. How about everybody make a list of fictional sites or something and we can make a random theme generator or something. Any suggestions? Anyways, each team has to compete to make this website, both graphically and functionally, based on the theme. We will have a time limit of like a month or something. Then we will have a panel of judges decide the winner, based on a scoring system, divided into different categories, like coding, design, intuitiveness/user-friendliness, originality, etc... Who will be the judge(s)? I dunno yet. Maybe Eric might want to be a judge, since he's the owner of phpfreaks.com. Maybe some of us here also have some connections here and there, of people that would make good judges, as well. For instance, I just so happen to know the chief editor for the online version of the New Orleans Times Picayune. If you guys know what an editor is supposed to do for a newspaper, well, he's been an editor for newspapers for a long time, and for the past 10 years or so, has been chief editor for the online version of the New Orleans paper. I think an editor would be a good judge for content, readability, useability, creativity, layout, etc... and I'm sure I can get him to take the time every month or so to peruse the entries. And maybe he might know a person or two himself... etc... Anybody else got a connect somewheres? Anyways... Now, here are some rules/incentives for this game that I feel will benefit everybody involved: First, nobody will own the end product, per-se. That is, by choosing to compete, you are giving up ownership rights to anything you do. Ownership goes to...everybody: a standard open source TOU will be pasted to all entries that says it's free to use/modify/whatever, as long as credit is given where credit is due, sort of thing. Maybe a blurb in the index source code commented out, saying made by blahblahblah, go to phpfreaks.com etc..., or something. This will take out future hassles of ownership questions/battles which are 100% likely to surface, due to more than one person being on a team. 2nd, phpfreaks.com can start a new section on the main site, a new resource for the community along with the tutorials, etc.. a collection of these winners or even all the entries, as "templates," for users to download under said TOU. Credit for the templates will be given to the people who made them in this new section, of course. Example, show a thumbnail of the site, made by: what the theme was, etc.. maybe even a linkie to an online demo or something. Perhaps the online demos can be stored on Eric's hosting servers and he can put up some ads of his own somewheres for hosting packages - "great online demo, huh? Buy hosting from us, and have this theme auto-installed for you!" whatever. The idea is that if we use the winners or even all of the entries as a new community resource, with people's names attached to it, it will be a form of free advertising for the contestants. Contestants will also have rights to add their entries to their freelancing portfolio. This is incentive for the contestants - a prize. And Eric and the phpfreak community are winners too, because Eric can tack on advertising for his own stuff, because he's hosting all this, and the community wins, because this whole thing will create a new community resource, which will bring more people here. Also, by being on teams with people, you get hands on learning/experience working with other people on projects. This would be another resource this community would be providing. Who knows, if this contest gets established enough, it might even be worthy of putting on your resume, as far as things you have done/are doing. Pipedream? maybe. but maybe not. And also, who knows, maybe by working with different people in this on-going contest, you might just find your future business partner ;) So...what do you all think?
-
[SOLVED] Photoshop, or fireworks for layout, and other
.josh replied to Ninjakreborn's topic in Miscellaneous
well i thought it would be rude to outright accuse him of software piracy, so I went with being cheeky instead. -
[SOLVED] Photoshop, or fireworks for layout, and other
.josh replied to Ninjakreborn's topic in Miscellaneous
hey i have an idea, how about instead of spending thousands of dollars on a bunch of stuff you barely use or worse, don't even use at all...hows about using that money on that dental work you keep advertising to accept as payment for work? -
you are correct. php was written in c
-
that should work. i notice you are missing a ' around 'number' in your $_GET['number'] also, you shouldn't directly insert a $_GET variable into a sql query. leaves you open for sql injection attacks. edit: well, show the actual code block that that's in. i mean, technically, there are no beginning quotes around the query or nothing. Since I already found 1 typo, show the whole thing.
-
from a comment in the operators precedence section of [url=http://us2.php.net/manual/en/language.operators.php#language.operators.precedence]the manual[/url]: [quote] <?php $a = $b && $c; ?> <?php $a = $b AND $c; ?> the first code will set $a to the result of the comparison $b with $c, both have to be true, while the second code line will set $a like $b and THAN - after that - compare the success of this with the value of $c [/quote]
-
I honestly haven't found any specific reason [i]why[/i] it won't let you, other than it wasn't programmed that way. My best guess is that it simply wasn't programmed to be parsed the same, in that circumstance.
-
it's a shorthand method of coding a condition. kind of like the ternary operator.