392 Forum Posts by "keifer121"
i thought that my first post in about 6 months should be a bump... make a ton of people happy im bringing back this topic, to all web programmers that have doubted stuff, if you got over it and you couldnt find a tutorial on here to help you. PLEASE make one about it, keep this topic strong and alive! this is good it helped meee soo much when i was learning PHP
your right, is crewds up with my code i meant to have
$referer = str_replace($remove,"", "$home");
PHP Advanced Stats
ByKeifer Morken (keifer121)
And of course the beautiful PHP: Main
The Code
<?
$ip= $_SERVER['REMOTE_ADDR']; // grabs ip adress
$ref=$_SERVER['HTTP_REFERER']; // grabs refferer
$remove = array("Sitename/index.php"); // list all your possible home page links here
$home= str_replace($remove,"Home", "$ref"); // replaces teh array above with Home
$remove = array("http://","https://","www.","Sitename.c om","index.php"); // list of junk that takes up
// space
$referer = str_replace($remove,"Home?page=", "$home");// removes the junk form the array above and
//replaces with nothing
if($ref ==""){ // if there wasn't a referer
$lastpage="No Page Viewed Last<br>"; // says that there wasnt a page viewed last
}else{
$lastpage="a href=\"".$ref."\"".$referer."/a<br>"; // links to the real url with the shortend
//name for the link basis
}
echo" Refferer:<br />";
echo " ".$lastpage."";
echo" IP Address:<br /><font size=\"-4\">";
echo " ".$ip."";
echo " ";
echo" <font size="-6"> a href='http://whatismyipaddress.com/'(?)<a </font>";
// echo's all the data we collected and manipulated
?>
Code Breakdown
$ip= $_SERVER['REMOTE_ADDR'];
$ref=$_SERVER['HTTP_REFERER'];
grab and collect the users ip adress and reffering url by using the $_SERVER super globals
$remove = array("Sitename/index.php");
$remove = array("http://","https://","www.","Sitename.c om","index.php");
arrays are lists of data that we have defined
$home= str_replace($remove,"Home", "$ref");
$referer = str_replace($remove,"Home?page=", "$home");
replaces words in a string using the str_replace function
it is defined first by select what words to remove, then what to replace the words with and then teh last paremeter is what its the string to remove from
Demo of this exact script in action at kjmproductions.com
PLEASE NOTEb>
in order for this script to beable to post on newgrounds i had to remove the <a nd > fomr 2 seperate a href tags they were on line 21 and line 30
At 6/19/07 02:38 AM, DFox wrote:At 6/19/07 02:32 AM, keifer121 wrote: Code
Many Thanks
ok thanks, but just as a check would
$extension = '.swf'
if (strpos($_FILES['data'],$extension) === false){
die("Sorry But The File You Selected Was Not A SWF");
}
work?
PHPbb 3 all the way, major improvments
its not a filesize error its just a random error while uploading flashes. dosnt happen all the time and yes they are .swf :p
Hi i have a site called kjmproductions.com, i am using a modified version of pilot doofy's upload script, on ceartian flash files it fails during uploading saying" Sorry, your file was not of the application/x-shockwave-flash mimetype (yours was )." when it is clearly a flash file, it also only happens for certain flashes,
The Code
If you have a fix please Post here,
thanks in advance, keifer
Coke all the way, all day or night, i have a cooler in my room tahts usually full of it, i need so much cauxe i tent to sleep 18 hours a day :p
hey guys, been a long time since ive been to newgrounds, i thought of a way to help spread PHP and flash ovewr newgrounds while getting PHP:Main known, i was thinking that we should make flash PHP Tutorials jsut to help people learn and want to find out more about PHP as we also get the flash credits.
Just an idea, post back please
im going to be getting a wii soon, i could test out the mod chip, ive never had expirence with a modchip before and also i know windows sucsk but mac is worse, try windows vista it might be better than XP and PC World rates it better than Mac
Dfox Just Letting You Know That I Chnaged My Username To Keifer121 form elementalfash
and i have no website ATM so please get rid of the elementalflash link
thanks in advanced
I Say AVG Free Is
1. every 2-3 days theres a new update
2.Free
3.Free Tech Support On Their Forms
4.Loads Fast
5.Free Email Scanning
And The Only Thing you ont get with the free version is 24/7 Phone Tech Support
http://free.grisoft.com
looks like an excellent PHP tutorial, i havnt had the time to fully read it all or try it but WoW good job man :p
really, i looked to make sure but ive never seen it, do you know why it got dissed?
PHP:Password Protection By Elementalflash
Hi, i made a simple and easy to use password protection script,
it should be very easy to use and understand, theres 4 code blocks, the begining is set with the password and displays the form to enter the password, if the password is right it goes to the 2nd code block witch is your script or page or anything and the third code block is where the wrong password has been enterd displayed the 4th just ends the else statments and the other if statment.
The Code
<?
$rpassword = ""; //supply the real password here
if (!$_POST['password']){
?>
<form name="password protectioin" method="post" >
<div align="center">
<table width="228" border="1">
<tr>
<td>Password?:</td>
<td><input name="password" type="password" id="password" value="password"></td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit">
</div>
</form>
<? }
if ($_POST['password']){
$password = $_POST['password'];
if($password==$rpassword){ ?>
Passwords Are Right
<? }
else{ ?>
Passwords are not right
<? }} ?>
Well just saying it might not help so i will show my code
functions.php
<?
function randomcode() {
$available = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 1, 2, 3, 4, 5, 6, 7);
# Above is a list of everything allowed in the string
for($i = 1; $i <= 25; $i++) {
$tmp = mt_rand(0, ( sizeof($available) - 1 ));
$str[] = $available[$tmp];
} // End for loop
return @join($str);
}
function randomval() {
$available = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
# Above is a list of everything allowed in the string
for($i = 1; $i <= 5; $i++) {
$tmp = mt_rand(0, ( sizeof($available) - 5 ));
$str[] = $available[$tmp];
} // End for loop
return @join($str);
}
function cleanstringp($password) {
$password = htmlspecialchars($password);
$password = addslashes($password);
$password = mysql_escape_string($password);
$password = strip_tags($password);
}
function cleanstringu($username) {
$username = htmlspecialchars($username);
$username = addslashes($username);
$username = mysql_escape_string($username);
$username = strip_tags($username);
} ?>
Register.php
<?
include('config.php');
include("functions.php");
$valcode = randomval();
if (!$_POST[!register])
{ ?>
<form name="form1" method="post" action="">
<table width="277" border="1" align="center">
<tr>
<td width="107">Username</td>
<td width="84"><input name="username" type="text" value="username"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" id="password" value="password"></td>
</tr>
<tr>
<td><p>Confrim Password </p>
</td>
<td><input type="password" name="cpassword" value="password"></td>
</tr>
<tr>
<td>Email</td>
<td><input name="email" type="text" id="email" value="email@email.com"></td>
</tr>
<tr>
<td>Confrim Email </td>
<td><input name="cemail" type="text" value="email@email.com"></td>
</tr>
<tr>
<td><input name="val" type="val" maxlength="5"></td>
<td><? print($valcode); ?> </td>
</tr>
</table>
<div align="center">
<input type="submit" name="register" value="register">
</div>
</form>
<? } ?>
<?
if ($_POST[register]) {
$username = $_POST[username];
$password =$_POST[password];
$cpassword =$_POST[cpassword];
$email =$_POST[email];
$cemail =$_POST[cemail];
$val =$_POST['val'];
$reg ="" ;
if($username==NULL|$password==NULL|$cpassword ==NULL|$email==NULL|$cemail==NULL|$val==NULL ) {
echo "A field was left blank.";
}else{
if($password!=$cpassword){
echo "Passwords Dont Match";
}
else { if($email!=$cemail){
echo " Emails dont Match";
}
else{
if($val!= $valcode){
echo "Validation Codes Dont Match";}
}}}}?>
it should be but it dosnt matter.
Tried and failed.
this is extremly confusing for me and probally everyone else.
Thanks for trying tho Dfox
Hi im making a massive user system but foir some extremly odd reason part of my registering script cut out on me.
i have a function witch creates a random number 5 numbers long,
i have a form where they enter there info and then they gotta look at the numbers and enter them in the field, hte page then checks to make shure all the fields are filled in , if it pases it checks to see if the passwords are the same, then the emails, then the 2 validation codes.
the one that was made with the function is
$valcode = randomval();
and the user inputed is
$val = $_POST[val];
but nomatter what it fails on checking the to validation codes, i cant figure out why buy if i place an extra } right at the end of my check to see if all the fields are filled out it passes but it dosnt check if its right or wrong.....
I am very confused and tired. any help would be extremly apreciated
agreed i would much rather use AVG than norton
zomg i want to delte a file in php but i want it 2 have a 5 second count down beofer it deltes how do i do it , i know how to delte the file just not the counter part :p please help
also a bit oftopic what extensions are good for webdevopment lol i never installed any etension before just themes
i dont like the one that came wiht beta 2 i just think its to plain
i tried blackjapan i dont like it taht much at all and 2 the dude who said WTF Firefox is another web browser thats better than IE
Hey All whats your favorite firefox theme for 1.5.X ?
i like macfox quite a bit
explain im not that exhnical ,,, Also i have mycmputer Wireless and Conected through Cable (lol)
hello i am at the stage of my server that i need help setting up the dynDNS and the ports so others can view it aswell
i am using an SMC wireless Baricade G router running Xampp on a Windows any help would be apreciated

