-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
take out the first ; edit: actually i didn't even look you have a ternary in there you can't insert a ternary in there like that. you'll have to put that on a separate line. $x = ($uri[1]==$href)?'current':''; echo "<li><a href=\"$href\" class=\"" . $x . "\">Home</a></li>\n";
-
Assuming that you are using my script example, did you read the comments in it? The comments tell you where it defaults to content1 if there is no ...?id= (like on page load). You can change that to default to something else or remove the else altogether.
-
Well if I read that right, here is your model and sku.. $k would be what's looped, just like what you had... $this->products[$k]['product']['model'] $this->products[$k]['product']['sku']
-
It does the same for me. When I click on the image link at the top it shows me as logged off. I'm using FF3 also. Yes, cookies are enabled, etc.. my bookmark is /forums/index.php and I'm always already logged in.
-
umm...it took you a week to learn html but only a few hours to learn css? How can that possibly be possible? But anyways... Yes. Start with the basics. The proverbial "Hello World" tutorial that teaches you how to echo stuff out, operators, etc.. move up to loops and conditions and functions. Learn how to interact with a database. Learn database structuring (relational databases, etc..), how to optimize them, how to write queries efficiently, etc... For a project that size, you're gonna wanna then move on to object oriented programming. Then read up on design patterns and stuff.
-
Well, it's not necessarily "hard" in the sense of difficulty to learn per se...more like "hard" in the sense of you're not going to learn what you need to learn to make that site happen overnight. Or a week. Or a month. It's hard for me to give you any kind of accurate estimate because I don't know you, so I can't really judge how good you are at picking stuff up. Neither do I know what all you really want your site to do, other than your vague description of "Similar to iLike, but much more in depth." But I did go to iLike.com and that in and of itself is no overnight project by someone just dabbling. You're going to have to get some decent knowledge in working with databases. You're going to have to get some decent knowledge of php and how to use a framework and make a decent design pattern. You're gonna probably have to learn javascript/ajax, depending on what kind of features you want.
-
Put it this way: if you really really think your idea is really that awesome then I'd honestly suggest you invest in someone building it for you, so you get it launched ASAP, becasuse the longer you wait to have it launched, the more likely someone will beat you to the punch.
-
php is a server side language. It parses everything into the final text and spits it out to the client. It doesn't really have anything to do with the client (your browser). You would use that html just the same. How you add it to your php file depends on what kind of code is in there. But generally you can just add that as plain text before your starting <?php tag, as the first piece of text to be sent to the client.
-
that means that $result['getthisinfo']['cards']['card'] doesn't exist. So..maybe you spelled one of the elements wrong? Whatever code that produced $result isn't producing that multi-dim array as you expect?
-
So you want to change the TotalHoursUsed to +1 more than it already is? update table set FlaxerAuthAndSig TotalHoursUsed = TotalHoursUsed+1 where username = '$user'
-
I know that I should be shot for saying this, but honestly I think it would be easier to just hardcode it into an array. I mean, 12 elements has you covered for the next year...just pick up a calendar and count. I mean, I really don't see a reason for making a code recalculate something like this every single page load...
-
// example 1: foreach($result['getthisinfo']['cards']['card'] as $list) { echo "ID: {$list['ID']} TransactionID: {$list['TransactionID']} <br />"; } // example 2: foreach($result['getthisinfo']['cards']['card'] as $list) { foreach ($list as $key => $val) { echo "$key : $val "; } echo "<br />"; }
-
$result['getthisinfo']['cards']['card'][0]['ID'] $result['getthisinfo']['cards']['card'][0]['TransactionID']
-
Can you explain that again? Because you just said that you want solution_class="current" for both (and presumably all) conditions, so why not just assign it that to begin with, no conditions at all? But I'm assuming that's not really what you meant.
-
http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html
-
fire fire everywhere, but not a drop to drink?
.josh replied to ardyandkari's topic in Miscellaneous
look into computer forensics. -
[SOLVED] Security in Passing Variable through URL
.josh replied to ballouta's topic in PHP Coding Help
The central idea behind a login system is to use session variables, so you can read up on them by reading any basic login tutorial. However, here's a quick example: page1.php <?php session_start(); $_SESSION['username'] = 'ballouta'; echo "<a href = 'page2.php'>page 2</a>"; ?> page2.php <?php session_start(); if($_SESSION['username']) { echo $_SESSION['username']; } ?> -
sorry, missed the closing ')' if (in_array($_GET['id'], $allowed)) {
-
[SOLVED] Security in Passing Variable through URL
.josh replied to ballouta's topic in PHP Coding Help
right. there is no reason to send info like that through url. you'd have user's info in a session var. your link would be to send_file.php and instead of checking for $_GET['user'] check for $_SESSION['user'] -
$galleryrowa = mysql_fetch_array($gallerysqla) or die(mysql_error());//<==Problem
-
well if you have an ip address that you're fairly sure is his (like, a log of before he was causing trouble and had no reason to hide), you could always do a whois on the ip address and contact the isp and report the user.
-
[SOLVED] n00b PHP4 - PH5 form array compatibility problem
.josh replied to bothwell's topic in PHP Coding Help
$_POST['strLocations'][0] -
well, ideally your main page will be a controller, and you would store each piece of content as separate files. It would look something like this: content1.html <html> <head></head> <body> BLAHBLAHBLAHBLAH MORE BLAH THIS IS CONTENT 1 </body> </html> content2.html <html> <head></head> <body> BLEHBLEHBLEHBLEH MORE BLEH THIS IS CONTENT 2 </body> </html> main.php <html> <head></head> <body> <a href = 'main.php?id=content1'>Content 1</a> <a href = 'main.php?id=content2'>Content 2</a> </body> </html> <?php // array of allowed content files $allowed = array('content1','content2'); // if there is an id in the url... if ($_GET['id']) { // if id is allowed... if (in_array($_GET['id'], $allowed) { // assign page to $id $id = $_GET['id']; // if id not allowed... } else { // assign a default of first one in array $id = $allowed[0]; } // end if..else // if no id in url exists... } else { // assign a default of first one array $id = $allowed[0]; } // end if..else include "$id.html"; ?>
-
it's to specify a key/value pair for associative arrays. Example: // keys are a, b, c values are 1, 2, 3 $blah = array('a' => 1, 'b' => 2, 'c' => 3); // using a foreach loop to loop through array elements foreach ($blah as $letter => $number) { echo "key: $letter value: $number <br />"; }