coldasice
Members-
Content Count
34 -
Joined
-
Last visited
Everything posted by coldasice
-
thanks.. i dont know ajax.. only php.. dont know js either =D but i get to it =D
-
mby u forgot or did anything wrong in the connection of mysql db.. or else mby iu forgot to change table name or somthing =D
-
how to make this clock auto refresh =?or go like those flash clocks =) is what i realy meant
-
any ways.. use md5($password) for secure password
-
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
need somewaited many days be4 replay :)help? -
okey then its allowed
-
if its ur own.. u dont need any parts
-
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
hmmmm... strange.. when i put this in my admin.php... it dosnt work.. but when i put it in a include file it works.. O.o like $mode = $_GET['mode']; $id3 = $_GET['id']; if ($do == "admin"){ // if do=admin, do... if ($mode == "edit"){ // if mode=edit, do... if ($id3 == "3"){ include "edit.admin.php"; } else { include ('admin.php'); } } } linenums:0'>$do = $_GET['do'];$mode = $_GET['mode'];$id3 = $_GET['id'];if ($do == "admin"){ // if do=admin, do...if ($mode == "edit"){ // if mode=edit, do...if ($id3 == "3"){include "edit.admin.php";} else {include ('admin.php');}}} and put it in.. include.edit.php and do like in admin.php i do include ('include.edit.php') then i just refreseh admin.php and add the include in top.. ;=) it basicly works... but not the way its suppost when i use it as an include -.- .. but when i add the pure code.. in to admin.php it dont work at all (( <--- scratch that.. it works.. seems like it works =D.. btw if i put a hidden field or two in the form.... in admin.. can i then use that instead of those ifs? question 2. if($subaction == "new"){ echoheader("options", "New Template"); echo"<form method=post action=\"$PHP_SELF\"><table border=0 cellpading=0 cellspacing=0 width=100% height=100%><tr><td >Create new template based on: <select name=base_template>"; foreach($templates_list as $single_template){ echo "<option value=\"$single_template\">$single_template</option>"; } echo '</select> with name <input type=text name=template_name> <input type=submit value="Create Template"> <input type=hidden name=mod value=options> <input type=hidden name=action value=templates> <input type=hidden name=subaction value=donew> </td></tr></table></form>'; echofooter(); exit; } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Do Create the new template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if($subaction == "donew"){ if(!eregi("^[a-z0-9_-]+$", $template_name)){ msg("error", "Error", "The name of the template must be only with letters and numbers", "$PHP_SELF?mod=options&subaction=new&action=templates"); } if(file_exists("./data/${template_name}.tpl")){ msg("error", "Error", "Template with this name already exists", "$PHP_SELF?mod=options&subaction=new&action=templates"); } if($base_template != ""){ $base_file = "./data/${base_template}.tpl"; } else{ $base_file = "./data/Default.tpl"; } if (!copy($base_file, "./data/${template_name}.tpl")) { msg("error", "Error", "Can not copy file $base_file to ./data/ folder with name ${template_name}.tpl"); } @chmod("./data/${template_name}.tpl", 0777); msg("info", "Template Created", "A new template was created with name <b>${template_name}</b><br>", "$PHP_SELF?mod=options&action=templates"); }here i noticed.. these <input type=hidden name=subaction value=donew> if($subaction == "donew") so do these 2 have any thing in common? but why is name $subaction?.. and why cant i find any $subaction =.. only $subaction ==.. :( -
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
im sorry for all the questioning.. this makes it easyer =) gona test now =D [edit] thanks this works.. but just wondering where to place this????? like in my edit.. or just in my "template"? -
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
i think u all misunderstand me... i dont care about layout...... i care about code... jlhaslip.. i dont understand yours... basicly this template comes from cutenews... and when i press a link.. it uses template.. and get all links inside.. the .. like when i press news... it goes template.com/index.php?do=news?id=12&mod=edit.. for example :=) <- this will show in adress bar and when it does it access page news with id2 and in edit mode =) <- example... and all that happens in index template.. [hr=noshade] [/hr] lets go over this again.... what i want to do when do=admin is show feks the admin.php and when it shows do=admin&mode=edit&id=1 it shows the edit.admin.php where the user is id 1 think i formuled it better=? and i dont know if this is written in the template.. or in the edit.admin.php =? -
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
yeah i guessed so.... -.- but its the function not the layout... i have another look now that im awake =D -
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
ARG!!! still dont get it.... can u post result.. on that one.. maby that clears it.. maby fill in the id.. -.- sorry im at a total stop -.- -
[php]diffrent Type Of Template [id] With Includes ;)
coldasice replied to coldasice's topic in Programming
hmm.. didnt quite understand so u say if i do somthing like this`? elseif($_POST['do'] == "admin") { elseif ($_POST['&id'] == '$id'){include("./edit.admin.php");} } it will enter edit.admin.php with these tags? do=admin&id=1 ? btw i guess u know where i found this.. can this be done inside the edit.admin.php or a function? i just thought it way of doing this was awsome.. the other ones i just get blank side of.. nvm this.. just slipped.. <- delete -
<?PHP?><html><head><title>Example</title><style><!-- A { color: #003366; text-decoration: none; } A:link { color: #003366; text-decoration: none; } A:visited { color: #003366; text-decoration: none; } A:active { color: #54622D; } A:hover { color: #54622D; }BODY,TD,TR{ font-family: verdana, arial, sans-serif; color:#000; font-size:11; font-weight:normal;}.banner { font-family: georgia, verdana, arial, sans-serif; color:white; font-size:x-large; font-weight:bold; border-left:1px solid #FFF; border-right:1px solid #FFF; border-top:1px solid #FFF; background:#003366; padding:7px;}.description{ font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:bold;}//--></style></head><body bgcolor="#ffffff"><div align="center"><center><table border="0" width="700" cellspacing="0" cellpadding="0"><tr> <td class=banner > Put here your title<br> <span class="description">and this is your description</span> </td></tr><tr><td> </center> <table border="0" width="100%" cellspacing="0" cellpadding="6"><tr> <td width="180" valign=top style="border-right: 1px dotted #000000;"><table border="0" width=93% cellspacing="0" cellpadding="0"> <tr><td width="100%" style="border-top: 1 solid #000000; border-bottom: 1 solid #000000" bgcolor="#F3F4F5" height="26"><p align="left"> <b><font color="#003366">Navigation</font></b></p></td> </tr> <tr><td width="100%"> </td> </tr> <tr><td width="100%"> <a href="">main page</a></td> </tr> <tr><td width="100%"> <a href="?do=admin">admin</a></td> </tr> <tr><td width="100%"> <a href="?id=$id">edit admin</a></td> </tr> <tr><td width="100%"> <a href="?do=main">other link</a></td> </tr> <tr><td width="100%"> <a href="">other link</a></td> </tr> <tr><td width="100%"> </td> </tr> <tr><td width="100%" style="border-top: 1 solid #000000; border-bottom: 1 solid #000000" bgcolor="#F3F4F5" height="26"><p align="left"> <font color="#003366"><b>Quick search</b></font></p></td> </tr> <tr><td width="100%"></td> </tr> <tr><!-- The Quick Search Form --><form method="post"><td width="100%" align="center"> <br><input type="text" name="story" size="14"><input type="hidden" name="do" value="search"></td></form><!-- End of the Search Form --> </tr> <tr><td width="100%"> </td> </tr> <tr><td width="100%" style="border-top: 1 solid #000000; border-bottom: 1 solid #000000" bgcolor="#F3F4F5" height="26"><p align="left"> <b><font color="#003366">banners/sponsors</font></b></p></td> </tr> <center><tr><td width="100%"> </td></tr><tr><td width="100%"> put some banners here</td></tr><tr><td width="100%"> </td></tr><tr><td width="100%"> and another banners here</td></tr><tr><td width="100%"> </td></tr><tr><td width="100%" style="border-top: 1 solid #000000; border-bottom: 1 solid #000000" bgcolor="#F3F4F5" height="26"><p align="left"> <font color="#003366"><b>Friends</b></font></p></td></tr><tr><td width="100%"> </td></tr><tr><td width="100%"> </td></tr><tr><td width="100%"> <a href="http://news.google.com/news?cf=all&hl=en&pz=1&ned=us&q&js=0; target="_blank">Google News</a></td></tr><tr><td width="100%"> <a href="https://www.mozilla.org/en-US/; target="_blank">Mozilla.org</a></td></tr> </table> <p align="center"><br><br> <br> <br> <br> </center> </td> <td width="520" valign="top" align="center"><table border="0" width="453" cellspacing="1" cellpadding="3"><tr><td width="441"><?PHP/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here we decide what page to include ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */if($_POST['do'] == "search" or $_GET['dosearch'] == "yes"){ $subaction = "search"; $dosearch = "yes"; include("./search.php"); }elseif($_GET['do'] == "admin"){ include("./admin.php"); }elseif($_POST['do'] == "admin" || $_POST['&id'] == '$id') { include("./edit.admin.php"); } //tryed.. but dont work =Delseif($_POST['do'] == "admin") { include("./admin.php"); }?></td></tr></table> </td> </tr> </table> </td> </tr></table><br><br><center><table border=0 width=700 style="border-top: 1px dotted #000000;"><tr><td> <p align="center">put your footer and copyright here</td></tr></table></body></html> well basicly what i wonder here is if this is a good way.. :)it works perfectly...well another thing is.. it works with like do=asdbut how can i do . do=asd&id=1231&google=123if its possible that is.. as u see i tryed.. ;O
-
How To Make A Web Browser Visual Basic 6
coldasice replied to rejected's topic in General Discussion
lol wtf.. no. this is far from of topic -.- -
thanks for ur anser... well u see..... i posted it with a id named cmd.... lol so when i used id it didnt work.. but now it works.. and i dont know why in the secound script it wasnt there [sOLVED]
-
<?phpsession_start(); include "database.php";if (!$_SESSION["valid_user"] || $_SESSION['userlevel'] < 9){// User not logged in, redirect to login pageHeader("Location: main.php");}$result = mysql_query("select * from users order by id asc");while($r=mysql_fetch_array($result)){$username=$r["username"];$info=$r["info"];$msn=$r['msn'];$email=$r["email"];$id=$r["id"];$password=$r["password"];$userlevel=$r["userlevel"];echo "<table width='100%' border=0 cellpadding=1 cellspacing=0> <form name=login action='edit.admin.php?cmd=$id' method=post> <tr> <td>user ID</td> <td><input type=text name=userID value='$id' disabled='disabled' style='width:150;' id='userID'></td> </tr> <tr> <td>User Level</td> <td><input type=text name=UserLevel value='$userlevel' disabled='disabled' style='width:150;' id='UserLevel'></td> </tr> <tr> <td>Username</td> <td><input type=text name=username value='$username' disabled='disabled' style='width:150;' id='username'></td> </tr> <tr> <td>Password</td> <td><input type=text name=password value='$password' disabled='disabled' style='width:223;' id='password'></td> </tr> <tr> <td width=80>Email: </td> <td width='160'><input type=text name=email value='$email' disabled='disabled' style='width:150;'></td> </tr> <tr> <td>MSN: </td> <td><input type=text name=msn disabled='disabled' value='$msn' style='width:150'></td> </tr> <tr> <td>Info: </td> <td><textarea rows='10' cols='45' disabled='disabled' name='info' id='info'>$info</textarea></td> </tr> </tr> <td><input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Edit\" /></td> </form> </table><br /> ---------------------<br />";}echo "<p><a href=\"member.php\">Click here to go back to info page!</a></p>";?> this is my main scriptand i want to transfer this over here.. by using id... <?phpsession_start(); include "database.php";if (!$_SESSION["valid_user"] || $_SESSION['userlevel'] < 9){// User not logged in, redirect to login pageHeader("Location: main.php");}$result = mysql_query("select * from users where id=id2'");$r = mysql_fetch_array ($result);$username=$r["username"];$info=$r["info"];$msn=$r['msn'];$email=$r["email"];$id=$r["id"];$password=$r["password"];$userlevel=$r["userlevel"];echo "woot :". $id;echo "<table width=\"100%\" border=0 cellpadding=1 cellspacing=0> <form name=login action='$php_self?' method=post> <tr> <td>user ID</td> <td><input type=text name=userID value='$id' disabled='disabled' style='width:150;' id='userID'></td> </tr> <tr> <td>User Level</td> <td><input type=text name=UserLevel value='$userlevel' style='width:150;' id='UserLevel'></td> </tr> <tr> <td>Username</td> <td><input type=text name=username value='$username' style='width:150;' id='username'></td> </tr> <tr> <td>Password</td> <td><input type=text name=password value='$password' style='width:223;' id='password'></td> </tr> <tr> <td width=80>Email: </td> <td width='160'><input type=text name=email value='$email' style='width:150;'></td> </tr> <tr> <td>MSN: </td> <td><input type=text name=msn value='$msn' style='width:150'></td> </tr> <tr> <td>Info: </td> <td><textarea rows='10' cols='45' name='info' id='info'>$info</textarea></td> </tr> </tr> <td><label> <input type='submit' name='edit' id='edit' value='edit'> </label></td> </form> </table>";echo "<p><a href=\"member.php\">Click here to go back to info page!</a></p>";?> this is where i want that from the first inprinted ;O
-
Php Simple Login Tutorial Learn how to make a simple login
coldasice replied to HmmZ's topic in General Discussion
hm if i got it right if ( $obj = @mysql_fetch_object($r) ) { // Login good, create session variables [b]$_SESSION["valid_id"] = $obj->id;[/b] $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); it registres if the login is valid.. then fix so that the sessions register the logins so that when you got to a protected page " also can only be accessed if you have loged in" a basic a login is made with session with a slighly cookies mix .. so $_SESSION["valid_id"] = $obj->id;[/b] // basicly stores the id.. $_SESSION["valid_user"] = $_POST["username"]; / this makes the valid_user to your user name $_SESSION["valid_time"] = time(); // this input the time mby when you loged in.. am i right if not.. please say so did you understand now =D? -
thanks for ur respons.. but.. lol ;O that dont help =D and yeah.. its a part of a learning login.. so basicly my username is in the session thanks for trying and its solved here is code =D and thank to you sonesay. for helping me =D this happende bcouse i made the thig from scratch.. but..... i got some kind of error.. but i dont remember what error it was... so i found some boxes on net.. and copyed source and edited it to fit what i wanted.. and just so you know be4 u posted.. i solved this.. i got fed up.. and saw trough code. and saw it.. <?phpsession_start(); include "database.php";if (!$_SESSION["valid_user"]){// User not logged in, redirect to login pageHeader("Location: main.php");}$username = $_SESSION["username"];if(isset($_POST['submit'])){$email2 = $_POST['email'];$msn2 = $_POST['msn'];$info2 = $_POST['info'];$updateemail = "UPDATE users SET email='$email2', msn='$msn2', info='$info2' WHERE username='$username'"; mysql_query($updateemail) or die("culd not edit your info"); echo "info updated";}$query = mysql_query("SELECT * FROM users WHERE username='$username'");$all = mysql_fetch_array($query);$email = $all['email'];$msn = $all['msn'];$info = $all['info'];echo " <table width=\"100%\" border=0 cellpadding=1 cellspacing=0> <form name=login action='$PHP_SELF' method=post> <tr> <td width=80>Email: </td> <td width='160'><input tabindex=1 type=text name=email value='$email' style='width:150;'></td> </tr> <tr> <td>MSN: </td> <td><input type=text name=msn value='$msn' style='width:150'></td> </tr> <tr> <td>Info: </td> <td><textarea rows='10' cols='45' name='info' id='info'>$info</textarea></td> </tr> </tr> <tr> <td> <td colspan=\"3\"> <table border=0 cellspacing=0 cellpadding=0 width=100%> <tr> <td width=50%> <input type=\"submit\" name=\"submit\" id=\"submit\" value=\"submit\" /> </form> </table>";echo "<p><a href=\"member.php\">Click here to go back to info page!</a></p>";?> [sOLVED]
-
well i replaced $username with my username... coldasice... as in db.. and it still wouldnt work well all i can say is that update dosnt work this is my current code yes phpmyadmin.. is what i use evry time i press submit.. well.. i go pms.. and insert email = asdasdasd info = asdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdsadasdasda and then i go to edit.php.. and all is there.. then i press submit... boom.. all emty.. it emptyes.. my damn row where the user name is inserted................... now my guess is that its somthing wrong with update
-
well as far as i register.. the update querry dont do *BLEEP*....... and i moved echo.. dosnt work ;O
-
still dont work it still deletes the whole username row ;/
-
<?/** * Connect to the mysql database. */$conn = mysql_connect("localhost", "root", "cold") or die(mysql_error());mysql_select_db('new', $conn) or die(mysql_error());?> thats my database.. inc is not a script i was just testing out to see what happened if i made the last part a function ;=) basilcy the same it deletes all ;O