-
Posts
1,437 -
Joined
-
Last visited
Never
Posts posted by papaface
-
-
It may be interpreting it like:
<?phpsession_start();?>
try:
<?php session_start(); ?>
-
It would have been helpful for you to post the answer for anyone interested...
-
-
change:
$con = mysql_connect(PATH,USERNAME,PASSWORD); $database = mysql_select_db(DATABASE); if(!$database) { header('Location: login.php?database=no'); }
to
$con = mysql_connect(PATH,USERNAME,PASSWORD); $database = mysql_select_db(DATABASE,$con); if(!$database) { header('Location: login.php?database=no'); }
-
Oops typo lol. Dunno why I did them all with a semi-colon and then with a colon for the default ??? lolWhat's with the semi-colons in the cases?
session_start(); switch ($_GET['lang']) { case 'Fr': $_SESSION['lang'] = "Fr"; break; case 'En': default: $_SESSION['lang'] = "En"; }
-
Use $_GET instead of $_POST unless there's sensitive information.
-
session_start(); switch ($_GET['lang']) { case "En"; $_SESSION['lang'] = "En"; break; case "Fr"; $_SESSION['lang'] = "Fr"; break; default: $_SESSION['lang'] = "En"; }
-
should be:
foreach($words as $key => $word) { //remove punctuation $word= str_replace($punc, "", $word); //make lowercase $word = strtolower($word); //remove stop words $result = array_diff($word, $stop); print_r($result);
-
You can't without javascript. PHP cannot, simply CANNOT do this.
-
Your if statement is wrong
if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] ) || $is_auth['auth_mod'] )
What are you trying to achieve here. Tell us in words not code.
-
<?php $url = parse_url('http://sitename.com/dir/A/02/?extras=MTM0MjQ6Mzo2,0,0,0,194'); echo $url['host']; ?>
-
I'll excuse the fact your code is awful, but you need to use:
echo urlencode("$variableis;");
-
$i = 0; $count = count($_SESSION['List']); while ($i < $count ){ $_SESSION['List'][$i]['Title'] = $_POST['title']; i++; }
Something like that?
-
Hello,
I am currently working with the Twitter API. Those of you who are familar with it will know that to update the background image on a given Twitter account, you need the submit the given image to the API in multipart form.
This is really confusing me and any help would be appreciated.
My code at the moment is:
error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('memory_limit', '1600M'); require("twitter.php"); $twitter = new Twitter("///","////"); // Set the content-type //header('Content-type: image/jpeg'); // Create the image $im = imagecreatefromjpeg("background.jpg"); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 62, 51, 54); $black = imagecolorallocate($im, 95, 95, 95); // The text to draw // Replace path by your own font path $font = 'MyriadPro-SemiboldSemiExt.otf'; // Add some shadow to the text // Add the text //imagettftext($im, 20, 90, 34, 500, $black, $font, $text); $text = 'Some random text'; /*imagettftext($im, 20, 90, 78, 538, $grey, $font, $text); imagettftext($im, 20, 90, 74, 538, $black, $font, $text);*/ imagettftext($im, 20, 90, 77, 536, $white, $font, $text); imagettftext($im, 20, 90, 74, 538, $black, $font, $text); imagejpeg($im, 'simpletext.jpg'); //echo '<img src="simpletext.jpg" />'; // Using imagepng() results in clearer text compared with imagejpeg() $mime_boundary=md5(time()); $headers .= 'From: My Email <me@company.com>' . "\n"; $headers .= 'MIME-Version: 1.0'. "\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"".$mime_boundary."\"". "\n"; if ($twitter->updateProfileBackgroundImage("simpletext.jpg")) { echo "done"; } else { echo "problem"; } //imagejpeg($im); ?>
But this is giving me this error:
Fatal error: Uncaught exception 'TwitterException' with message 'Not Implemented' in /twitter.php:1230 Stack trace: #0 /process.php(42): Twitter->updateProfileBackgroundImage('simpletext.jpg') #1 {main} thrown in /twitter.php on line 1230
Any help would be appreciated :'(
-
Excellent
Thanks
-
Hello,
Is it possible to write text onto an existing image vertically?
I know that text is written horizontally by default.
Any help would be appreciated
Thanks!
-
Ah correction. I was including them in my main file in the wrong order LOL
That works. Thanks
-
Thanks for that.
Does the class you're wanting to extend need to be in the same file?
Currently I have two includes. The first include contains the class I am wanting to extend upon.
I am getting a Class not found error.
-
Hello,
I have a situation where I am wanting to access a class which is declared in my code from within another class.
e.g
class someRandomclass { function myName() { return "Andrew"; } } $example = new someRandomclass(); class anotherRandomclass { function bothNames() { echo $example->myName() . " randomer"; } } $example2 = new anotherRandomclass(); echo $example2->bothNames();
Obviously this is a ridiculous example, but it demonstrates what I am trying to achieve, however it wont work.
Any ideas?
-
Thanks
That worked
-
Hello,
I am trying to search a string for a particular occurrence however I want it to work regardless of spaces.
This is the code I have currently:
$string = "Hello I am papa_face."; $pos = strpos($string, "I am papa_face"); if ($pos !== false) echo "Contains the string."; else echo "Does NOT contain the string.";
Obviously in this example the string does contain the search term so it returns "Contains the string."
However if I change the string to:
$string = "Hello I am papa_face."; $pos = strpos($string, "I am papa_face"); if ($pos !== false) echo "Contains the string."; else echo "Does NOT contain the string.";
The string is not found. How can I get around this?
-
Javascript is a client side script. So far as I am aware this cant be processed or "seen in action" by PHP.
-
Oh well
I guess this is to much of a challenge.
-
Anyone? :'(
Change the order of uploaded images
in PHP Coding Help
Posted
Your file names are that of the time the image was created. When the image is created is the location stored in a database? Do you have the mysql_query() which is used to extract that info from the db?