-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
[SOLVED] Help passing myrow data to a php.class
mikesta707 replied to RyanSF07's topic in PHP Coding Help
hmm ok that seems right. post the whole function from the class that you are using. also, echo out regular time, like echo time(); and see what that says. -
[SOLVED] Losing Session value after header is called
mikesta707 replied to stackumhi's topic in PHP Coding Help
ahh ok, then it seems that you aren't passing the request variables correctly. can I see the code that is supposed to pass the request data to the page that sets the session variables -
[SOLVED] Losing Session value after header is called
mikesta707 replied to stackumhi's topic in PHP Coding Help
ok well you set the variables correctly it seems. do you have session start on the top of the second page? the one that is payrool-list-contractors.php or something like that -
how are we supposed to know what is or isn't needed in this code...
-
[SOLVED] Autofill a form element by clicking on a link?
mikesta707 replied to madhattan's topic in PHP Coding Help
oh my bad never ended the php <option value="1" <?php echo ($_GET['name'] == 1) ? "Selected='selected'" : ""; ?>>Cynthia DePaula</option> -
[SOLVED] Losing Session value after header is called
mikesta707 replied to stackumhi's topic in PHP Coding Help
not unless you aren't passing your variables right. try a print_r on the $_REQUEST variable and see what happens -
[SOLVED] Help passing myrow data to a php.class
mikesta707 replied to RyanSF07's topic in PHP Coding Help
you are using it correctly. echo $time and see what its value is. -
[SOLVED] Autofill a form element by clicking on a link?
mikesta707 replied to madhattan's topic in PHP Coding Help
whats the error? -
[SOLVED] Losing Session value after header is called
mikesta707 replied to stackumhi's topic in PHP Coding Help
do a print_r on the session variable before the header and on the next page, and see what output you get -
[SOLVED] Help passing myrow data to a php.class
mikesta707 replied to RyanSF07's topic in PHP Coding Help
nope not at all. time() is the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). try using strtotime on your date before you pass it in. for example, given the following code $time = date("Y-m-d h:i:s");//timestamp format $date = strtotime($time); $times = time(); echo $time."<br />"; echo $date."<br />"; echo $times; would output: 2009-09-15 04:03:32 1253001812 1253045012 -
[SOLVED] Autofill a form element by clicking on a link?
mikesta707 replied to madhattan's topic in PHP Coding Help
firstly switch($_POST['emailto']) //sseems like it should be switch($_GET['name']) also, when you have a drop down like that, if you want one selected, you have to add a selected attribute to the options. <td><select name='emailto' id='emailto' > <option value="1"<?php echo ($_GET['name'] == 1) ? "Selected='selected'" : "";>Cynthia DePaula</option> -
echo "<div>Office Phone: $vuser->phone_office $vuser->phone_ext<img src='images/icon_verified.gif' alt='verified logo' width='63' height='16'></div>"; what syntax error did you get? this code should echo perfectly fine...
-
[SOLVED] Help passing myrow data to a php.class
mikesta707 replied to RyanSF07's topic in PHP Coding Help
that means that whatever value you are passing as $datefrom is the same as $dateto, or rather the time you are passing is basically the current time. Can i see the code you have? -
I dont believe so. He needs to replace a string inside a certain HTML pattern. What you have replaces certain strings with ABC, but in his case, the string can be anything
-
look up preg_replace()
-
I would have, and actual do take a similar approach at my job. With class extension you have to added bonus of data encapsulation that you don't have with static functions, and since you get the same functionality, but can customize it with inheritance, and function overriding, etc. I would say you made a wise choice.
-
[SOLVED] Help passing myrow data to a php.class
mikesta707 replied to RyanSF07's topic in PHP Coding Help
yeah I realized after I posted that that method wasnt the constructor. ignore what I said about constructor functions -
try nl2br() puts a HTML line break before all newline characters $menutext = file_get_contents ('menu.txt'); echo $breakup = nl2br($menutext); so whenever you do an actual newline in the text, it will do an HTML line break
-
[SOLVED] Help passing myrow data to a php.class
mikesta707 replied to RyanSF07's topic in PHP Coding Help
the @param notes in the class just talk about what parameters go into the constructor function. You seem to be calling to contructor right, your problem is echoing out the data correct? try $class = new cktsTime(); $time = $class->timeAgo($myrow['date']); echo "$time"; from the little bit of that class I saw, it seems like that time_ago function returns the value of how long its been. -
[SOLVED] Update Run On Same Page When Form Submited?
mikesta707 replied to twilitegxa's topic in PHP Coding Help
Your PHP makes absolutely no sense. You have a worthless loop in there that just gets information from the table for no reason. Then you do the same thing, and for some reason you just update the last entry in the table. This won't work how you expect it to at all. If you want to grab a users info, then you have to set a where clause or something. <?php include("connect_db.php"); //why do you do this... $get_player_info = "select * from training"; $get_player_info_res = mysql_query($get_player_info, $conn) or die(mysql_error()); while ($player_info = mysql_fetch_array($get_player_info_res)) { $id = $player_info['id']; $identity = $player_info['identity']; $level = $player_info['level']; $energy = $player_info['energy']; $experience = $player_info['experience']; } //the above code makes no sense at all. you are overwriting the variable everytime the loop runs //you will only have the data from the last loop run... if ($_POST['train'] == 'test1') { //again, this makes no sense at all $get_player_info = "select * from training"; $get_player_info_res = mysql_query($get_player_info, $conn) or die(mysql_error()); while ($player_info = mysql_fetch_array($get_player_info_res)) { $id = $player_info['id']; $identity = $player_info['identity']; $level = $player_info['level']; $energy = $player_info['energy']; $experience = $player_info['experience']; $update_energy = ($player_info['energy'] - 2); }//makes no sense at all //this is going to update the very last entry... not whoever is trying to train. $accept_scout_username = mysql_query("UPDATE training SET energy ='$update_energy' WHERE identity = '$identity'"); } ?> I very strongly suggest that you try a simpler problem before you tackle an RPG. you seem to not know the basics of pulling the right information from a mysql table. To be completely honest, this code will probably run, but won't do anything useful, and to make it do something useful will probably take 3 pages of explanation. here is a php/mysql tutorial Another php/mysql tutorial I suggest you read up on those tutorials, try a simpler project, and then tackle the RPG. It will be much less of a headache -
[SOLVED] Signing in as someone else with sessions?
mikesta707 replied to LostKID's topic in PHP Coding Help
this is your login script right? On the login page, I never saw 3 fields, only an email and password field. thats probably why your username is never set. try if($num == 1){ $sql2 = "SELECT * FROM user WHERE email='$_POST[email]' AND password='$_POST[password]'"; $result2 = mysql_query($sql2) or die("couldnt confirm password"); $num2 = mysql_num_rows($result2); if($num2 > 0 ){ session_start(); $row = mysql_fetch_assoc($result2); $username = $row['username']; $_SESSION['auth'] = "yes"; $_SESSION['username'] = $username; print "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">"; } else{ echo "wrong password"; } } else{ -
it probably has something to do with the fact that pop, psyche and mod both appear twice in your original array. try using the array_unique function on both the missing and orig genres arrays before you array_diff them
-
$string1 = "this is a test"; $string2 = "this was a testing"; $string1 = explode(" ",$string1); $string2 = explode(" ",$string2); foreach ($string1 as $key => $value) { if ($value != $string2[$key]) { echo "String 1 : ".$value; echo "<br>String 2 : ".$string2[$key]."<br><br>"; } } unless you are trying to see if a string is exactly the same, this won't work. if you want to take a string, and compare each word and see which words are different, I suggest you do a string explode, and use the array_diff function. As far as your files problems, if you can't change php.ino then you probably want to set a time limit of more than 20, like 30 seconds or something.