-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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'];
-
yeah,, they have register global on, which is a bad thing for them see here http://www.php.net/manual/en/security.registerglobals.php
-
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
-
yeah add var GalleryArray; to make it global.. PS this is not a PHP problem its javascript
-
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) {
-
quick example <?php session_start(); $_SESSION['test'] = "Hello World"; ?> <?php session_start(); echo $_SESSION['test']; //Note NOT $test ?>
-
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!
-
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
-
<?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; ?>
-
its "Ternary Operator" or "Conditional Operator"
-
$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; }
-
you could create a form, in which you could post the path! then have $dir = $_POST['path'];
-
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); } } ?>
-
Question on uploading and downloading compressed (zip) files
MadTechie replied to tryingtolearn's topic in PHP Coding Help
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 ? -
well thats not much info ..where is the id ? from a database ? maybe ALTER TABLE tbl AUTO_INCREMENT = 100;
-
lol, happens to all of us..
-
on the address bar does it say page=add on the add page ? if not what exactly does it say ? its case sensitive
-
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
-
depends what your trying todo if you want to set $_GET['PHPSESSID'] to $_POST['custom'] then yes
-
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..
-
How do you know the page name ? do you have something like ?page=add in the url ? without more detail its hard to say!
-
<a href="folder" target="_blank">folder<a> PS this should be posted in the HTML/CSS section
-
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
-
<?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>"; } ?>
-
http://www.informit.com/articles/article.aspx?p=30115&seqNum=5