Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. it would... but why do all the SQL stuff ? why not just! $_SESSION['id']=$_SESSION['id']; $_SESSION['userID']=$_SESSION['userID']; $_SESSION['pass']=$_SESSION['pass']; $_SESSION['sid']=$_SESSION['sid'];
  2. yeah,, they have register global on, which is a bad thing for them see here http://www.php.net/manual/en/security.registerglobals.php
  3. what are you posting ? if $n= `Test` and $m = "VARCHAR( 100 )" to the total is ALTER TABLE `table` ADD VARCHAR( 100 ) NOT NULL that should work what error are you getting
  4. yeah add var GalleryArray; to make it global.. PS this is not a PHP problem its javascript
  5. the loop is becuase you stay on the same question, and the last question is becuase you check to see if your currect question is greater (in value) than the last question see code comments else { echo'<b>Wrong</b>'; break; } to else { echo'<b>Wrong</b>'; //break; $answer_num++; } for the last question problem change while($question_count > $question_num) { to while($question_count >= $question_num) {
  6. quick example <?php session_start(); $_SESSION['test'] = "Hello World"; ?> <?php session_start(); echo $_SESSION['test']; //Note NOT $test ?>
  7. you need to have use session_start(); on the uni sever they might have autostart.sessions turn on also i assume you have $user_session_id = $_SESSION['user_session_id'] on pages that don't already have $user_session_id set!
  8. add some error catching mysql_query($query2) on die(mysql_error()); as for the SQL statement.. i think you need to rethink it a little.. http://dev.mysql.com/doc/refman/5.1/en/index.html
  9. <?php $FName = $_POST['FName']; $LName = $_POST['LName']; $PHON = $_POST['PHON']; mysql_connect ("66.79.xxx.x", "admin_chxxx", "xxx") or die ('Error: ' . mysql_error()); mysql_select_db ("admin_xxx"); mysql_query("INSERT INTO 'Clients' (ID, FName, LName, PHON) VALUES (NULL, '$FName', '$LName', '$PHON') ") or die(mysql_error()); //Missed a ), //no need to quote the null //also some debugging echo "Database updated with: ".$FName. " ".$LName." ".$PHON; ?>
  10. its "Ternary Operator" or "Conditional Operator"
  11. $prev_page = ($thispage-1 <= 0) ? 0 : $thispage-1; is basically a short if statment its short for if($thispage-1 <= 0) { $prev_page=0; }else{ $prev_page=$thispage-1; }
  12. you could create a form, in which you could post the path! then have $dir = $_POST['path'];
  13. This was written on the fly so probably has a ton of bugs but it should atleast give you a start <?php $dir = "/etc/php5/"; $find["/*"] = "<noedit>/*"; $find["\" = \""] = "\" = \"</noedit>"; $find["\";"] = "<noedit>\";</noedit>"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($filename = readdir($dh)) !== false) { //if($filename != "." || $filename != "..") //check its a file //removed if(preg_match('/\.strings$/sm', $filename )) //check its ends with .strings { $file = dir."/".$filename; $str = file_get_contents($file); //$output = str_replace("/*","<noedit>/*",$line); //$output2 = str_replace("\","\" = \"</noedit>",$output); //$output3 = str_replace("\";","<noedit>\";</noedit>",$output2); $str = str_replace(array_keys($find), array_values($find), $str ); file_put_contents($file.".NEW",$str); //remove the .".NEW" after testing } } closedir($dh); } } ?>
  14. is that the whole script,? it should be ok, you could try this one http://www.phpfreaks.com/forums/index.php/topic,95433.0.html have you could a url i could look at ?
  15. well thats not much info ..where is the id ? from a database ? maybe ALTER TABLE tbl AUTO_INCREMENT = 100;
  16. lol, happens to all of us..
  17. on the address bar does it say page=add on the add page ? if not what exactly does it say ? its case sensitive
  18. the session_start() has nothing to do with the $_GET['PHPSESSID'].. unless you wish to set the session id ie session_id($_GET['PHPSESSID']) see Session Handling Functions
  19. depends what your trying todo if you want to set $_GET['PHPSESSID'] to $_POST['custom'] then yes
  20. No it LOADS that page.. when you goto a folder on the server.. the server checks for pages ie index.htm index.html index.php default.php etc etc its NOT redirecting you.. try it if the HTTP_REFERER isn't passed when you goto http://example.com it will not be passed even if you goto http://example.com/index.php if the page you load is not been passed the HTTP_REFERER then the clients browser isn't sending one.. in other words its out of your control..
  21. How do you know the page name ? do you have something like ?page=add in the url ? without more detail its hard to say!
  22. <a href="folder" target="_blank">folder<a> PS this should be posted in the HTML/CSS section
  23. to get the ID from index.php?id=5 in php is $_GET['id']; so for example echo $_GET['id']; would print 5 to the page theirs no need to filter it, until you know what your doing with it
  24. <?php $page = $_GET['page'];; //or however you identify the page! if( ($page != "node" && $page != "add" && $page != "story") ) { echo "<div id='primary-links' class='clear-block'>"; echo ('Duyuru Yap !', "node/add/story", false, "destination=node/add/story"); echo "</div>"; } ?>
  25. http://www.informit.com/articles/article.aspx?p=30115&seqNum=5
×
×
  • 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.