Jump to content

Gayner

Members
  • Posts

    549
  • Joined

  • Last visited

    Never

Everything posted by Gayner

  1. Prettty much this is all in my index.php <?php if (isset($_GET['view'])) { echo $_GET['view']; exit; } if (isset($_GET['Id'])) { // Get all the data from the "example" table $result = mysql_query('SELECT id,user_name,date FROM users WHERE id = '.$_GET['Id'].'') or die(mysql_error()); // keeps getting the next row until there are no more to get while($data = mysql_fetch_array($result)) { // Print out the contents of each row into a table $username = $data['user_name']; echo "<title> Viewing User: $username</title>"; echo '<a href=\'index.php\'>Pray4Life</a> -> Viewing Profile: <a href=./?Id='.$data['id'].'>'.$username.'</a>'; } exit; } else { navbar("<a href=./?>Pray4Life</a>", "Prayer List", "Prayer Center -> Main"); } ?> <fieldset><legend>Prayer List</legend> <table class="ftb"> <colgroup align="left"> <col width="30%" align="left"></col> <col width="12%" align="left"></col> <col width="7%"></col> <col width="7%"></col> <col width="18%" align="left"></col> </colgroup> <tr> <th align='left'>Prayer Title</th> <th>Author</th> <th>Replies</th> <th>Views</th> <th>Last Reply</th> </tr> <?php $query="SELECT `id`,title,time,level,nameid,name,prays FROM prays ORDER by id DESC"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { if (!$row['prays']) $prays = "0"; else $prays = $row['prays']; if (!$row['nameid']) $l = ''.$row['name'].''; else $l = '<a href="?Id='.$row['nameid'].'">'.$row['name'].'</a>'; $color_one = ' class="bc1"'; $color_two = ''; static $i = 0; $color = ($i % 2) ? $color_one : $color_two; $i++; echo '<tr'.$color.'> <td><a href="?view='.$row['id'].'"><b>'.$row['title'].' </b></a> ('.$prays.' Prayers) </td> <td>'.$l.'<br><span class="desc">'.$row['time'].'</span></td> <td>15,117</td> <td>448,857</td> <td class="lc"><a href="user.php?i=219525">Arsenic_Touch</a><br><span class="desc">1 hours, 2 minutes ago</span></td> </tr>'; } mysql_free_result($result); ?> </table></tr> </fieldset> it works fine and i am used to wear all my code is at but wil this type of coding slow down php? i mean not coding but like if they all bunched up?
  2. This is a easy fix just delete ur session id cookie lol
  3. i was editing and i accidently made my session to like weird variables and now im all messed up i need a function to turn of session and restart it? how thanks lol
  4. http://php-login-script.com/ that works and is free and has plenty of nice features for u to get started, what i use man it's wonderful
  5. no it's array on the mysql vs row.. why cant i use row but if i use array on mysql fetch it works?
  6. OK WOW I USED THIS AND NOW IT WORKS? CAN SOMONE TELL ME WHY THE HELL PHP IS DOING THIS TO ME? AM I FREAKN POSSESSED? <?php $sql="SELECT id,title,time,level,nameid FROM prays LIMIT 20"; $result=mysql_query($sql); // Start looping rows in mysql database. while($rows=mysql_fetch_array($result)){ echo $rows['id']; } mysql_close(); ?> WHAT IS THE DIFFERENCE. PLZ TEL ME
  7. no look <?php if (!isset($_SESSION['user_name'])) { // <td align="right">Private?:</td> //<td><input type="checkbox" name="private" value="1"/></td> //echo 'Since you are a Guest, or not <a href=register.php>Registered</a>, you can still Submit a Prayer! <br>'; $l = "<img src=images/warn.png> If you would like to Keep Track of your Prayers and so on, Please just make a account by Clicking <a href=register.php>here!</a> *It's Free! <br> "; $pray = '<td class="cL" align="right">Your Name:</td> <td><input type="text" name="name" value="" size="30" maxlength="100"/> (Since you dont have a account, You can leave this blank if you want)</td>'; } else { $l = ""; } ?> <div><br> <div class="fR ab"><a href="post.php?c=0&f=34">New Topic</a></div> <div class="pager">Page 1 of 4138 <b>1</b><a href="forum.php?f=34&o=25">2</a><a href="forum.php?f=34&o=50">3</a><a href="forum.php?f=34&o=75">4</a></div> </div><fieldset><legend>Prayer Titles</legend> <table class="ftb"> <colgroup align="center"> <col></col> <col width="50%" align="left"></col> <col width="18%" align="left"></col> <col width="7%"></col> <col width="7%"></col> <col width="18%" align="left"></col> </colgroup> <tr> <th></th> <th nowrap>Topic Title</th> <th>Author</th> <th>Replies</th> <th>Views</th> <th nowrap>Last Reply</th> </tr> <?php $query = "SELECT `id`,title,time,level,nameid FROM prays"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { echo $row['id']; } mysql_free_result($result); ?> <tr> <td><div class="e2"></div></td> <td>Sticky: <a href="topic.php?t=16597993&f=34"><b>Donate For Me Please&#33;</b></a> <span class="mpl"><a href="topic.php?t=16597993&f=34&o=0">1</a> <a href="topic.php?t=16597993&f=34&o=10">2</a> <a href="topic.php?t=16597993&f=34&o=20">3</a> <a class="mpll" href="topic.php?t=16597993&f=34&o=15110">»1512</a></span></td> <td><a href="user.php?i=189153">Lajo</a><img src="/images/i6.gif"><br><span class="desc">Mar 27 08 07:26pm</span></td> <td>15,117</td> <td>448,857</td> <td class="lc"><a href="user.php?i=219525">Arsenic_Touch</a><img src="/images/i60.gif"><br><span class="desc">1 hours, 2 minutes ago</span></td> </tr> </table></tr> that's my whole .php
  8. Hi sir ur exactly right!! But i have a problem now trying to pull my data from mysql.. i do this all time but ever sence i went on localhost it's a problem with Undefined index... Instead of making a new topic, (Cause i'll get warned) i'll ask u guys here: <?php $query = "SELECT id,title,time,level,nameid FROM prays"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { echo $row['id']; } mysql_free_result($result); ?> This code is fine, but i get this error: Notice: Undefined index: id in C:\wamp\www\view.php on line 46 Notice: Undefined index: id in C:\wamp\www\view.php on line 46 Notice: Undefined index: id in C:\wamp\www\view.php on line 46 Notice: Undefined index: id in C:\wamp\www\view.php on line 46 I am getting way to much Undefinded Index error this is pissing me off my code is just FINE
  9. Users will just re submit and not have to enter the new captcha.. ? Lol but if i refresh the page, the captcha auto makes a new1 so u cant submit. But if u enter captcha code alrdy, then submit form correctly, and press refresh to auto submit form, it does it? This is a major security risk here is my code, thanks: session_start(); $RandomStr = md5(microtime());// md5 to generate the random string $text = rand(10000,99999); $_SESSION["key"] = $text; $height = 25; $width = 35; $image_p = imagecreate($width, $height); $black = imagecolorallocate($image_p, 100, 5, 5); $white = imagecolorallocate($image_p, 155, 155, 025); $font_size = 16; $text=substr($_SESSION['key'],0,3); imagestring($image_p, $font_size, 5, 5, $text, $white); imagejpeg($image_p, null, 80); then my HTML: <tr class="bts ce"><td colspan=2><b>Security Code Confirmation</b></td></tr> <tr> <td align="right">Your unique security code<input type="hidden" name="secId" value="76c2b0e6f20ed0f1b209bcf39dee8e06"></td> <td> <img src="php_captcha.php"> <br><span class="desc">If The images are broke, please contact us.</span></span> </td> </tr> Is there a way so people cant auto submit form? Captcha works if u refresh but people can just auto submit the form and it will keep submiiting...
  10. It's actually possible bro!
  11. I just need t find the hex color of a image..
  12. Why dont u just download xampp or wampp and use it instead of having a thread with 5 pages of worthless junk, lol Download xampp and install it on ur computer and use that, why do u need DOS in any event, get real comon!
  13. I have a image, it's a blue style off photoshop applied to a random .gif image can i use a php function or something that get's the hex color from that image only the main hex color and return it back to me so i can use it. /
  14. why the hell . i dont want to use isset.. while i code my website i aint putting isset around all ym stuff that's ridicilous is there another way so that IT DOESNT POP UP UNIDENTIFIED INDEX ERRORS PLZ
  15. bcz if i put that, that stupid ass unidefined index error will pop up. all i want to know is how the helld o i make this shorter? why do i have to all this .... stupid isset is a stupid function burn in hell! if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == 'default') { echo '<style type="text/css" media="all">@import url(1.css);</style>'; } if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == 1) { echo '<style type="text/css" media="all">@import url(2.css);</style>'; } if(!isset($_COOKIE['skinid'])) { echo '<style type="text/css" media="all">@import url(2.css);</style>'; } why do i have to use this only way it works w/o unidenified index errors.
  16. cause isset only works if i use numbers but i want to use isset and use letters to but it only works on numbers especially like if(isset($_COOKIE['skinid']) == 1) like if i use if(isset($_COOKIE['skinid']) == "heelo") it wont work
  17. yea i know how to do that but how long char can cookie storE?
  18. Hey, im about to have users submit data into there own cookie but i need the text for the cookie to only allow xx certain amount of data in that cookie :-) how would i do that
  19. setcookie("skinid", 5, time()+60*60*24*60, "/"); I will use that, But.. now i want to make it so if $_COOKIE['skinid'] == "5" echo bla bal is that correct way? Will this work for every individual user? Cause i'll make a get function so that user clicks on button and changes skinid in cookie, like changing theme. :-)
  20. Thanks so much code for such little code i want to do, but i guess that's php, i love the terny operator tho thx
  21. oh, lol ok thanks so i'll add the && wat about a | will that work too ?
  22. if ($_GET['God'] == "Enter") This works but if i add isset like this: if (isset($_GET['God']) == "Enter") then it wont read it it will skip it help ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.