-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
test here and it works as expected level PreK Elem subject via the URL and from the form
-
what does it display on the screen!
-
Works fine on IE and FF here
-
can you please mark this as solved
-
YEP! using get and not passing anything from the form will give a clear url! if you used POST the you could pass both! IE echo(" <form method = \"POST\" action = \"DeleteApp.php?pname=\"" . $Applications['Name'] . "\"> <input value='Delete' type='submit' /> </form> "); BUT Pikachu2000 is the better route IMHO
-
I can "obviously see" it posting to "DeleteApp.php" what was you expecting ? also you probably meant why is the pname not being set! try this (with extra quotes) echo(" <form method = \"get\" action = \"DeleteApp.php?pname=\"" . $Applications['Name'] . "\"> <input value='Delete' type='submit' /> </form> ");
-
This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=307577.0
-
No the URL would be which will overwrite each other! you need to use an array ie level[] eg <?php echo "<u>level</u><BR />"; if(!empty($_GET['level'])) foreach($_GET['level'] as $lev){ echo "$lev <BR />\n"; } echo "<u>subject</u><BR />"; if(!empty($_GET['subject'])) foreach($_GET['subject'] as $sub){ echo "$sub <BR />\n"; } ?> <form method="get"> <input type="checkbox" name="level[]" value="PreK" /> <input type="checkbox" name="level[]" value="Elem" /> <input type="checkbox" name="level[]" value="MS" /> <input type="checkbox" name="level[]" value="HS" /> <input type="checkbox" name="subject[]" value="Math" /> <input type="checkbox" name="subject[]" value="Reading" /> <input type="checkbox" name="level[]" value="Science" /> <input type="submit" value="submit" /> </form>
-
you should be able to just echo it out, ie echo "<a href=\"http://google.com?q=".$_GET['q']; this could also be used in a iframe if you won't want it as "a link" but linked another way please explain
-
if you mean change http://www.somesite.com/?id=243 into something like http://www.somesite.com/243 then yes.. look into .htaccess redirects if you mean something else then please explain or give some examples
-
it seams your missing session_start();
-
Yep.. you're need to apply the same logic to the others uploads, So exact same line of code just change fupload to fupload2, then the same again but change to fupload3 and again but change to fupload4
-
ProjectFear's previous post is correct, basically you are refeshing the page with the same URL this requesting an extra item to be added! if you just redirect to the game page without the parameters all should be fine! PS read the rules it also stays we won't write the code for you!
-
i didn't read the whole code but try this update this line $copy = copy($_FILES['fupload']['tmp_name'], $idir. basename($_FILES['fupload']['name'], $file_ext).rand(10000 , 99999).$file_ext); // Move Image From Temporary Location To Permanent Location
-
Here's an idea use mysql_fetch and mysql_num_rows.. also if you grab the data then it must exist!
-
Sure Firs update the database with a new field `VisitDate` ALTER TABLE `imagecounter` ADD `VisitDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP then update the code change $query = sprintf("SELECT * FROM `ImageCounter` WHERE `ImageID` =%d AND `IP` = '%s' LIMIT 1", $ImageID, mysql_real_escape_string($_SERVER['REMOTE_ADDR']) ); to $query = sprintf("SELECT * FROM `ImageCounter` WHERE `ImageID` =%d AND `IP` = '%s' AND NOW() <= ADDDATE(`VisitDate`, 1) LIMIT 1", $ImageID, mysql_real_escape_string($_SERVER['REMOTE_ADDR']) ); That should do it, I should say, that the field ID isn't really needed but it depends on how the script intends to grow, so removing it won't cause any short term problems..
-
Oh i forgot to say, these are one 1 visit (ever), you need to add a timestamp and update the first query to suite, the code was just a quick example but I'll add those if needed.
-
Just 1 table really CREATE TABLE IF NOT EXISTS `imagecounter` ( `ID` int( NOT NULL auto_increment, `ImageID` int( NOT NULL, `IP` varchar(15) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; I assumed your using an ID as a image reference, but you could update this to use a name instead! <?php mysql_connect("localhost", "USERNAME", "PASSWORD"); mysql_select_db("DATABASE"); $ImageID = $_GET['ImageID']; //Pass your ImageID this could also be a name/referance $query = sprintf("SELECT * FROM `ImageCounter` WHERE `ImageID` =%d AND `IP` = '%s' LIMIT 1", $ImageID, mysql_real_escape_string($_SERVER['REMOTE_ADDR']) ); $result = mysql_query($query); //Check if already added if(mysql_num_rows($result) == 0){ //Add new records $query = sprintf("INSERT INTO `ImageCounter` SET `ImageID` = %d, `IP` = '%s'", $ImageID, mysql_real_escape_string($_SERVER['REMOTE_ADDR']) ); $result = mysql_query($query); } //DISPLAY VIEWS $query = sprintf("SELECT * FROM `ImageCounter` WHERE `ImageID` = %d", $ImageID ); $result = mysql_query($query); echo "This image has been viewed ".mysql_num_rows($result)." times"; ?> as a note i didn't use unique as i assumed the same IP viewing different images would still count up!
-
Your welcome, please mark as solved (I'll do it this time )
-
you need to use echo instead of return ie echo "one was selected";
-
what do you mean your adding node ? SimpleXML doesn't add nodes it can't create them! any-ways if you just extracting parts then instead of re-writing it with a DomDocument, you could cheat! file_put_contents($this->filePath, preg_replace('/<\?xml [^>]*>/im', '<?xml version="1.0" encoding="ISO-8859-1" ?>', $output->asXML());
-
SimpleXML is for reading XML not writing.updating/changing xml, DomDocument will allow you to change it, but your also need up encode the node's correctly, why exactly are you trying got do and why ?
-
See example code i put in your other thread
-
Email Duplicate Removal More Than 20k not working
MadTechie replied to soma56's topic in PHP Coding Help
how about $a = array("TEST", "test2", "test3"); $b = array_map("strtolower", $a); print_r($b);