Jump to content

kostakondras

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by kostakondras

  1. Aight - thanks. I'll try and do the import again - this has helped a lot.
  2. Hi, I am creating an import using WP All Import in Wordpress and I've been told by their support that I have to write some custom code to create a nested serialised PHP array. The serialised array has to end up looking like this: s:287:"a:8:{s:5:"price";a:2:{s:5:"value";s:5:"38000";s:8:"original";s:0:"";}s:17:"custom_tax_inside";s:0:"";s:15:"custom_tax_page";s:0:"";s:8:"city_mpg";a:1:{s:5:"value";s:0:"";}s:11:"highway_mpg";a:1:{s:5:"value";s:0:"";}s:12:"custom_badge";s:0:"";s:5:"video";s:0:"";s:10:"short_desc";s:0:"";}"; Can you give me any advice on how I can: a) See what this nested serialised array actually looks like b) How I can code a nested serialised array like this Once I can do this I plan to put it into a hook for when WP All Import is importing and this will allow me to import certain values (like price) into my car database. Any input from anyone in the community would be much appreciated. Bonus Point: I have another field that containst he following serialised array: a:7:{i:0;s:38:"Multi-function Control Screen - Colour";i:1;s:17:"11 Speaker Stereo";i:2;s:15:"Online Services";i:3;s:19:"18inch Alloy Wheels";i:4;s:21:"Power - Tailgate/Boot";i:5;s:45:"Power Door Mirrors - Auto Dipping (Reversing)";i:6;s:13:"Driving Lamps";} When I put this into 'http://www.unserialize.com/' I get the following: 'Array ( [0] => Multi-function Control Screen - Colour [1] => 11 Speaker Stereo [2] => Online Services [3] => 18inch Alloy Wheels [4] => Power - Tailgate/Boot [5] => Power Door Mirrors - Auto Dipping (Reversing) [6] => Driving Lamps )' However when I type in the following: s:287:"a:8:{s:5:"price";a:2:{s:5:"value";s:5:"38000";s:8:"original";s:0:"";}s:17:"custom_tax_inside";s:0:"";s:15:"custom_tax_page";s:0:"";s:8:"city_mpg";a:1:{s:5:"value";s:0:"";}s:11:"highway_mpg";a:1:{s:5:"value";s:0:"";}s:12:"custom_badge";s:0:"";s:5:"video";s:0:"";s:10:"short_desc";s:0:"";}"; I get the following: s:287:"a:8:{s:5:"price";a:2:{s:5:"value";s:5:"38000";s:8:"original";s:0:"";}s:17:"custom_tax_inside";s:0:"";s:15:"custom_tax_page";s:0:"";s:8:"city_mpg";a:1:{s:5:"value";s:0:"";}s:11:"highway_mpg";a:1:{s:5:"value";s:0:"";}s:12:"custom_badge";s:0:"";s:5:"video";s:0:"";s:10:"short_desc";s:0:"";}"; I just get a string with no array values - what am I doing wrong? Is there something wrong with the serialised array above?
  3. I recently exported a database from phpMyAdmin, now I'm not sure but I assume I missed out on some options, basically the whole import/export thing has got me confused. I think I exported the database however the .sql file that was created doesn't include th SQL commands to create the databse itself, so I assume it just expects a table skeleton to put its data in, now that I can solve by creating a skeleton. However I have another database which I exported in .sql format from another version of phpMyAdmin which is hosted by my server. Anyway once I try to import it back it tells me that I do not have the permission to create a new database (so this database I must have exported with the option to create a new database of the same name when it is re-imported, where is this option?). The problem I am having is that when I import this .sql file (which includes the CREATE DATABSAE command) it tells me that I do not have permissions to create a new database. Then when I create the database myself it then tells me it can't import because the database all ready exists! See the conondrum I'm in? Any suggestions would be appreciated. Thanks guys
  4. Hi guys, I'm using the API for Remember the Milk through a PHP class that I found online called PHP-RTM. Anyway after so much headaches (the authentication for the Remember the Milk API is one of the hardest I've ever come across) I've finally connected everything and gotten to the stage that I have some raw data inside an array. The next step is to work with that data. Basically I want to access the names of the task in a complex multi demensional array and I have no idea how to do this. I have done a var_dump of the array I am working with to show you the complexity. Just remember that in the complex var_dump below there are only 4 tasks: array(2) { ["stat"]=> string(2) "ok" ["tasks"]=> array(2) { ["rev"]=> string(31) "nxeir6vy9pcgcggoss4wwwooc8cwo8w" ["list"]=> array(3) { [/tt] => array(2) { ["id"]=> string( "13927305" ["taskseries"]=> array(2) { [tt]=> array(11) { ["id"]=> string(9) "104056511" ["created"]=> string(20) "2011-02-02T12:48:48Z" ["modified"]=> string(20) "2011-02-02T12:48:48Z" ["name"]=> string(42) "Send confirmation email to luxury car hire" ["source"]=> string(13) "iphone-native" ["url"]=> string(0) "" ["location_id"]=> string(0) "" ["tags"]=> array(0) { } ["participants"]=> array(0) { } ["notes"]=> array(0) { } ["task"]=> array(9) { ["id"]=> string(9) "156815180" ["due"]=> string(20) "2011-02-02T13:00:00Z" ["has_due_time"]=> string(1) "0" ["added"]=> string(20) "2011-02-02T12:48:48Z" ["completed"]=> string(0) "" ["deleted"]=> string(0) "" ["priority"]=> string(1) "N" ["postponed"]=> string(1) "0" ["estimate"]=> string(0) "" } } [1]=> array(11) { ["id"]=> string(9) "104148150" ["created"]=> string(20) "2011-02-03T01:25:57Z" ["modified"]=> string(20) "2011-02-03T01:26:17Z" ["name"]=> string(40) "Confirm that post has been sent with DVD" ["source"]=> string(2) "js" ["url"]=> string(0) "" ["location_id"]=> string(0) "" ["tags"]=> array(0) { } ["participants"]=> array(0) { } ["notes"]=> array(0) { } ["task"]=> array(9) { ["id"]=> string(9) "156951316" ["due"]=> string(20) "2011-02-02T13:00:00Z" ["has_due_time"]=> string(1) "0" ["added"]=> string(20) "2011-02-03T01:25:57Z" ["completed"]=> string(0) "" ["deleted"]=> string(0) "" ["priority"]=> string(1) "N" ["postponed"]=> string(1) "0" ["estimate"]=> string(0) "" } } } } [1]=> array(2) { ["id"]=> string( "13925842" ["taskseries"]=> array(12) { ["id"]=> string( "98105089" ["created"]=> string(20) "2010-12-19T11:25:25Z" ["modified"]=> string(20) "2011-02-02T13:01:42Z" ["name"]=> string(25) "Read for one hour per day" ["source"]=> string(13) "iphone-native" ["url"]=> string(0) "" ["location_id"]=> string(0) "" ["rrule"]=> array(2) { ["every"]=> string(1) "1" ["$t"]=> string(21) "INTERVAL=1;FREQ=DAILY" } ["tags"]=> array(0) { } ["participants"]=> array(0) { } ["notes"]=> array(0) { } ["task"]=> array(9) { ["id"]=> string(9) "156576423" ["due"]=> string(20) "2011-02-02T13:00:00Z" ["has_due_time"]=> string(1) "0" ["added"]=> string(20) "2011-02-01T13:01:45Z" ["completed"]=> string(0) "" ["deleted"]=> string(0) "" ["priority"]=> string(1) "N" ["postponed"]=> string(1) "0" ["estimate"]=> string(0) "" } } } [2]=> array(2) { ["id"]=> string( "17007566" ["taskseries"]=> array(11) { ["id"]=> string(9) "104017503" ["created"]=> string(20) "2011-02-02T05:45:04Z" ["modified"]=> string(20) "2011-02-03T02:29:55Z" ["name"]=> string(96) "Hook up watermark for both videos (check email) and send to Rachelle and Steve at compare quotes" ["source"]=> string(2) "js" ["url"]=> string(0) "" ["location_id"]=> string(0) "" ["tags"]=> array(0) { } ["participants"]=> array(1) { ["contact"]=> array(3) { ["id"]=> string(7) "2150286" ["fullname"]=> string(10) "Samuel Nam" ["username"]=> string(10) "samuel.nam" } } ["notes"]=> array(0) { } ["task"]=> array(9) { ["id"]=> string(9) "156754354" ["due"]=> string(20) "2011-02-02T13:00:00Z" ["has_due_time"]=> string(1) "0" ["added"]=> string(20) "2011-02-02T05:45:04Z" ["completed"]=> string(20) "2011-02-03T02:32:00Z" ["deleted"]=> string(0) "" ["priority"]=> string(1) "N" ["postponed"]=> string(1) "0" ["estimate"]=> string(0) "" } } } } } } Anyone know the code i can use to simply get the "name" keys from the complex array below. I've created a movie to show what I'm trying to achieve, please click below to view: http://screenr.com/XIY MOD EDIT: formatted text to get rid of errant smilies . . .
  5. And if not, is there a way to display the map along with the Directions?
  6. Will this display the graphical map itself or simply the directional steps?
  7. I am attempting to create a Map on my web page that will have the directions (which will be dynamically pulled from a database) however I have been unable to find a good tutorial on how to achieve this, also there doesn't seem to be any PHP classes available out there (for free anyway) to create this easily. Any suggestions?
  8. Hi Requinix, Thanks for the info. I did not know that. However I have been able to solve this problem, it seems that the include_path does not work if there are multiple include_paths in the php.ini file (WAMP was using the right .ini file). So what I did was put all my include paths into one include_path directive seperated by a semicolon (. I can see the blue screen that says "Welcome to the Zend Framework" so I've taken the next step . So for now I have the problem fixed until I get stuck again. Regards
  9. I am having difficulties with my include_path directives in the php.ini file. Please click the link below to see a screencast of the problem: http://screenr.com/vhY I am very confused as sometimes the include_path does work and sometimes it doesn't work. Also am I allowed to have multiple include_path directives or do I need to include every path in a single include_path directive.
  10. Thanks thehippy. I've recently upgraded my PHP on WAMP and it's now running at PHP 5.3.0. I've noticed the shortcut to edit the PHP.ini file from the Desktop is not the php.ini file that resides inside c:\wamp\bin\php\php5.3.0. But even after changing the include_path in this folder, still, the includes are not registering. What would the reason be. I'm restarting the server every time I do it. Here is the code (I've put an echo statement into one of the Zend files and included it with require_once. include_path = ".;c:\php\includes;C:\wamp\zend\library\Zend" I restart the server and I have a statement in a test php file that states the following: require_once("View.php"); //as you know this is some file inside the zend/library/Zend folder Why doesn't it work? And why are there multiple PHP.ini files.
  11. I'm currently going through the process of installing the Zend framework and I have created a new project. However when viewing the public folder I am greeted with an Internal Server Error. Any idea on what could be causing this problem? I have looked through the FAQ on ZendFramework website and Google to no avail. Also I have included a screencast in the link below to give you an idea of where I'm currently at if it helps at all. http://screenr.com/N2Y Thank you for any help.
  12. That's why I marked this as solved so no one would bother with it.
  13. Am watching this now, however I should note that this whole post is wrong and I have made another however I do not know how to delete this one.
  14. I am attempting to install PEAR however am very confused and I believe I have stuffed up something from which it will be very complicated to come back from. Firstly, for some reason I have the C:\wamp\bin\php\php5.3.0\go-pear.bat installation file, but I also have the C:\PHP\go-pear.bat installation file. Which one do I choose? And is the C:\PHP direcotry left over from an old installation. I have no idea. Further to that, I ran the go-pear.bat installation from the C:\PHP directory, I have a feeling this was the wrong decision. After installing everything it stated that it had updated my php.ini file, however this file was in the wrong directory and so I took the updated lines from the php.ini which put in a a new include_path and pasted them into the php.ini file in the C:\wamp... directory. Now when I go to the command prompt and type in pear here is the message I get: PHP_PEAR_PHP_BIN is not set correctly. Please fix it using your environment variable or modify the default value in pear.bat The current value is: .\php.exe I have followed a remedy to this which is included here: http://www.pear-forum.org/topic2413.html However still to no avail. I am further confused why I have a C:\PHP folder and why it is seperate from my WAMP folder. Further to that, when I try to install PEAR from my WAMP folder and click on C:\wamp\bin\php\php5.3.0\go-pear.bat I get the following error message: phar "C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar" does not have a signaturePHP warning require_once(phar://go-pear.phar/index.php>: failed to open stream: phar error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar n line 1236 (and another message that looks very similar) ----- Note: the installation instructions I am following are located here > http://trac.symfony-project.org/wiki/HowToInstallPearOnWindowsWithWamp ------ So basically I am stuck. Why is it so difficult to install PEAR and how do I simply get it working?
  15. Figured out what the problem was; there was no password set at all, so all I had to do was press Enter.
  16. I am attempting to install PEAR however am very confused and I believe I have stuffed up something from which it will be very complicated to come back from. Firstly, for some reason I have the C:\wamp\bin\php\php5.3.0\go-pear.bat installation file, but I also have the C:\PHP\go-pear.bat installation file. Which one do I choose? And is the C:\PHP direcotry left over from an old installation. I have no idea. Further to that, I ran the go-pear.bat installation from the C:\PHP directory, I have a feeling this was the wrong decision. After installing everything it stated that it had updated my php.ini file, however this file was in the wrong directory and so I took the updated lines from the php.ini which put in a a new include_path and pasted them into the php.ini file in the C:\wamp... directory. Now when I go to the command prompt and type in pear here is the message I get: PHP_PEAR_PHP_BIN is not set correctly. Please fix it using your environment variable or modify the default value in pear.bat The current value is: .\php.exe I have followed a remedy to this which is included here: http://www.pear-forum.org/topic2413.html However still to no avail. I am further confused why I have a C:\PHP folder and why it is seperate from my WAMP folder. Further to that, when I try to install PEAR from my WAMP folder and click on C:\wamp\bin\php\php5.3.0\go-pear.bat I get the following error message: phar "C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar" does not have a signaturePHP warning require_once(phar://go-pear.phar/index.php>: failed to open stream: phar error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar n line 1236 (and another message that looks very similar) ----- Note: the installation instructions I am following are located here > http://trac.symfony-project.org/wiki/HowToInstallPearOnWindowsWithWamp ------ So basically I am stuck. Why is it so difficult to install PEAR and how do I simply get it working?
  17. I am very confused at an example in a book I am reading called Beggining PHP regarding XML-RPC requests. I will write the code below: function send($remoteServer, $remotePort, $fullXMLRPCRequest) { $headers = ''; $data = ''; $socket = fsockopen($remoteServer, $remotePort); fwrite($socket, $fullXMLRPCRequest); while ($str = trim(fgets($socket))) { // why doesn't this exhaust the returned call?? $headers .= $str . "\n"; } while (!feof($socket)) { $data .= fgets($socket); } fclose($socket); return $data; } The question I have is notice how there are two while statements and they both access the same resource ($socket). So how can there be two while statements?? Wouldn't the first while statement exhaust the resource and there would be nothing on the second while statement? I hope this makes sense. It's sort of like saying while(x < 10) { //execute... ++x; } then another while statement while(x < 10) { //execute... ++x; } Well then wouldn't the second while statement not execute? I hope I made sense. Thanks for all the help in advance. Obviously knowing XML-RPC would help in answering this question, hopefully most of you are familiar with it.
  18. I have just installed Smarty on my local server and am trying to get it to work. I have created 4 seperate folders as instructed in Beginning PHp book includes templates, configs, templates_c and cache folders. All these folders are inside the Smarty folder in C:/PHP/includes and the include_path directive is setup. When I try to run the template with the code below: <?php require_once("Smarty.class.php"); $smarty = new Smarty; $smarty->assign("title", "Welcome to your Smarty Page"); $smarty->assign("body", "As you can see, everything is working properly on the template side"); $smarty->display("welcome.tpl"); ?> The following error is returned: [25-Jan-2011 03:51:38] PHP Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'welcome.tpl'' in I thought it would search by default inside the templates folder however it doesn't. Is there any way to set it manually or what should I do? I have tried $smarty->template_dir="C:\PHP\includes\smarty\templates"; after creating the Smarty class however this does not seem to work either. Thank you in advance for the help, please ask any more questions that you require of myself. Regards
  19. Currently, I am reading a book called PHP Web 2.0 Mashups and I have stumbled across an error on the second chapter which deals with XML-RPC protocol. The book has the following code which it uses to demonstrate the XML-RPC encoding functionality of PHP with the xmlrpc_encode_request function: <?php $singleVar = "Hello!"; $requestMessage = xmlrpc_encode_request('theRemoteCall', $singleVar); echo $requestMessage; ?> However when I load this page up on my local testing platform nothing is displayed. Upon checking the PHP error log I am confronted with this: [24-Jan-2011 07:56:40] PHP Fatal error: Call to undefined function xmlrpc_encode_request() in C:\wamp\www\jquery\collapsible.php on line 79 A couple of other points in relation to this: 1. I have the following lines in my PHP.ini file: ; Turn off normal error reporting and emit XML-RPC error XML ; http://php.net/xmlrpc-errors ;xmlrpc_errors = 0 ; An XML-RPC faultCode ;xmlrpc_error_number = 0 Does this not mean that xmlrpc functions are all ready installed on my WAMP server? I have download XML-RPC for PHP from http://phpxmlrpc.sourceforge.net/ (3.0.0 beta) and placed the files inside the extracted 'lib' folder into C:/PHP/includes and uncommented the PHP.ini line 'include_path = ".;c:\php\includes"'. However still, after restarting WAMP and refreshing the page it is still issuing a fatal error in PHP error log. Thank you for all your help in advance.
  20. I have a form on my website which actions login.php. The login.php code is below: <?php include('includes/classes.php.inc'); session_start(); $link = new BaseClass(); $data = $link->query("SELECT * FROM logins"); $pass_accepted = false; if($_REQUEST['username'] && $_REQUEST['password']){ $username = $_REQUEST['username']; $password = $_REQUEST['password']; while($row = mysql_fetch_array($data)){ if(($row['username']==$useranme)&&($row['password']==$password){ echo 'Password correct!'; $_SESSION['loggedin']=true; $pass_accepted = true; } } } else { echo 'You did not enter a username or password!'; } if(!$pass_accepted){ echo 'Your password is incorrect'; } echo '<br>Please <a href="index.php">click here</a> to return to page'; ?> I have checked that my references are all correct however even when I enter the correct password it returns saying the password is incorrect. Any idea on why this could be? I am happy to answer any follow up questions. Regards
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.