
webmaster1
Members-
Posts
607 -
Joined
-
Last visited
Never
Everything posted by webmaster1
-
Cheers. I'll delve into the ACL concept.
-
Thanks Zagga. I don't want each user to have their own page. I need group a to be redirected to page a and group b to be redirected to page b. Group a and b cannot access each others pages. I'm going to add a third column to my username/password table to assign values for the variable to be used in redirect url e.g. $direct-to = "page-a.php" header("location:/$direct-to")
-
Thanks Jay, I read through the Wikipedia entry. Is this the simplest way of going about it? I was hoping an extra column in my table, a little boolean and some session functions might do the trick.
-
I have a log-in form that starts a session by checking the input against a database: // Mysql_num_row is counting table row. $count=mysql_num_rows($result); if($count==1){ $_SESSION['username'] = $username; $_SESSION['password'] = $password; header("location:success.php"); } If the inputs match the user is redirected to success.php which checks for the session as follows: <?php // Begin session. Function must remain at top. session_start(); // If the session is not registered. if(!session_is_registered(username)){ // Redirects when the url of this page is directly accessed without a registered session. header("location:fail.php"); } ?> [Q1] Let's say I have two users who are each redirected to a different success page. How do I prevent them from accessing each others success pages? Here's what I'm trying to achieve in simpler terms: SESSION A allows USER A to access SUCCESS PAGE A but not PAGE B SESSION B allows USER B to access SUCCESS PAGE B but not PAGE A How do I distinguish between sessions? [Q1] If users listed in my username/password mysql table are each to be redirected to an individual url, should I just save this as a third column in my username/password table (or is it bad practice to use this table for anything other than checking the username and password?)
-
Very interesting stuff. Thanks for the overview Josh.
-
Interesting. Can you explain it to me briefly in your own words?
-
How do I recover deleted account and associated fiels in cPanel?
webmaster1 replied to webmaster1's topic in Applications
Good news folks. cPanel can restore files using the R1 restore option whether or not you've automated any prior form of back-up. I'm currently restoring mine to 10:30 yesterday evening. -
How do I recover deleted account and associated fiels in cPanel?
webmaster1 replied to webmaster1's topic in Applications
It's 1:18 AM in Ireland right now. -
How do I recover deleted account and associated fiels in cPanel?
webmaster1 replied to webmaster1's topic in Applications
Would the web hosting company be able to restore anything? This was suggested in another forum: Is this just a custom script he's referring to? -
Importing dates from excel to MySql to PHP.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Found a quirky solution: http://forums.devshed.com/mysql-help-4/import-csv-date-to-mysql-673242.html Apparently, each time the csv file is open, the format of the date is reset. In other words, once the csv file is saved from excel, it can't be opened in excel prior to uploading it. I'm just glad to find the solution. I'd never have guessing that thiswas the issue. -
Importing dates from excel to MySql to PHP.
webmaster1 replied to webmaster1's topic in PHP Coding Help
I've imported the csv file using import on phpmyadmin but the dates are showing in zero's. Despite formating the dates correctly in excel, csv insists on formatting the date as 4/13/2010 12:00:00 AM. How do I correct this? -
Importing dates from excel to MySql to PHP.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Thanks for that function. I was just using a regular insert but no, I did not have preceding zeros for day/month. -
Importing dates from excel to MySql to PHP.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Formatted date in excel to match YYYY-MM-DD HH:MM:SS. Working fine now. I was hoping MySql would have been able to pick up on a variety of formats for datetime field inserts. -
Importing dates from excel to MySql to PHP.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Have done. I've just tried inserting YYYY/MM/DD and YYYY/DD/MM into a timedate field but I'm just ending up with zeros. -
Importing dates from excel to MySql to PHP.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Sent you a PM. -
I'm importing an excel file into a table for outputting into a php page. In excel, my date reads: 4/19/2010 If the destined field is set as datetime, will PHP/MySql be able to recognize it as date?
-
My bad, let me paraphrase. I read through a tutorial that used if, if else for isset though I use post myself. I was just wondering if one approach is agreebly superior to the other or if it really depends on what's to be achieved. I'm thinking in terms of server/web root paths. Then again, I could should will just go and find out. For no other reason other than the fact that I'm not familiar with ASP . This prompts another question: Does the left/right paradigm exist between PHP and ASP? i.e. are their fanboys who hate their counterparts a la Mac vs PC? I already understand that hybrids exist. Briefly, in what way is PHP better than ASP and vice versa? Heh, heh. A Russian apparently exploited this guys website using RFI. I'm laughing because of how he immediately decided to ban all of Russia from his site. http://forums.digitalpoint.com/showthread.php?t=1743122
-
Though I understand the concerns about accessibility and unnecessary repetition, I still assert that many a novice - moderate PHP practitioners wouldn't have the audacity or shamelessness to start a thread in it's own right to simply ask what the difference between <?php and <? is. An archived FAQ style repository could be periodically updated with the crème of the select quickfire Q&A thread if the aforementioned concerns are all that, erm, concerning (damn my apathetic lexicon). Rather than musing about how and if such a facility should exist, we should instead reflect on the fact that the questions simply may not be asked in lieu of the said facilitation. Hence, the maxim, the only stupid questions, are the questions that aren't asked. The waffling is contagious. Onwards with the Q&A! What's your preferred approach in terms of dealing with multiple independent forms on the one page? i.e. post or an if statement. Who does md5 and hash string comparisons protect more? The end-user or the administrator? Is the code of an included file relative to where it's included in or from? Let's say you work in a company whose internal applications are predominately ASP based. What three points would you rattle off to entice them to PHP? Can PHP be used for unethical hacking to any great effect? Everything I've read seems to be about Linux and packet sniffing.
-
Cannot output datetime values from table correctly.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Concurred. -
Cannot output datetime values from table correctly.
webmaster1 replied to webmaster1's topic in PHP Coding Help
@PFMaBiSmAd / joel24: Thanks for breaking that down. I'm now up to speed with the query and strtotime approach. Cheers! -
Cannot output datetime values from table correctly.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Trying this now, cheers. -
Cannot output datetime values from table correctly.
webmaster1 replied to webmaster1's topic in PHP Coding Help
By chance, the following works: $querymin = "SELECT MIN(datetime) FROM table where something='$something'"; $resultmin = mysql_query($querymin) or die(mysql_error()); while($rowmin = mysql_fetch_array($resultmin)){ $min= $rowmin['MIN(datetime)']; $min = strtotime($min); print date('Y-m-d \a\t H:i', $min)."\n"; The strtotime() function through me off a little. A multitude of the examples I encountered used the current time for calculation which I had assumed wouldn't be interchangeable with a variable. -
Cannot output datetime values from table correctly.
webmaster1 replied to webmaster1's topic in PHP Coding Help
Would making my datetime column into a timestamp make life easier? I was avoiding it because I'm cautious of updating the date when I'm not supposed to. -
I'm outputting the minimum datetime as follows: $querymin = "SELECT MIN(datetime) FROM table where something='$something'"; //query $resultmin = mysql_query($querymin) or die(mysql_error()); //execute while($rowmin = mysql_fetch_array($resultmin)){ //loop $min= $rowmin['MIN(datetime)']; //as variable //echo $min; $min= date("m/d/y g:i (A)", $min); //format date echo $min; 2010-04-18 00:00:53, as stored in my database should be formatted like 18/04/10 00:00 (AM) except it formats as: 01/01/70 1:33 (AM) Notice it's about 4 decades out. I've wasted a fair amount of time trouble-shooting this though I keep on bouncing back and forth between unix timestamps and the strftime() function. Can someone please assist? Why is my formatting messing up my date?