
tsilenzio
Members-
Posts
134 -
Joined
-
Last visited
Never
Everything posted by tsilenzio
-
wow that was easier the nexpected xD lol ok but um for the first one how do i tell if there is or isnt one after it exectes? like will the results be a bool or and int if u assigned it to a variable?
-
Ok I know how to do php with no problem (mostly) or atleast so far. However if i have a table in a database set up called: users and the columns are: UserID [Auto Increased], Email, Username, TimeStamp, and Status. How would I write a query to first make sure that the user who is in the process of registering isnt entering an email hasn't been used yet and also check to make sure that the loginname isnt already used? And then later when they check their email they click the activation link (already coded so im not worried about that) but how would I change the Status field from 0 to 1? - [THIS BEING A COMPLETLY DIFF QUERY THEN THE OTHER] Sorry this whole query thing is confusing but if i can see how its written a few times with the examples id need then it would help me out a great deal! Thanks ALOT!
-
yea i know how to use vairables but is there a way to send a whole class in a $_POST or $_SESSION?
-
Well I want to use classes and ive used them before in Visual Basic, C++, and Java but not for PHP if I create a class what will keep it alive from page to page (because all variables die from one page load to the next)
-
yea Im going to make one of those when i learn more about classes but as of right now classes make me confused lol how do you keep a class alive like I know u create a clas but once u change the page won't it die?
-
Thank you I will try that RIGHT away!!! lol just wondering did u copy and paste <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" or did u actally remember that? always tried never could =(
-
forgot to mension if you would like to use variables inside quotes it HAS to be double quotes like this would work: <?php $Name = "Taylor"; echo("Hi my name is: $Name"); ?> outputs:
-
Ok here is your proble you have: <?php $_REQUEST['$n']; echo(abs('$n') . "<br />"); ?> the fix for it would be: <?php $_REQUEST['n']; echo(abs($n) . "<br />"); ?> and doing stuff like $_SESSION['var'], $_GET['var'], $_REQUEST['var'] you need to drop the $ sign same goes for when variables are inside single quotes like so: echo('$n') will output: $n instead of what ever was inside of it
-
Ok i know how to send an email however I dont know how to do stuff in the email like make it bold and stuff i tried doing: <?php //code above $subject = "Dragonball Z - Registration"; $message = "<html><body><b>Thank you for signing up.<b>\n"; $message .= "<br><br><i>Good luck and enjoy</i>\n"; $message .= "<br><i><b>Founder:</b> tsilenzio</i></body></html>"; mail($email, $subject, $message); //code below ?> and the rest is sent
-
okay i figured out my problem it when u dont specify a username and all that stuff well i had it in a file and then another using require_once so it wasnt loading it up twice thus causing the vars to not have any values
-
ok well since u guys are here lol any adive on this: would do u perfer to use and why (USALLY): " or ' when it coems to strings as far as i know with the echo statment u can use "$username is cool" would actally replace $username with username but that dosnt work with ' (single quotes) however hwne u go to write in html its better to use ' (in my opinion) becasue when u have to do something like <?php //more html code above echo('<body bgcolor="#ffc11c">'); //more html code ?> is better then using: <?php //more html code above echo("<body bgcolor=\"#ffc11c\">"); //more html code ?> Like i said i dont know and i wanna keep in good pratice
-
Nvm i figured it out the thing installed it wrogn and isntalled phpmyadmin as new_phpmyadmin causign the error xD thanx neways
-
Okay I am FARRR from an apache expert but I have installed WAMP which comes with Apache2, PHP5, and MySQL5 all configured for each other.. and I set up a few virtualhosts did it also to localhost but now when i try to access phpmyadmin it gives me a forbidden page saying: You don't have permission to access /phpmyadmin/ on this server. Any ideas? =/
-
This is my config file (file it loads to connect to DB) <?php $db_hostname = "localhost"; $db_username = "root"; $db_password = ''; $db_database = "database"; ?>
-
if i do need one anyone know how to add it? Im using WAMP which auto install and sets up Apache2, PHP 5, and MySQL5 on windows =/ been trying to figure it out accidently deleted the root account before lol had to reinstall
-
Okay i have this annoying problem everytime i try to test out to see if registration works on my test server: Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\dbz\includes\functions.php on line 72 Access denied for user 'ODBC'@'localhost' (using password: NO) (There is no password its just root and noo password) do i HAVE to have a password is it telling me? =/
-
to be honest I dont know ive only used classes in Java, and even then it was confusign when we got int oabstract classes and really deep down the rabit whole =/
-
I know lol but to be honest havnt made any classes yet so when i get to doing that trust me il make cool stuff for right now i like this because i use 2 diffrent sites one has MySQL 4.x and one has MySQL 5.x well the one using 4.x wont accept mysqli function and 5.0 wont accept mysql functions. also it auto loads the config lol so it less typing for me Yea later i plan to add like SELECT and DELETE and all that along with WHERE and such so all u have to send is vars unless that makes it more complicated to be honest i havnt done tooo much stuff with mysql yet
-
Ok thanx alot u prolly just saved me like 250 unnecessary lines throughout my project
-
Yea i've seen it done before not sure how to on vBullitin but in phpbb they register the password using the md5() method. So when they register on your site you would have to make it send all that data into the right database and the right table for that to work mostly (Well lol if not then i dont know how u would get it to work) To figure out how they encrpt the password alogn with anything else (maybe they enncrpt the username too) just open ur favorite editing program and open the php registresion files for vBullitin (I don't know what files they would be) and what ever they use to send the information into the datbase jsut use on your registration form. I will be doing this myself in a little when i find what I need i will send it to u but it will only work for PHPbb I know i probably didnt help to much but ive onl gotten 4 hours of sleep in the past 37 hours :-\
-
I know this is probably dumb to ask but if any of you are fimilar with C++ / C# / Java you would know that u can do if statments a couple of ways for example: if(condition) { //do something } //OR if(condition) //do something in one line Will the second method work in PHP? :s
-
Well heres my new update jsut incase ne1 wanted to see it lol function processQuery($query) { global $root_path; require_once($root_path . 'extension.inc'); require_once($root_path . 'config.' . $phpEx); if(in_array('mysqli', get_loaded_extensions())) { $conn = mysqli_connect($db_hostname, $db_username, $db_password, $db_database); if(!mysqli_connect_error()) { if($result = mysqli_query($conn, $query)) { return $result; } else { die(mysqli_error($conn)); } } else { die(mysqli_connect_error()); } } elseif(in_array('mysql', get_loaded_extensions())) { if($conn = mysql_connect($db_hostname, $db_username, $db_password)) { if(mysql_select_db($db_database, $conn)) { if($result = mysql_query($sql, $conn)) { return $result; } else { die(mysql_error()); } } else { die(mysql_error()); } } else { die(mysql_error()); } } else { die('MySQL extensions are not loaded'); } } Just got done writing it not sure if it works 100% but im going to try it hopefully i wont get alot of errors lol not really use to doing stuff with my_sqli functions use to normal my_sql functions. I just got introduced to my_sqli functions NOTE: All thats inside include.inc is a var which is: $phpEx = 'php'; which u can change if u decide to make ur pages end in a diffrent ending for security reasons And $root_path would be decleared on the page that calls the processQuery function, the variable would be the root (like if you 3 directorys away (into not out) from the starting directory it would be: $root_path = './../../../';
-
nevermind i fixed it doing the require_once actally does work sorry to prove u wrong buddy =/
-
yea but in .js file if u do: <!-- //code below //--> Then if u try to go to http://www.somesite.com/somefile.js and it has whats mentioned above then the html takes the whole thing as a comment, but in js it works as a file with html ---------------- I think that works for CSS files as well :s
-
so theres no way to make the person inable to read my code (in JS?) =/