wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
$WshShell->Run('"C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\aastra\putty.exe" -load "Bridge'.$bridge.'" -l root -pw password -m "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\aastra\list-56201.sh"');
-
Can't upload PHP files to database?
wildteen88 replied to leeex's topic in PHP Installation and Configuration
If you're using xampp you don't need to use FTP. Just place all your files/folders etc in C:\xampp\htdocs -
Thats why I suggested extract EDIT: Minor change
-
Correct What are you trying to achive?
-
Your could use extract extract($something_something[$i]); echo $animal_dog; echo $animal_cat; echo $animal_cow;
-
Can't upload PHP files to database?
wildteen88 replied to leeex's topic in PHP Installation and Configuration
What? You don't upload your PHP scripts to MySQL. You need to connect to your FTP server to upload the files to your website. -
$submit should be $_POST['submit']
-
So what is the problem? How do you know you cant use your post variable in mysql update?
-
Is this possible? If one file assigned to an ID...
wildteen88 replied to TechMistress's topic in PHP Coding Help
Judging by your error message it looks like you are storing all images as image1.jpg|image2.jpg|etc.... The problem is filesize does not know that you giving it a list of images to check the file size of. It expects only a single file name to be passed. You'll need to convert the list of images into an array, using explode. Then you can for loop through the array and pass each image separately to the filesize() function -
Are they any errors? _POST variables are treated the same as any other variable.
-
You don't need to define a variable for every line. Variable assignment can span multiple lines, example $myVar = "Line1 Line2 Line3 ... LineXYZ etc"; There is no need to reassign your variables here $stringData = "$filler1"; $stringData1 = "$filler2"; $stringData2 = "$filler3"; $stringData3 = "$filler4"; $stringData4 = "$filler5"; $stringData5 = "$filler6"; $stringData6 = "$filler7"; $stringData7 = "$filler8"; $stringData8 = "$filler9"; $stringData9 = "$filler10"; $stringData10 = "$filler11"; $stringData11 = "$filler12"; $stringData12 = "$filler13"; When assigning a lot of HTML code use the HEREDOC syntax instead. So your new code cleaned up <?php $a1 = $_POST["PN"]; $a2 = $_POST["Date_name"]; $a3 = $_POST["Note"]; // Assign all HTML code within one single variable. // All variables within HERDOC will be parsed $stringData = <<<HTMLCODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">"; <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'> <title>$a1</title> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Text1" style="position:absolute;left:34px;top:34px;width:713px;height:32px;z-index:0;" align="left"> <font style="font-size:27px" color="#000000" face="Arial"><b>Note name:$a1</b></font></div> <div id="bv_Text2" style="position:absolute;left:12px;top:76px;width:781px;height:32px;z-index:1;" align="left"> <font style="font-size:27px" color="#000000" face="Arial"><b>Date and time:$a2</b></font></div> <textarea name="TextArea1" id="TextArea1" style="position:absolute;left:41px;top:134px;width:743px;height:391px;font-family:Courier New;font-size:16px;z-index:2" rows="20" cols="70" readonly="readonly">$a3</textarea> </body> </html> HTMLCODE; $myFile = "notenw.html"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, "\n"); fwrite($fh, "$stringData\n"); fclose($fh); ?>
-
Is this possible? If one file assigned to an ID...
wildteen88 replied to TechMistress's topic in PHP Coding Help
How is your database structured? Specifically the image column. -
Variables must be defined before you can use them. $filler1 = "<html><head><title>$a1</title>"; $filler2 = "<body>$a3"; $filler3 = "<div>$a2</div></body></html>"; $a1 = $_POST["PN"]; $a2 = $_POST["Date_name"]; $a3 = $_POST["Note"]; The last three lines need to be before the first three.
-
A Text-Code Editor for CMS?
wildteen88 replied to Zeradin's topic in Editor Help (PhpStorm, VS Code, etc)
Of course it can. Have you not read the documentation for it? -
There are two ways absolute file path require_once $_SERVER['DOCUMENT_ROOT'] . 'Login/common.php'; Or a relative path require_once '../Login/common.php';
-
<?php require_once('http://localhost/Login/common.php');?> You should not include/require files via urls, as variables/functions defined within the included file will not be inherited.
-
Help not echoing files with a certain letter them
wildteen88 replied to tqla's topic in PHP Coding Help
Does all files that have a 't' in them always in this format [some number here]t.jpg? If they are then you can do this: <?php $mydir = "images/home/"; $d = dir($mydir); while($entry = $d->read()) { if ($entry!= "." && $entry != ".." && substr($entry, -4, 1) != 't') { echo "'" . $entry . "': { caption: '' }," ; } } $d->close(); ?> -
This is probably your problem $configs = "<?php // Connection string $con = mysql_connect("$hostname","$db_username","$db_password"); // If no connection is made generate a error warning if (!$con) { die('Ohh no! Could not connect: ' . mysql_error() 'Please check the Connection String, in the insertpost.php file!'); } // Selects the Database mysql_select_db("$databasename", $con); $db_prefix = "$prefix" ?> \n"; You'd be better of using HEREDOC syntax. $configs = <<<PHPCODE <?php // Connection string \$con = mysql_connect("$hostname","$db_username","$db_password"); // If no connection is made generate a error warning if (!\$con) { die('Ohh no! Could not connect: ' . mysql_error() 'Please check the Connection String, in the insertpost.php file!'); } // Selects the Database mysql_select_db("$databasename", \$con); \$db_prefix = "$prefix" ?> PHPCODE;
-
Maybe this article will help you working with dates in PHP/MySQL.
-
dont understand after installing apache
wildteen88 replied to moreshion's topic in PHP Installation and Configuration
Yes the "it works" page is just a test page. You can remove this by removing the file named index.html from Apache's htdocs folder (located at C:/Program Files/Apache Group/Apache2.2/htdocs). You place all your web based files in that directory. If you want to use Apache with PHP you will need to download PHP from http://php.net/ and configure Apache. -
That bit of code is not the problem. The problem is with how the $md5 variable is being defined, as you said in your first post the md5 hash is wrong because it doesn't correspond to the hash stored in the database. I need to see how this variable is being set. Just posting the code for link isn't going yield you any helpful replies.
-
functions have there own variable scope. When using variables with functions you should pass them as arguments
-
First we'll need to know where the variables $id and $md5 are being set? Why do you need to set the md5 hash of the old password in the url? You need to post more information about what you're trying to do. Including relevant bits of code helps too.