-
Posts
1,437 -
Joined
-
Last visited
Never
Posts posted by papaface
-
-
How big are the files it needs to read?
-
Change
<input type="submit" value="Send Email">
to
<input name"Submit" type="submit" value="Send Email">
-
Hey
I am trying to find a way of retrieving the href value in a link on a specific webpage. However I only want to retrieve the href values for <a> elements that have the text "Click here to find out more".
e.g.
<a href="link.com/fdhh.php">Click here to find out more</a>
Is there any specific PHP function that'll allow me to do that?
Any help would be appreciated
-
html_entity_decode(htmlspecialchars_decode(htmlspecialchars_decode($conv_current['Title'], ENT_QUOTES ) , ENT_QUOTES),ENT_QUOTES)
That did it.
-
Ok I worked out how to do it:
htmlspecialchars_decode(htmlspecialchars_decode($conv_current['Title'], ENT_QUOTES ) , ENT_QUOTES);
In the browser it now displays correctly as:
ADELE 'Cold Shoulder'But in text boxes it displays as:
Again<input type="hidden" id="conv_Title" value="ADELE 'Cold Shoulder'" /> -
Hey,
I am some text in a script that is converted as follows:
function get_htmlspecialchars( $given, $quote_style = ENT_QUOTES, $double_quotes = false ) { if($double_quotes) return htmlspecialchars(htmlspecialchars( $given, $quote_style ) , $quote_style); else return htmlspecialchars( html_entity_decode( $given, $quote_style ), $quote_style ); }
Example:
get_htmlspecialchars($results['title'],ENT_QUOTES,true);
How can I get it back to regular text instead of things like:
LetteringADELE 'Cold Shoulder'I can't for the life of me work out how to do it and its driving me insane lol
-
-
echo <<<CODE <form action="<?php echo __FILE__; ?>" name="test"> Name : <input type="text" name="name" /><br /> E-Mail : <input type="text" name="email" /><br /> </form> CODE;
-
function printarray($array) { foreach ($array as $item) { echo "<li>$item</li>"; } } //usage printarray($menu[main]);
That'd do it, but im sure others will come up with better ways.
Of course you could always just do:
print_r($menu[main],true);
But for that you'd need to have the elements include <li>*</li>
-
Not sure how you'd want that implemented in the code but it would be
if (in_multiarray($_GET['input'],$ranges)) { header('Location: banned.php'); } else { //done something }
Is that what you want?
-
I means if the variable $login does not contain any text then to perform a section of code.
-
Not saying my way is the best possible way to do it, but it works.
<?php function in_multiarray($elem, $array) { $top = sizeof($array) - 1; $bottom = 0; while($bottom <= $top) { if($array[$bottom] == $elem) return true; else if(is_array($array[$bottom])) if(in_multiarray($elem, ($array[$bottom]))) return true; $bottom++; } return false; } $ranges = range(4600,5000); $ranges[] = range(400,800); $ranges[] = array(46, 207, 336, 982); $rand = rand(1,7000); while (in_multiarray($rand,$ranges)) $rand = rand(1,7000); echo "yay:".$rand; ?>
-
Try:
<?php function in_multiarray($elem, $array) { $top = sizeof($array) - 1; $bottom = 0; while($bottom <= $top) { if($array[$bottom] == $elem) return true; else if(is_array($array[$bottom])) if(in_multiarray($elem, ($array[$bottom]))) return true; $bottom++; } return false; } $ranges = range(4600,5000); $ranges[] = range(400,800); $rand = rand(1,7000); while (in_multiarray($rand,$ranges)) $rand = rand(1,7000); echo "yay:".$rand; ?>
-
Google and initiative are great things.
-
Thats great, thank you
-
Hey,
I am trying to work out the difference between two times that are entered into a form like this:
00:00:10 and 00:00:13
I want to work out the time difference between the two times. Can anyone point me in the direction of how to do this? I have tried looking at the strftime function but I just can't work out how to do it.
I know how to do it with mktime:
$start = mktime(0, 0, 3, 0, 0, 0);//hour,minute,seconds $end = mktime(0, 0, 10, 0, 0, 0);; echo "start: ". $start . " end: ".$end."<br />"; echo $end-$start; //7 seconds difference
But I'm not able to receive the data in a way to put it into the mktime function without causing problems.
Any help would be appreciated
-
if your using the file_exists function you won't really need the switch
$choice= $_GET['act']; include (file_exists("includes/$choice.php") ? "includes/$choice.php" : "includes/about.php");
Couldn't that cause possible security issues as you can potentially include any file in the includes directory as long as it exists....
-
OMG as soon as I posted this it started working.... very weird.
Thanks anyway!
-
Hey,
Please can someone help me with this.
I have a page that refuses to load when I have session_start(); in the code.
This is the top of the page:
<?php session_start(); error_reporting(1); error_reporting(E_ALL); ini_set('display_errors', '1');
The page just loads constantly displaying nothing when session_start(); is in there, but when I take it out, its fine.
Any ideas as to what is causing this?
-
Hey,
I am about to go insane so please can someone come to my aid lol.
My code:
function download($url) { $curl = curl_init(); if($curl) { if( !curl_setopt($curl, CURLOPT_URL, $url) ) return "FAIL: curl_setopt(CURLOPT_URL)"; if( !curl_setopt($curl, CURLOPT_HEADER, array("Accept: text/xml,application/xml,application/xhtml+xml,text/html,;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Accept-Language: en-us,en;q=0.5", "Connection: keep-alive", "User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20070625 Ubuntu/7.10 (gutsy) Firefox/3.0.0.7", "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Keep-Alive: 300")) ) return "FAIL: curl_setopt(CURLOPT_HEADER)"; $ret = curl_exec($curl); if( !$ret ) return "FAIL: curl_exec()"; curl_close($curl); if (strpos($ret, "Payment Required") > 0) { return "Payment is required <br />"; } else { return $ret; } } else return "FAIL: curl_init()"; }
Sample of cURL output:
HTTP/1.1 402 Payment Required Date: Thu, 10 Dec 2009Why would that show when I am asking it to return "Payment is required <br />" if the $ret var contains the string "Payment Required"?
Any help would be appreciated
-
Anyone ?
-
Basically, when a user logins in on domain1.com I want them to be logged in on domain2.com and vice versa.
Are there any pre-made scripts to do this kind of thing? The whole process of setting cookies etc is very complex.
-
mysql_query("INSERT INTO ".$name." (amount) VALUES ('".$amount."')");
-
What code do you have so far?
We're not here to write entire scripts for you, at least help us by doing some work...
AXIS 210A Network Camera - Connect through CURL and PHP
in PHP Coding Help
Posted
Not sure, but what does this produce?