-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Zane
-
-
If you haven't grasped the idea completely yet...here's a visual
[size=14pt][color=red]questions table[/color][/size]
[code]q_id q_body q_answer
0 "What is 2 + 2?" 2
1 "Who was the first president of the US?" 4
2 "Who founded Microsoft?" 3
3 "What is PHP?" 1
4 "What year is it?" 0[/code]
[color=red][size=14pt]answers table[/size][/color]
[code]a_id a_body
0 "2006"
1 "Hypertext Preprocessor"
2 "4"
3 "Bill Gates"
4 "George Washington"[/code]
Then when setting up your test it's a matter of matching which quesitons you want for it -
why would there be non-existent functions called if you didn't mispell/misname them yourself?
I guess I'm just asking for a little more in depth scenario.
you say and error is returned and that only happens when the coder makes and error...most of the time
so I'm guessing you're trying to allow open source something
EDIT:
nevermind
I got beat
Very interesting article BTW...I feel so inspired now -
well, assuming they don't use XML/RSS
my first guess would be they're using one of the many product identifiers out there
For instance
ISBN
SKU
ASIN
UPC
and maybe GTIN -
this should do it
[code]if(ereg("[^A-Za-z0-9_-]+", $var)[/code]
been out of practice of regex for a while
[quote]
Ok, reviewing this code, you have missing curly brackets.
[/quote]
notice his IF statements only have one statement...
When your IF statements only do one thing...you don't need curly braces -
my bad...
instead of
[A-Za-z0-9_-]*
use
[A-Za-z0-9_-]+ -
[code]
if(!ereg("[A-Za-z0-9_-]*",$_POST['yourVar]))
echo "Your POST var doesn't validate";
[/code]
-
There are two ways to handle credit card transaction from what I've read over the few years.
you can either use paypal, have it redirected there, and be charged like 1% for that service
or you can get a HTTPS license for your site
then you can send credit card info through your site worry free because it's already encrypted, but that costs you quite a bit.
check out sites like VeriSign to research that.
If you do it with paypal, you're drawback is that you have to use they're layout for a .... shopping cart - per say. -
well, what does your code look like so far
show us some code and we can help you mold it to what you need.
-
[quote]you sure ARE NOT executing php from within an onmouseover.[/quote]
I agree...and it if you are it's defintely AJAX
if it's not AJAX what you're doing could be done by at least
PHPing, so to speak, the SWF filename as a parameter to your javascript function, that takes an SWF file as an argument.
so like
[code]onmouseover='showMovie(<? echo $swfFile; ?>)'[/code]
-
I think the best idea for this would be to add the users ID number to the beggining of the filename
like if my ID is 9893
and the file I uploaded is called tree.jpg
set you code to rename it to 9893_tree.jpg
then you more systematically get the corresponding user -
you have to tell it which table to look in
...using FROM tablename
so
[code]
SELECT lname, fname, address, city, st, zip, zip4 homephone, workphone, email FROM yourTable WHERE CURRENT=\"TRUE\" and $sport=substr(\"T\",49,1) order by lname[/code]
should do the trick -
check out this post
http://www.phpfreaks.com/forums/index.php/topic,95376.0.html -
you'll probably need a custom function to do that...
using a for loop to check and evaluate each character form right to left
I'll help you out more when I get to school... -
[code] $loginFoundUser = mysql_num_rows($Login);
if ($loginFoundUser){
setcookie('Logged', 'True', time()+60*60);
header('Location: index.php');
exit;
}else{
$errorMessage = true;
}[/code]
[quote=php.net/mysql_num_rows]
mysql_num_rows return the number of rows in a result set on success, or FALSE on failure.
[/quote]
$loginFoundUser will only be false if the SQL statement has an error in it..
you'll have change you if statement to
[code]if ($loginFoundUser == 1{[/code] -
I need to make a small modification to it
this
[code]if($index == "confirmPass" && $val == $tmp)[/code]
should be
[code]if($index == "confirmPass" && $val != $tmp)[/code] -
hate to consider completely changing the code but this should work a little better and be less redundant
[code]$message = null;
$tmp = null;
foreach($_POST as $index=>$value) {
if($index == "username" && empty($val))
$message .= "You did not complete the username field properly.<br>\n";
if(($index == "password" && empty($val)) || ($index == "confirmPass" && empty($val)))
$message .= "You did not enter a correct password.<br>\n";
else if($index == "password" && !empty($val))
$tmp = $val;
if($index == "confirmPass" && $val == $tmp)
$message .= "Your password entries did not match.<br>\n";
}
echo $message;[/code] -
lol..yeah I guess I could change those colors..I thought about it but lost my motivation
...and ended up here -
perhaps you changed a setting in your MySQL server that phpmyadmin doesn't know about...
like maybe the port number or something.
Go check your Server config
and your phpmyadmin conifg file
and look for some differences -
I don't think I could do CSS all day like some people, but I can't stay glued to the Actionscript panel in Flash for hours...
so does that make me a ...............software developer ---- potentially?
But I do like making graphics too. -
lol...I got one.
just for the reason that all my friends have it. I can't quite figure out why it's so popular either, it is kinda overated.
I got facebook as well...but it's turning into this stalker news feed thing. About tells everyone everytime you fart.
either one, I'll never get used to posting a blog about my life, which is all MySpace is. Blogs........and gossip, and chain letters..bleh -
oh..I guessed I'm just used to the curly brackets
it was burned into my head by either czambran or Barand..can't remember -
just make sure you're calling this function of yours before you echo anything to the browser
that includes nonPHP stuff like the DOCTYPE and HTML tags
you gotta call it before any text would be normally displayed on the browser -
right here
[quote] // if a session does not exist but the form has been submitted
// check to see if the form has all required values
// create a new session
if (empty($_POST['user'][b][color=red][size=12pt])[/size][/color][/b]) && [b][color=red][size=12pt]{[/size][/color][/b]empty($_POST['pass'])) {[/quote]
get rid of the two characters marked in red -
put the word localhost in double quotes
mysql_connect("localhost",$username,$password);
Creating functions on the fly
in PHP Coding Help
Posted