-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
[SOLVED] How to do this without using globals
MadTechie replied to AV1611's topic in PHP Coding Help
thats what i thought until then a script with no globals except a super global $_FILES !! ??? maybe a misunderstanding of what register_globals is! -
either <?php if ($pass == "") { $password = "X"; }else{ $password = $pass ; } echo "$password" ; ?> or <?php $password = $pass ; if ($pass == "") { $password = "X"; } echo "$password" ; ?> or <?php $password = $pass ; if (empty($pass)) { $password = "X"; } echo "$password" ; ?>
-
Probably some bugs in their but its a start... <?php session_start(); $md5 = md5(microtime() * mktime()); $string = substr($md5,0,5); ?> <form action="check.php" method="post"> <input name="code" type="text" /> <img src="captcha.php" /> </form> captcha.php (the imagefile) <?php $captcha = imagecreatefrompng("./captcha.png"); $black = imagecolorallocate($captcha, 0, 0, 0); $line = imagecolorallocate($captcha,233,239,239); imageline($captcha,0,0,39,29,$line); imageline($captcha,40,0,64,29,$line); imagestring($captcha, 5, 20, 10, $string, $black); $_SESSION['key'] = md5($string); header("Content-type: image/png"); imagepng($captcha); ?> check.php <?php session_start(); if(md5($_POST['code']) != $_SESSION['key']) { die("Error: You must enter the code correctly"); }else{ echo 'You entered the code correctly'; } ?>
-
to use www.example.com/index.php?t=23433&e=1122test echo $_GET['t'];//returns 23433 echo $_GET['e'];//returns 1122test of course it doesn't have to be echo!
-
[SOLVED] How to do this without using globals
MadTechie replied to AV1611's topic in PHP Coding Help
Erm.. are you talking about Super global or register globals? why would super globals be off ? (infact i didn't know you could turn superglobals off) if you mean register globals then you can use $_FILES -
12:00am is 00:00:00 so theirs no time set in the table maybe change <?php $game_time = $row['game_time'] if ($game_time == '00:00:00') { echo "TBA" ; } else { echo $game_time ; } to $game_time = $row['game_time']; if(date("Ymd", $game_time) == 00000000) { $game_time = "TBA"; }
-
$game_time = $row['game_time'] to $game_time = $row['game_time'];
-
starting point imagecopymerge EDIT: User Contributed Notes are useful
-
keeping data alive after the submit button is hit
MadTechie replied to ms1990kl's topic in PHP Coding Help
to handle arrays do this $_SESSION['answer'][$count] = ""; echo $_SESSION['answer'][$count] think of $_SESSION['answer'] as you would $answer common problems with SESSION are due to the fact their headers see this post -
so www.x.com/home/health/ ../ (back one) www.x.com/home/ ../ (back one) www.x.com/ then forward scripts/visitors/comments/connect.php <?php include("../../scripts/visitors/comments/connect.php"); ?>
-
for <?php include ("http://www.x.com/home/index.php"); ?> to work, your need allow remote include to be turned on in the php.ini allow_url_include On this directive did not exist until php 5.2.1 1) you cannot use it with versions prior to 5.2.1 2) You’ll need to add it to your php.ini, as you probably won’t find it in there already 3) allow_url_fopen has to be enabled 4) This has to be in the php.ini server-side, and not the .htaccess
-
Erm.. OK as YOU are in the process of creating or changing this user login system to a user management system. why did you post here.. also i don't see the "Problem".. were not here to do the work for you...! try the freelance section
-
what about echo "$ceiling_ft"; echo " FT"; to echo "$ceiling_ft"; echo " FT"; echo "<br>";
-
WHERE `rrn` ='1'
-
erm.. you may wany to get that code again.. note the one you posted replaced the spaces with
-
keeping data alive after the submit button is hit
MadTechie replied to ms1990kl's topic in PHP Coding Help
on the form. add some hidden fields or use sessions were need to see some code -
[SOLVED] Load Form With Database Information
MadTechie replied to usadarts's topic in PHP Coding Help
is this correct ? $update = "UPDATE `homepage` SET `date` = $date, `comments` = $newcomments WHERE `rrn` = 1"; as i am not going to do all the work..! -
check here for reasons why its probably failing
-
Echo thorpe. perfect reply! google "php dynamic drop down"
-
[SOLVED] Load Form With Database Information
MadTechie replied to usadarts's topic in PHP Coding Help
please click topic solved (bottom left) if we're done -
[SOLVED] Retrieving Data from Multiple Tables???
MadTechie replied to kemper's topic in PHP Coding Help
Read the lesson here and here, this will display both tables SELECT * FROM f2007_scheduling, f2007_division WHERE division='$division' ORDER BY date ASC this will display both tables where division is $division SELECT * FROM f2007_scheduling, f2007_division WHERE f2007_scheduling.division='$division' AND f2007_division.division_id = '$division' ORDER BY date ASC -
[SOLVED] Load Form With Database Information
MadTechie replied to usadarts's topic in PHP Coding Help
i assume echo "$comments"; should be echo $row['comments']; -
[SOLVED] Retrieving Data from Multiple Tables???
MadTechie replied to kemper's topic in PHP Coding Help
No $division wasn't set, but $division_id was // mySQL Table $division_id = $_GET['division_id']; $sql = "SELECT * FROM `f2007_scheduling` WHERE division='$division' ORDER BY date ASC"; as for joins nice example here -
[SOLVED] Load Form With Database Information
MadTechie replied to usadarts's topic in PHP Coding Help
change echo "<form action=\"posthp.php\">"; echo "<textarea name=\"newcomments\" cols=\"100\" rows=\"20\">"; echo "$comments" echo "</textarea>"; echo "<input type="submit" />"; echo "</form>"; to echo "<form action=\"posthp.php\">"; echo "<textarea name=\"newcomments\" cols=\"100\" rows=\"20\">"; echo "$comments"; //ADDED ; echo "</textarea>"; echo "<input type=\"submit\" />"; // " to \" echo "</form>"; -
erm.. well it uses setcookie that can only be set from the header.. what about an mySQL basket ? i haven't looked at this in detail but the description looks ok