ghurty
Members-
Posts
149 -
Joined
-
Last visited
Everything posted by ghurty
-
PHP script is loading in plain text instead of processing
ghurty replied to ghurty's topic in PHP Coding Help
just <? -
I have a php script that I am trying to run ( I dindt write it) but the index.php file loads basically all of the php file in plain text instead of running it. Any sugguestions? PHP is isntalled since other php scripts work. Thanks
-
Easy way to move 40 databases from one server to another?
ghurty replied to ghurty's topic in MySQL Help
In order to do that, I have to do this to each database individually. Is there a way to do multiple databases at once? Thanks -
I am trying to move about 40 databases from one server to another. Is there an easy to use command that will allow me to do that? The two servers are on separate private networks, so I may not be able to copy them directly, so what I would want to do is create a backup, then manually move it and the restore it. I belive I need to exclude informatio_schema as well as the mysql databses. Thanks
-
Sorry, cut off a little when copying/pasting. Fixed it now
-
In the following code, I am getting an error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '{' or '$' in XXX on line 235 Line 235 is the second line in the code snippet $result = mysql_query( $querystr, $this->linkid ); $this->"queryid".$id = $result; if ( defined( "SWIFTDEBUG" ) ) { Thanks
-
What command can I use in linux to create a new mysql database. Lets assume I want to create database name: nudatabase Server is localhost, username is root, password is test. Thanks
-
How would I code it that if a page is being loaded from a particular page (for example a contactsubmit php file) It will display a line like "Thank You". But if someone goes directly to that page it wont. Thanks
-
How to change format from 8005551212 to (800)555-1212
ghurty replied to ghurty's topic in PHP Coding Help
But how then do I take the results (case 10 for example) and assign it to a variable? Thanks -
I am trying to convert a variable that contains a telephone number in this format: 8005551212 to this format:(800) 555-1212. The variable that contains the number is $cidnum: $callerName = getCallerInfo($cidnum, $adb); So I would want to add a line above it that will switch $cidnum from being 8005551212 to (800) 555-1212. That is what I would mainly like to do. But is there a way to also have it that if it is a longer number (ie: a international number: 0845 060 3000) To have it that in that case it will rewrite it to be the international style? Thanks Thanks
-
How to change format from (800)555-1212 to 8005551212
ghurty replied to ghurty's topic in PHP Coding Help
Thank you for your help. -
I am trying to convert a variable that contains a telephone number in this format: (800) 555-1212 to this format:8005551212. The variable that contains the number is the initial $to: function transfer($from,$to){ $this->log->debug("in function transfer($from, $to)"); if(empty($from) || empty($to)) { echo "Not sufficient parameters to create the call"; $this->log->debug("Not sufficient parameters to create the call"); return false; } $to = "sip:$to"; So for right now, $to ens up being "sip:(800)555-1212" I want it that it ends up being "sip:8005551212". Thanks
-
Why would I be getting a Parse error: syntax error, unexpected T_OBJECT_OPERATOR on the first line of this code? if(!empty($_GET['designModeToken']) && getClass('ISC_ADMIN_AUTH')->isDesignModeAuthenticated($_GET['designModeToken'])) { isc_setCookie('designModeToken', $_GET['designModeToken'], 0, true); ob_end_clean(); header('Location: '.getConfig('ShopPathNormal')); exit; }
-
Problem using strtotime to convert two variables into a date
ghurty replied to ghurty's topic in PHP Coding Help
I just tried that, but for some reason, no matter what, it is outputting Wednesday. The month and day are working, but not the day of the week. Thanks -
Problem using strtotime to convert two variables into a date
ghurty replied to ghurty's topic in PHP Coding Help
Thank you. What would the best way for me to take a date (ex: 012510) and convert it into three sepereate variables: $month, $day, $dayoftheweek. So the for the given example, Month will = Janurary Day will = 25 Day of week will = Monday. I would need it as three seperate variables. Thanks -
I am having troubles convert a two variables into a date format: $OMONTH = "08"; $ODAY = 26; $DATELONG = DATE("M d", strtotime("{$OMONTH} {ODAY}")); echo $DATELONG . " Long DAte"; It should say Jan 26, but instead it is displaying DEC 31. Preferably, I would want it to print out "Tuesday January 26". Thanks
-
Would this work? I will be passing on a number as the variable for $hour and $minute and also eaither a AM or PM for $ampm. $time_in_24_hour_format = DATE("H:i", strtotime("{$hour}:{$minute} {$ampm}")); Thanks
-
Script stops working when substitue variable for constant
ghurty replied to ghurty's topic in PHP Coding Help
It worked. Thanks -
I have the following script that works perfectly. The problem is when I substitute a variable it stops working: #!/usr/bin/php -q <?php $origdirectory= '/temp/0125/; $destdirectory='/destination/'; if(is_dir($origdirectory)) { $dh=opendir($origdirectory); $ctr=0; while($ctr<15 && $file=readdir($dh)) { if(is_file($origdirectory.$file)) { rename($origdirectory.$file,$destdirectory.$file); $ctr++; } } closedir($dh); if(!$ctr) rmdir($origdirectory); } ?> But when I try to change to: $temp = date(md); $origdirectory= '/temp/$temp/'; It stops working. I am using 0125 in this example, because it is todays date. Thanks
-
When doing addition, how to have it output a leading zero?
ghurty replied to ghurty's topic in PHP Coding Help
Thank you. I had googled, but all the examples of sprintf had to do with displaying results on screen. Thanks -
When doing addition, how to have it output a leading zero?
ghurty replied to ghurty's topic in PHP Coding Help
Thank you, but I am trying to display the number, I am using it for a file name. How can I have it assign that value to a variable? -
I have two variables that I am adding to each other $time = $num1+$num2; Sometimes $num1 will have a leading zero (ex: 0410) but it will always be four digits long. The way it is now, if there is a leading zero, it outputs $time as a three digit number without the leading zero. How can I have it that it will output it as a four digit number? Thanks
-
Thank you, I tried that, but it does not proceded past that point. How do I tell it to continue processing the script after creating the directory if (!is_dir('/tmp/' . $directory)) { //If directory does not exixt mkdir('/tmp/' . $directory, 0750); //Writable by owner } $fromfile = "/tmp/" . $thisfile ; $tofile = "/tmp/'.$directory.'/" . $thisfile ;
-
What would the proper way of writing: $tofile = "/dialer/$calldate/"
ghurty replied to ghurty's topic in PHP Coding Help
Thank you