-
Posts
549 -
Joined
-
Last visited
Never
Posts posted by Gayner
-
-
This is a easy fix just delete ur session id cookie lol
-
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
-
Well, the hosting wont allow curl to be installed, which is why I am looking for a different method.
that works and is free and has plenty of nice features for u to get started, what i use man it's wonderful
-
If I'm correct curl is some kind of library and not a standard function, so curl has to do it some way.... Does anyone know another way of doing this?
u got curl installed? lol
-
Best guess is that you somehow got a non-printing character typed into the code.
no it's array on the mysql vs row..
why cant i use row but if i use array on mysql fetch it works?
-
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
-
The posted code cannot produce that error (if the posted query executes so that $result is a result resource, there would be an 'id' index.) It would take seeing your whole actual code to be able to determine what is causing the error. I suspect you have different $query/$result variables and line 46 is doing something else.
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!</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
-
It's not exactly clear what problem you are describing, but I suspect that once someone enters the correct captcha value, they can keep submitting values to your form processing code?
You need to unset or clear $_SESSION["key"] in the form processing code so that a different correct captcha value must be entered for each submission. You must also test if $_SESSION["key"] is set (see the isset function) and that the value equals what was entered in the form field (a lot of people make the mistake of just testing if it is equal to what was entered in the form field, but if you visit their form processing code without visiting the form and enter nothing, nothing does equal nothing and the captcha test passes.)
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
-
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...
-
It's actually possible bro!Also you should check out the second sticky in php coding help.
-
I just need t find the hex color of a image..
-
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!
-
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. /
-
isset returns a boolean, if you want to check the data in a cookie do this:
if(isset($_COOKIE['skinid']) && $_COOKIE['skinid'] == "heelo")
Will work, as it first checks if the cookie isset if it is then it tests the data in that cookie.
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
-
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.
-
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
-
yea i know how to do that but how long char can cookie storE?You would have to do a check on the input string, if you only want a certain length use strlen.
If that is not what you are after, please elaborate.
-
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
-
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. :-)
-
tell them not to use underscores.
Troll
-
Gayner something else you do to make sure that $god is set before calling it. Welcome to the wonderful ternary operator.
<?php // make $god equal $_GET['god'] if its set else make it empty "" $god = isset($_GET['god'] === true ? $_GET['god'] : ""; // you could add some filtering right there also // $god = isset($_GET['god'] === true ? mysql_real_escape_string(strip_tags($_GET['god'])) : ""; if($god == "Enter"){ // stuff }
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
-
because isset() checks to see if that variable is set.
So, if $_GET['God'] is set, then isset($_GET['God']) will translate to "true" but it won't give you the value of $_GET['God']
if you want to check to make sure $_GET['God'] is not only set, but set to something specific, use:
if ($isset($_GET['God']) && $_GET['God'] == "Enter")
so it checks to see if $_GET['God'] is set at all, and if it is (only if it is) it will then check the value.
oh, lol
ok thanks so i'll add the &&
wat about a | will that work too ?
-
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 ?
-
Because if you want to store FALSE in a variable, thats not the same as NULL, ie not having a value.
Ok thx
Will this slow down my php?
in PHP Coding Help
Posted
Prettty much this is all in my index.php
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?