-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
well i'm running it from WAMP! is it running from a live server ? if so could a test from here ? (PM if you want) is it possible you have some caching headers setup in a .htaccess file ? EDIT: maybe remove the line! header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-
Humm Just tested on FF3 && IE7, (i'll assume your using IE6 as i know that has issules!) my IE7 test #1 Entered incorrect code. clicked back -fine #2 Entered correct code. clicked back -fine #3 Entered correct code. clicked back -fine #4 Entered incorrect code. clicked back -fine #5 Entered correct code. clicked back -fine I don't have IE6 on this PC..
-
Erm.. to who ? $to = 'sdomain';domain.org>; should be $to = 'myemail@domain.com';
-
okay well i was missing the config.php file etc so i build a new one (kinda need to write one for a project anyways) its a simple one but works well i tested with FF, the back button works but it didn't re-gen the code.. it does now See attached [attachment deleted by admin]
-
its probably the mime type is not setup in the server.. the copy code doesn't touch the file extension.. okay some more tests #1 upload a file via FTP and test via browser #2 upload a file via PHP and download via FTP and test locally if the last test(#3) had failed i would of said change permission to 755 as some host block all files on 777
-
Okay the header info is of couse be definition a hack.. but it doesn't make it less secure.. infact you shouldn't be getting an expired page! by removing sessions your need to have a link from the clients machine to stored data on the server.. thats exactly what sessions are used for.. by saying you need one without is like saying you need a cookie that doesn't store on the clients PC.. thats what its for! if you post the code for the captcha i'll review it,
-
if i have images on my site.. and php script this does not mean the php script are either creating the images nor uploading them.. Because their is no code.. your need to write it.. which means you need to know how the system works with the pages (if at all) we have zero info on that! if you can do a Regular expression search in all files (i think DM can) then try searching for this <li>\s*<a href= (turn on Regular expression in the search box) it may helps file the files that handles the menu or debug from the index file! check the database to see if any tables have page names etc
-
Humm.. that should of worked.. is the page expired server or script driven ? also what browser i being used?
-
Returning results from nested JSON arrays using PHP
MadTechie replied to asp_to_php's topic in PHP Coding Help
try this $financial_org = $fundingObject[3]->{"round_code"}->{"investments"}->{"financial_org"}; foreach($financial_org as $FO) { $name = $FO->{"name"}; $permalink = $FO->{"permalink"}; echo "$name -> $permalink<br>"; } -
It need to be run before any output.. so at the start of the script that outputs the form.. please note that this "should" work! we may need to tweak the captcha code to manually clear a session or something.. (in that case maybe worth posting it)
-
#1 are you SURE that you have everything correct with the URL #2 Check permission for that folder. #3 create a HTML page.. ie example.html, and view it to check
-
Okay the example above will do that except it will be as if they just started.. ie User is on Page A (the form) User Fills in the form and captcha and hits submit User get directed to Page B (confirmed page) User Hits Back button User Goes back to Page A (the form) however the form will be empty (unless you re-populate the fields) and has a new captcha
-
Erm.. Yeah.. thats static html.. So you didn't write it.. and when you say you can read the code i assume you mean the HTML code and what makes you think its PHP.. as far as any of are aware this could be written directly from DM.. thus its technially static until DM updates the static HTML with new HTML!
-
So.. instead of the "page as expired" do you want a new captcha ? if so you could probably force the page to be reloaded by adding add no caching ie <?php Header( "Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" ); Header( "Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" ); Header( "Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1 Header( "Cache-Control: post-check=0, pre-check=0", FALSE ); Header( "Cache-control: private", FALSE ); //added Header( "Pragma: no-cache" ); // HTTP/1.0 ?> if you don't want the captcha then you could almost voiding the whole point of the captcha
-
Nothing wrong with that code my test <?php $markup = array( '/\[b\](.*?)\[\/b\]/is' => '<strong>$1</strong>', '/\[i\](.*?)\[\/i\]/is' => '<em>$1</em>', '/\[u\](.*?)\[\/u\]/is' => '<span style="text-decoration: underline">$1</span>', '/\[align=(left|center|right)\](.*?)\[\/align\]/is' => '<div style="text-align: $1">$2</div>', '/\[color=(#[0-9a-fA-F]{6}|[a-z]+)\](.*?)\[\/color\]/is' => '<span style="color: $1">$2</span>', '/\[font=\"(.*?)\"\](.*?)\[\/font\]/is' => '<span style="font-family: \'$1\', sans-serif;">$2</span>', '/\[h([1-6]{1})\](.*?)\[\/h([1-6]{1})\]/is' => '<h$1>$2</h$3>', '/\[size=((?:[1-2]{1})?[0-9]{1})\](.*?)\[\/size\]/is' => '<span style="font-size: $1px">$2</span>', '/\[code\](.*?)\[\/code\]/is' => '<pre>$1</pre>', '/\[sub\](.*?)\[\/sub\]/is' => '<sub>$1</sub>', '/\[sup\](.*?)\[\/sup\]/is' => '<sup>$1</sup>' ); $string = "this is [b]BOLD[/b][code ]so is [b]THIS[/b][/code ]"; //code without the spaces // Later in the code $string = preg_replace(array_keys($markup), $markup, $string); echo $string; ?> results
-
Heres an idea, Write a simple captcha, as for the problem session...could you explain the problem a little more i'm happy to help.. but i'm not going to write the whole thing!
-
[SOLVED] Get A Variable From A Current Page
MadTechie replied to monkeybidz's topic in PHP Coding Help
Options #1 create another file called global.php <?php $title = "My Title"; ?> then add include "global.php"; at the start of header.php & index.php #2 Store it in a session ie <?php start_session(); //at the top $_SESSION['title'] = $title; ?> EDIT: PS this is one of those questions where it may help us if we know why you want! -
Thanks for letting us know.. Here something you may not know..
-
Not really the best tool for the job! Why not use good old FTP! copy does support copying from URL's since PHP v4.3.0, I am not sure what you mean but its an image but doesn't load! did it copy correctly or not ?
-
jpeg uses image/jpg image/jpeg image/pjpeg png.. uses image/png image/x-png EDIT: PS i assume you uploaded via IE.. which used all these mime! as a tip.. if a file fails just add echo $_FILES["file"]["type"]; and upload again to get its mime!
-
doesn't help much! does it run the query? try changing value="+" and value="-" to value="add"
-
That really doesn't give me anything to work with!!! So in reply! It should be!
-
if you put the function in a function then yes!
-
move array item to bottom and move rest up
MadTechie replied to glenelkins's topic in PHP Coding Help
Maybe $tmp = array(1,8,4,5,2,7,3,6); $tmp = MoveDown($tmp, 3); fucntion MoveDown($arr, $pos) { $t = $arr[$pos]; unset($arr[$pos]); $arr[] = $arr[$pos]; return array_values($arr); //re-index //OR return $arr; //don't care about the index } -
Their was a few typos but it works fine *tested* <?php $code = "[user=blade280891] [user=protestthehero]"; $code = preg_replace_callback('/(\[user=(.*?)\])/sim', "GetID", $code); echo $code; function GetID($User) { $sql = mysql_query("SELECT ID FROM user_details WHERE username = '".mysql_real_escape_string($User[2])."' LIMIT 1"); $user = mysql_fetch_assoc($sql); if(mysql_num_rows($sql) != 0) { return "<a href=\"profile.php?user={$user['ID']}\" target=\"_blank\">{$user['ID']}</a>;"; }else{ return "Invalid User!"; } } ?>