-
Posts
266 -
Joined
-
Last visited
Everything posted by devWhiz
-
how can I use preg_match to take aHjpOzsQ9YI out of www.youtube.com/watch?v=aHjpOzsQ9YI, I am still unfamiliar with regex, I've been writing php for alomost 4 years now and still don't know regex lol Any help is appreciated.. Thanks -CLUEL3SS
-
Well I just wrote this function and it worked.. I see what I was doing wrong now.. $handle = fopen("http://windows.php.net/downloads/releases/php-5.3.13-nts-Win32-VC9-x86.msi", "r"); $newfile = fopen("php.msi", "w"); while(!feof($handle)){ $read = fread($handle, 1024*; $write = fwrite($newfile, $read); } fclose(); echo "Done\n"; sleep(20000);
-
$output1['id'] = $id; $output1['name'] = $name; $output1['first_name'] = $first_name; $output1['last_name'] = $last_name; $output1['username'] = $username; $output1['birthday'] = $birthday; $output1['gender'] = $gender; $output1['hometown']['id'] = $hometownid; $output1['hometown']['name'] = $hometown; $output1['location']['id'] = $locationid; $output1['location']['name'] = $location;
-
Say I a URL that automatically prompts you to download a file as soon as the page loads, what code can I use to be able to use PHP to download the file that is prompted from the URL? For example; when you visit http://windows.php.net/downloads/releases/php-5.3.13-nts-Win32-VC9-x86.msi it automatically prompts you to download the PHP installation file, how can I use a PHP script to save the instillation to my computer automatically? Thanks! -CLUEL3SS
-
Help with a script to create every combination of 2 numbers
devWhiz replied to devWhiz's topic in PHP Coding Help
Not as hard as I figured it would be, thank you! -
Honestly, for something like this I don't know how to go about creating this script.. So I want to create a script that will generate every combination of 2 numbers that range from 0-749, so 750x750 = 562500 possible combinations, so for example, 0/749, 43/87, 0/0, 1/1, 2/1, 1/2, 500/450, 405/673, etc.. How would I go about starting to write a script that can generate all of the possible combinations and and put them in an array or write them to a file? Thanks for the help in advanced! -CLUEL3SS
-
so something like this $_POST['user_name'] = "CLUEL3SS"; $_POST['user_pass'] = "test123"; $_POST['confirm_pass'] = "yes123"; $_POST['user_email'] = "[email protected]"; $_POST['confirm_pass'] = '[email protected]'; $userData = array_map('mysql_real_escape_string', $_POST); print_r($userData);
-
$_POST['user_name'] = "CLUEL3SS"; $_POST['user_pass'] = "test123"; $_POST['confirm_pass'] = "test123"; $_POST['user_email'] = "[email protected]"; $_POST['confirm_pass'] = '[email protected]'; function testFunc($inputVars){ foreach($inputVars as $key=>$value){ $escapeData[$key] = mysql_real_escape_string($value); } return $escapeData; } var_dump(testFunc($_POST)); I'm trying to make a user system for my site and I want to make sure its secure enough to void off injection attackers. Any useful advice and and suggestions would be greatly appreciated! Thanks!
-
http://php.net/manual/en/book.mysql.php refer to that to learn more about databases
-
I see a couple people using the ? operator in php and was curious as to how it works?
-
$myQuery = "SELECT * FROM user"; $runQuery = mysql_query($myQuery); while($myArray = mysql_fetch_assoc($runQuery)){ echo $myArray['user_id']." ".$myArray['user_name']."<br />"; sleep(10); }
-
I don't understand what you're trying to achieve, can you explain a little further?
-
Where would you guys recommend I go to learn and become familiar with writing Object Oriented PHP code? Also what are the advantages of writing object oriented code? Is it better than the 'traditional' coding style? I mean without using Objects, Classes, Methods, etc.. Is one way more efficient than the other? I've been seeing a lot of object oriented php code lately, and I'm just curious and want to learn the concept of OOP, any help is appreciated. Thanks! -CLUEL3SS
-
You can use str_replace to remove the space from the zipcode... $postalCode = $geodata['postcode']; $postalCode = str_replace(' ','',$postalCode); Hope this helps... -CLUEL3SS
-
Can you post the full xml stream?
-
I would put the query as the param for mysql_real_escape_string? $query = "SELECT * FROM users"; $escape = mysql_real_escape_string($query); $run = mysql_query($escape); that query is just an example
-
Would this be effective in protecting against SQL injection? function runQuery($sqlQuery){ $sqlQuery = str_replace(array('@@','))'),'\"',$sqlQuery); $sqlQuery = str_replace(array('++','--'),"\'",$sqlQuery); $sqlQuery = str_replace(array('**','&&'),' ',$sqlQuery); $runQuery = mysql_query($sqlQuery) or die(mysql_error()); return $runQuery; }
-
Doh! I didnt even realize that, thanks man! Thats what I get for trying to rush ey lol
-
it is still returning the fatal error Fatal error: Call to undefined function echo_post() in /home/content/96/44fxx9xxxx/html/xxxxdir/index.php on line 14
-
its a custom function I made myself.. function echo_post($postvar){ return $postvar; }
-
<html> <center> <form method="post" action=""> <b>Email</b><br><input type="text" name="email"/><br> <b>Password</b><br><input type="password" name="password"/><br> <input type="submit" name="submit" value="Login"/><br> </form> <?php if(isset($_POST['submit'])){ echo echo_post($_POST['email']); function echo_post($postvar){ return $postvar; } } ?> </center> </html> the filename is index.php How come I get the undefined function echo_post on line 14? I know it is probably something simple but I am kind of new to this, if you could help me out that would be great
-
well I was wanting to make scripts to put on my site and then only let a few people use the site by the ip address, what would be the best way to allow only certain people to use the script on the site, based on the ip? Thanks
-
With myself, I enjoy learning something I am interested in, and tend to put alot of effort into something I want done.
-
Hi I was curious as to if you guys could possibly point me in the right direction so I can learn what is needed in order to implement a system on my website that allows users to login and then I could make only certain users have access to certain pages and etc, I don't have any mysql knowledge at all and I'm pretty sure I'm going to need to know that so if anyone could point me in the right direction and put me on on the right track to learning this or a guide I could go off of and see how everything works, I appreciate it. Thanks! CLUEL3SS