-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
The site owner is ultimately responsible for content shown/available on their site, not the end users. All it takes is some lawyer to file a suite against you, whether the claim is valid or not. Nothing you do can really "prevent" you from being sued. Whether they will actually win is another story, but you will still need a lawyer to fight the charge which will cost money. You really should consult an IP (intellectual property) attorney and not take advice from the internet on this. You're talking real money here, and potentially A LOT of it. IP lawyers aren't cheap, but if you are going to be entering this realm a few thousand $$ now so you know the ins and outs of the LAW and how it pertains to what you're doing could save you 100x that in the longrun.
-
A redirect is a completely new web request that knows nothing about any previously loaded code/classes because it's the same as just entering a new url in the browser.
-
External Hard Drives Respond Very Slow - Winodws 8
CroNiX replied to glassfish's topic in Miscellaneous
Hmm...tons of answers in google...but... Power Options -> Change Plan Settings -> Change Advanced Power Settings -> Hard Disk -
Doesn't your hosting company have a guide to show you how to set up email for your server? If not you should be able to get better help through their customer support. If not, then you have a really crappy hosting company
-
You can use %{HTTP_HOST} in a RewriteCond to detect the domain name, and RewriteRule(s) specific to that domain name. But it seems like each WP "site" should have it's own .htaccess and not one to run them all. .htaccess files cascade. Like if you had: /public_html/.htaccess /public_html/site1 /public_html/site2 That .htaccess at the root (public_html) would affect both the /site1 and /site2 dirs. Instead you'd want a separate htaccess to be within each of the /site1 and /site2 dirs. This would be more clean with each site having it's own htaccess file, and then you wouldn't have to muck around with domain specific rules which can get very complex the more sites you're trying to control with a single htaccess file.
-
Create button for popup window to display contents of text file
CroNiX replied to te7's topic in PHP Coding Help
So I'm assuming the text file you want viewed is on the server and not part of the current page? If so you'd want to use AJAX in conjunction with a MODAL window. Click the button, it fires off an ajax request to the server to retrieve the specified file, when the retrieved info is sent back to the browser display it in a MODAL popup window. This can only be done using javascript and I'd recommend using jQuery if you aren't already. -
http://yoursite.com/user.php?uid=4 //pass uid=4 as a GET parameter to the user.php script in user.php $user_id = $_GET['uid'];
-
Condition for if to create div's with 2 different class in css.
CroNiX replied to tycy's topic in PHP Coding Help
This is unnecessary: if($nr_row>=0) { You will always have 0 or more rows. -
Just to clarify... jQuery IS javascript. It's a javascript framework that makes code easier to write (less code needed, easier syntax) and is also cross-browser compatible and fixes missing functions for each browser. Not all browsers implement js exactly the same, so jQuery fixes that so it will work the same in all browsers so you don't have to do things like: if (browser is internet explorer) { //do it this way } elseif (browser is firefox) { //do it that way } elseif (browser is safari) { //some other hack } javascript is the only way to manipulate a page once it's sent to the browser by your php script (or anything else...pure HTML, etc)
-
Condition for if to create div's with 2 different class in css.
CroNiX replied to tycy's topic in PHP Coding Help
You can also use the index in the foreach() instead of manually incrementing a counter foreach($rows as $count => $row) //Use array index called $count { $div_cls = (($count % 2) == 0) ? 'linksmen' : 'linksmen_s'; //use the $count to determine odd/even and apply classname for each echo '<div class="'.$div_cls.'" title="'.$row['phonemodel'].'"><a href="iphone.php?phonemodel='.$row['phonemodel'].'"><img src="images/mark.png" alt="" /> '.$row['phonemodel'].'</a></div>'; } This can also be accomplished using pure css, a single classname for each of those divs (instead of 2 separate ones) and using odd/even pseudoselectors. http://www.w3.org/Style/Examples/007/evenodd.en.html -
Psycho is correct, just using a token isn't nearly enough and is only PART of the solution. All I have to do is open up my browsers developer tools and change the value in the form itself and submit it...while I'm on your site (no downloading HTML locally and altering it and submitting it). It will accept the token you added because the correct token would be present and still submit the "illegal" value that I manually altered. And since you aren't doing any data validation, your app will just accept the illegal value. So to reiterate...NEVER TRUST USER DATA without validating that it is the correct type/format/whatever that you need for each value being submitted by the user, whether it's form POST data, or GET data, or anything else. So let's say your dropdown has 3 options in it that submits either "1", "2" or "3" as the value. When the form is submitted, you must check to see that the value was either "1", "2" or 3 (the only legal/valid choices), whether it's a db query to see that the value exists in the db or some other way (checking against an array of acceptable values if the values are hardcoded and not coming from db). If the value was "4" or "A", you need to reject it and have an error that the user submitted an illegal value and to try again.
-
See in your query above how most of the text is in green and some is in black? That's because you end your query by closing the double quote right after AND '$dataFim'" <-- premature double quote. You have 3 double quotes in your query, so there is an extra one or one is not closed. They should always be in pairs. Remove the one after $dataFim.
-
This is called Responsive Design, where the webpage reformats itself for different screen resolutions (desktop vs mobile) and orientation (portrait/landscape). I'd suggest looking into the bootstrap css framework.
-
If you are learning PHP I would discourage you from using Dreamweaver. It encourages bad practices and produces poor code, which won't help you while learning. That said, the problem most likely is the paths used to your various assets is not correct (css/images/etc). How are you loading them? Can you show some code like where you are using an image or something?
-
Have the image at 100% within its container. You're hardcoding px values so it will always be that size no matter the browser size.
-
Storing data from registration page to a 'login.dat' file
CroNiX replied to uhplifted's topic in PHP Coding Help
Why not use a database for this?- 5 replies
-
- registration
- write file
-
(and 1 more)
Tagged with:
-
server unable to resolve simple php-info - file. bug or feature
CroNiX replied to Maze's topic in PHP Coding Help
It could be the owner/group. Notice all of the others (that are working) are root/root but that file is martin/users. Check the apache error logs. -
do a var_dump of $_SESSION to see what session holds
-
This was explained several times in your other thread. That session var hasn't been set yet, so it doesn't exist and you don't check to see if it exists before using it in a comparison statement.
-
Sure, but I don't get why you'd be incrementing by 8 or any other number if you said you were incrementing by 10?
-
Using a MySQL IF() statement in your query. SELECT IF(field + x >= 100, 100, field + x) AS total
-
I need to delete a piece of data when a new piece of data is entered
CroNiX replied to greenace92's topic in PHP Coding Help
I'd do it a bit differently, and not store fake data in the db. Lets say you have a "documents" page, and you are displaying 20 items on it. So you query the database to get the "documents" and let's say only 5 exist. In your view, I'd just check the quantity of results that you got back from the db and subtract it from 20, which would be 15. So display the 5 existing "documents" and then generate 15 "placeholders" just using HTML/CSS. -
It's like all other variables in PHP = is assigning a value == and === is comparing values
-
$_SESSION is like any other variable. If you try to access it (or an index within it) without it existing, you will get an error. if ($_SESSION['something']) assumes 'something' already exists in session, which it doesn't at the point where you are trying to access it or you wouldn't be getting an error. So, you need to check if the variable isset() before trying to just blindly use it in a comparison statement - if() if (isset($_SESSION['something']) && $_SESSION['something'] == some_value)
-
External Hard Drives Respond Very Slow - Winodws 8
CroNiX replied to glassfish's topic in Miscellaneous
Are they asleep? HDs turn off by default after a period of time to save power, so they have to spin up before you can access them. You can turn that off in power settings.