
ram4nd
Members-
Posts
461 -
Joined
-
Last visited
Everything posted by ram4nd
-
I want to build secure login with cookies. I just want your ideas about this, your suggestions. What fields should go to sql table, after username and password? How to keep data in cookies safely? And so on...
-
sorry, not code problem; this problem comes with my data in table.
-
I have to get 0 for answer when there are 0 rows. Right now it returns 1 even when there aren't suppose to be any rows. $count = mysql_num_rows(mysql_query('SELECT id FROM members WHERE ref_id='.(int)$ref));
-
thank you very much, is pattern much longer if only the first letter of sentence can be big. No the first char, but first letters of sentences. If it will be longer like double or so then you don't have to waste your time.
-
how can you make it at least 2 characters long, would be awesome if you could explain the pattern, but not necessary
-
actually i want to control the name field from form
-
How can I do a pattern that matches if there is A-Z, a-z, -, space
-
I had mysql_fetch_array in mysql_num_rows.
-
Warning: mysql_num_rows() expects parameter 1 to be resource, array given in /opt/lampp/htdocs/PTC/login.php on line 10 $a = 'SELECT id FROM members WHERE user=\''.clean($_POST['user']).'\' AND pass=md5('.$_POST['pass'].')';
-
Query: SELECT id FROM members WHERE user=ram4nd AND pass=2f951cd95999b19a22fbc1037e552336 Unknown column 'ram4nd' in 'where clause'
-
Can anybody tel me that why am i getting these errors: Errors: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/PTC/login.php on line 9 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /opt/lampp/htdocs/PTC/login.php on line 10 Code: mysql_connect('localhost','something','else'); mysql_select_db('PTC'); $a = 'SELECT id FROM members WHERE user = '.clean($_POST['user']).' AND pass = '.md5($_POST['pass']); $b = mysql_query($a); $query = mysql_fetch_array($b); if(mysql_num_rows($query) == 1) { $_SESSION['user'] = $query['id']; setcookie('user', $query['id'], (60 * 60 * 24 * 30 + $_SERVER['REQUEST_TIME'])); header('Location: members.php'); } else $x = 'Incorrect username or password.';
-
It told me to define the variables so i made them static instead of global.
-
Why am I not seeing javascript made fields? <?php static $body; if(isset($_POST['saada'])) if(isset($_POST['text1_0'])) echo $_POST['text1_0']; if(isset($_POST['text1_1'])) echo $_POST['text1_1']; if(isset($_POST['text1_2'])) echo $_POST['text1_2']; if(!isset($_POST['saada'])) $body = '<script type="text/javascript"> <!-- function lisa_rida() { var tabel = document.getElementById(\'tabel\'); var last_row = tabel.rows.length; var iteration = last_row; var row = tabel.insertRow(last_row); form_1.rows.value = 1 + iteration; //Cell 1 var text_box_1 = document.createElement(\'input\'); text_box_1.type = \'text\'; var cell_1 = row.insertCell(0); text_box_1.name = \'text1_\' + iteration; cell_1.appendChild(text_box_1); //Cell 2 var text_box_2 = document.createElement(\'input\'); text_box_2.type = \'text\'; var cell_2 = row.insertCell(1); text_box_2.name = \'text2_\' + iteration; cell_2.appendChild(text_box_2); //Cell 3 var text_box_3 = document.createElement(\'input\'); text_box_3.type = \'text\'; var cell_3 = row.insertCell(2); text_box_3.name = \'text3_\' + iteration; cell_3.appendChild(text_box_3); //Cell 4 var text_box_4 = document.createElement(\'input\'); text_box_4.type = \'text\'; var cell_4 = row.insertCell(3); text_box_4.name = \'text4_\' + iteration; cell_4.appendChild(text_box_4); } //--> </script> <table border="0" id="tabel"><form action="'.$_SERVER['PHP_SELF'].'" method="post" id="form_1"> <tr> <td><input type="text" name="text1_0" /></td> <td><input type="text" name="text2_0" /></td> <td><input type="text" name="text3_0" /></td> <td><input type="text" name="text4_0" /></td> </tr> </table> <input type="hidden" id="rows" name="rows" value="1" /> <input type="button" value="Lisa rida" onclick="lisa_rida();" /> <input type="submit" value="Saada" name="saada" /> </form>'; echo $body; ?>
-
Why am I not seeing javascript made fields? <?php static $body; if(isset($_POST['saada'])) if(isset($_POST['text1_0'])) echo $_POST['text1_0']; if(isset($_POST['text1_1'])) echo $_POST['text1_1']; if(isset($_POST['text1_2'])) echo $_POST['text1_2']; if(!isset($_POST['saada'])) $body = '<script type="text/javascript"> <!-- function lisa_rida() { var tabel = document.getElementById(\'tabel\'); var last_row = tabel.rows.length; var iteration = last_row; var row = tabel.insertRow(last_row); form_1.rows.value = 1 + iteration; //Cell 1 var text_box_1 = document.createElement(\'input\'); text_box_1.type = \'text\'; var cell_1 = row.insertCell(0); text_box_1.name = \'text1_\' + iteration; cell_1.appendChild(text_box_1); //Cell 2 var text_box_2 = document.createElement(\'input\'); text_box_2.type = \'text\'; var cell_2 = row.insertCell(1); text_box_2.name = \'text2_\' + iteration; cell_2.appendChild(text_box_2); //Cell 3 var text_box_3 = document.createElement(\'input\'); text_box_3.type = \'text\'; var cell_3 = row.insertCell(2); text_box_3.name = \'text3_\' + iteration; cell_3.appendChild(text_box_3); //Cell 4 var text_box_4 = document.createElement(\'input\'); text_box_4.type = \'text\'; var cell_4 = row.insertCell(3); text_box_4.name = \'text4_\' + iteration; cell_4.appendChild(text_box_4); } //--> </script> <table border="0" id="tabel"><form action="'.$_SERVER['PHP_SELF'].'" method="post" id="form_1"> <tr> <td><input type="text" name="text1_0" /></td> <td><input type="text" name="text2_0" /></td> <td><input type="text" name="text3_0" /></td> <td><input type="text" name="text4_0" /></td> </tr> </table> <input type="hidden" id="rows" name="rows" value="1" /> <input type="button" value="Lisa rida" onclick="lisa_rida();" /> <input type="submit" value="Saada" name="saada" /> </form>'; echo $body; ?>
-
I have a form in table and i need to add rows with javascript. <script type="text/javascript"> Function addRowToTable() { } </script> <form action="something.php" method="post"><table border="0"> <tr> <td><input type="text" name="text1_1" /></td> <td><input type="text" name="text2_1" /></td> <td><input type="text" name="text3_1" /></td> <td><input type="text" name="text4_1" /></td> </tr> </table> <input type="button" value="Add" onclick="addRowToTable();" /> <input type="hidden" name="rows" value="1" /> <input type="submit" name="saada" /> </form>
-
It was about globals, i still don't get the hang of those.
-
My code doubles function partially. Are there any common mistakes what lead to this?
-
[SOLVED] would like a little php help please
ram4nd replied to crashgordon's topic in PHP Coding Help
This is wrong formating for html: echo "<img src='images/sml_".$imagepath." width="100%" '>"; Right formating is like this: echo '<img src="images/sml_'.$imagepath.'" width="100%" />'; -
Well you asked if it's possible. I say yes.
-
This is triggered by flash so, I think you ask from the wrong forum. You have to specify, what does the script have to do.
-
Have a look at using session_destroy, session_unset, unset('$_SESSION['$varname']), or session_write_close.
-
[SOLVED] Pull multiple random lines from text file
ram4nd replied to rachelk's topic in PHP Coding Help
put your text in array and pull the lines up randomly. -
you want to use some kind of a cms or start from scratch
-
you don't need 2 sessions.