premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
You are never calling the send email method: $text_email = new Text_email($to, $subject, $body, $header); $text_email->sendEmail(); ?>
-
You did change "table" to your actual table name. The above is a rough example. If this still confuses you, go find a MySQL/PHP Tutorial as suggested earlier, as it shows you have never tried one before.
-
$sql = mysql_query("SELECT * FROM table WHERE username='$username'"); $fetch = mysql_fetch_assoc($sql); $name = $fetch['name_of_person']; echo $name;
-
You do realize that the first 1 through 4 will counteract anything else. As nothing else would "mount to true". If $var is between 1 and 4 is not going to be 0 or greater than 750...Basically you only need the greater than 1 and the less than 4.
-
Well, I am still very confused. Why have multiple arrays like that? Why shuffle like you are shuffleing ??? How about this, given the code you posted above, what do you expect $result and $result2 to be after it has ran.... EDIT: Not sure if this is what you want, but maybe it is: <?php $numbers = array(10, 20, 30, 40, 50, 60); $number = 25; $rounded = ($number / 10); $nearest = ($number - $rounded); $key = array_search($nearest); echo "The nearest to {$number} is {$nearest} which returned a key of {$key} which is the value {$numbers[$key]}."; ?>
-
Then your table is setup wrong. Post your table structure and note:
-
<?php $whatever = array(10, 20); $whatever2 = array(30, 40); $number = array_merge($whatever, $whatever2); $tenKey = array_search(10, $number); $thirtyKey = array_search(30, $number); echo "The 10 is at {$tenkey} and returns {$number[$tenKey]}<br />The 30 is at {$thirtyKey} and returns {$number[$tenkey]}"; ?> Without more information, that is what I gather that you want to return. But I am just guessing here as I cannot fully see what you are trying to do.
-
What exactly are you trying to do? Why are you not group the numbers in the proper arrays?
-
Why would you want it global? There is no reason, just use it like you have: $password = generatePassword(); That is the point of functions, I would remove the echo $password in the function, as you do not need to echo it.
-
You could read the manual on it to find out. <?php $whatever = array(10, 20); $whatever2 = array(30, 40); $number = array_merge($whatever, $whatever2); $randomKey = array_rand($number); echo $number[$randomKey]; ?> As far as I can tell, that is what you are ultimately after.
-
array_rand Is that what you are after?
-
explode $string = "info@test.com"; list(,$domain) = explode("@", $string);
-
$sql = "SELECT * FROM cocktails WHERE name LIKE '{$get_letter}%' ORDER BY name "; Try that.
-
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> Notice that in the code before it was 100? and now it is 100% that should fix the issue (or change it to what it should be.)
-
Sessions only working on first try. Any help would be great.
premiso replied to Looktrne's topic in PHP Coding Help
Your not using session_start at the top of your code where you wish to use sessions. This is a requirement on any page sessions are to be used. It must be placed at the top before any output is sent to the browser. -
$sql3="INSERT INTO `kf`.`order` (`order_id` ,`cust_id`,`order_date`,`order_status`,`order_total`) VALUES ('','".$cust_id."','".$today."','".$status."','".$order_tot."')"; You have it set to "0" in your sql query. Change it to '' (as seen above) and it should work.
-
No, html is not that strict. It would not validate for xhtml, however with the first one. All you did was change from uppercase to lower and added the / which in no way effects HTML other than making it validate with W3C standards for XHtml.
-
If the pdf is unencrypted and not an image, you should be able to read it like a normal text file. If it is an image, you need to use OCR technology to read it.
-
Looks like you got it.
-
mysql_query($query) or die("SQL WAS {$query}<br />Error Was:" . mysql_error()); Replace that line and report back the error (if any).
-
Short answer, you cannot. As the session hash is held on their computer. Long answer, you can if you set each user's session id in the DB in a "sessions" table. Once you log someone else out you pull out that record then you would most likely have to manually delete that file from the sessions folder. The other option is, you do the similar thing with the DB, but instead of you pulling it out, set an item in there that is "logout" if that is set to true the next time that user loads a page you check that entry and if it is set, you log them out. Those are the only ways I can think of, the "logout" field in the session table of the DB would probably be the best way to go.
-
[SOLVED] mkdir - created dir file permission is 700, not 777
premiso replied to keeps21's topic in PHP Coding Help
I take it that you are on Linux, but if on windows Alternatively you should be able to use chmod after the directory call to set the mode. -
[SOLVED] Issue with Email Validation String
premiso replied to monkeytooth's topic in PHP Coding Help
Honestly the credit goes to the preg_match user comments section. I simply copy and pasted.