Jump to content

itachi77

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by itachi77

  1. Hi Guys, not sure if this is the right part of the forum to post this in but can someone advise me on a library or framework which I can use with php to edit images. So for example, I have a form with various fields and then I have a couple of pictures/diagrams which I can make marks on i.e. lines, crosses and then I can save that image and retrieve it later. I have come across a few that allow cropping, resizing etc but I'm more interested in being able to make marks or even text on the image. Thanks
  2. Ah I've found the solution though it was rather stupid of me but misleading from MAMP I would say. I had put the path for the start page of MAMP as /frontpage.php. Assuming it meant /htdocs/frontpage.php . So I copied all my files directly into htdocs but i also had a subfolder in htdocs which the Apache Document root was set to. All the time I was thinking that because the start up page was directly in htdocs it would refer to the rest of the pages there and not the subfolder. Thanks Pikachu for your effort, really appreciated.
  3. I just noticed something strange, when i add a new user and gave full privileges and tried the same script with different user and corresponding password I got the same Access denied for root user. So i edited one of my script files in terms of content, stopped MAMP and started it and the change was not reflected! I restarted the Mac and still the same thing.
  4. Nope, it's not returning any connection errors. This is beginning to drive me mad. The only error statements are the Access denied and in the php log file the resource expected boolean given error.
  5. I can access the database through the mac terminal with the same password, I can use phpMyAdmin
  6. Thanks, I just installed MAMP, the server is up and running and I have created sql tables etc. But I can't seem to connect to the database. The code is : $con=mysql_connect('localhost','root','root');mysql_select_db('project1',$con); I haven't changed the user or the password and i get the 'Access denied for user root at local host using password yes' error! I get nothing in the mysql or apache logs but in php log I get this: PHP Warning:mysql_select_db() expects parameter 2 to be resource, boolean given... And the above code is line 1 and 2. Any help would be very appreciated, thanks.
  7. Hi guys, got a bit of an issue. I have a WAMP server set up on my windows XP computer and I need to set up a similar environment on the MAC 10.6.4. Last time i tried configuring the built in Apache on the MAC and installing php and mysql it got really messy. The localhost page went all black as well as the php.ini file! So could anyone recommend the easiest method of configuring/installing php/mysql/server on the MAC. Is there something like WAMP out there? I don't mind recreating the tables from the Windows XP install as long as it installs smoothly. I would like to run the server locally. Thanks
  8. there's no way around it? The site will only be for that single computer not using internet.
  9. Hi guys, very quick question and i'm sure it's a simple reply, I have googled but can't seem to pinpoint what i need. I have some pdf files stored in a folder on my desktop. I want to open one of them when a link is clicked so i have: echo "<a href='C:\Desktop\pdfs\file1.pdf'>Click to view</a>" I would like to open it the browser. I can open files that are in the web folder but i don't know how to open ones in folders located outside the web folder. When i click the link nothing happens at all. Many many thanks.
  10. ah sorry guys, the code i had was like this : echo "<input type='hidden' value=".$name."name='na'/>" The reason why it wasn't working was because i forgot the ' ' around the $name so like echo "<input type='hidden' value='".$name."'name='na'/>" really silly of me, thanks for the effort.
  11. Hi, having a really strange problem, i have a form like this: <form method='post' action='addcart.php'> echo $name //prints both parts of name separated by space <input type='hidden' value='$name' name='na' and then in the addcart.php echo $_POST['na'] //only prints first half of name So for example, if $name was "Product One" when i print the value in first script it prints Product One fine but when i print in the other script it only prints "Product". This then leads onto only half the name being copied into a database. I'm sure this was working fine before, not sure what the problem here is...
  12. that worked great, thanks Alex. Just a question, why did the php reload in my script not work? Also, i didn't know this was javascript, could you give a brief explanation as it's the first time i have seen it. One slight hiccup I am having now is that when the page reloads i can work with the variable etc but the menu list does not display the option that was selected as default, it displays the first option in the list. So if option 2 was selected in the list, the page reloads and shows option 1 as default. Thanks
  13. Hi, just wondering if there is a way to reload the page with the form submitted when a value in a list is changed but without pressing a submit button. I have something like this <form method='post' action =""><select name='add' onchange=<?php $_SERVER['PHP_SELF']> <option>Option 1</option> <option>Option 2</option></select></form> This doesn't seem to be doing anything, it doesn't reload when an item is selected from the list. The purpose of this is depending on what option a user selects a text box will be shown so i want to be able to reload the page without pressing submit and can then use the variables sent. Thanks
  14. Hi, seem to be having trouble with mergeblocks with livedocx in php. I understand that for merge blocks a multi associative array is needed such as : $billConnections = array( array( 'con_productid' => 1A, 'con_quantity' => '10', 'subtotal' => '£10', ), array( 'con_productid' => '1B', 'con_quantity' => '20', 'subtotal' => '£30', ), ); This does print two rows on the document, however i am struggling to understand how to transfer SESSION variables into those 3 fields. I have tried: $array1=unserialize($_SESSION['product']); while(list($vs,$ks)=each($array1)) $billconnections=array( array('con_productid'=> $ks)); But this only seems to print one row not for all the product id's stored in the session variable. I know session array itself is an associative array but i'm getting confused with how to specify the different fields with it. Any help appreciated, thanks
  15. Hi I managed to solve the above error by uncommenting in the php.ini file. Apparently i needed to enable https stream wrapper. The output document is created in the webroot folder, is there a way to specify where to output the document? And where to take the template in from? Thanks
  16. I have now uncommented the in the php.ini file and the other soap settings look like this : I am now getting a slightly different error:
  17. Thanks for the prompt reply, I have now set the include as : And have added the require_once 'Zend\Service\LiveDocx\MailMerge.php'; to the top of the above script. I now get a new error : Any ideas? Thanks
  18. Hi all, seem to be having some trouble getting these two to work together. I have followed this video tutorial : http://www.videophpblog.com/2008/06/15/installing-zend-framework/ In this i have downloaded the full zend framework and extracted to C: I have then taken the Zend folder in the library folder of Zend Framework and copied to C: . My webroot is also at C: . I have then edited the include in the php.ini file in the php folder to point to the Zend library folder so it looks like this: include_path = ".;c:\php\includes;c:\Zend" phpinfo() runs fine, I see the include path in it. I have put the template.docx file in the webroot folder and when i run this script: <?php $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(); $phpLiveDocx->setUsername('******') ->setPassword('******'); $phpLiveDocx->setLocalTemplate('template.docx'); $phpLiveDocx->assign('Name', 'Mr. B') ->assign('Venue', 'Radisson SAS') ->assign('Date','06/07/08') ->assign('NumberofPeople', '10'); $phpLiveDocx->createDocument(); $document = $phpLiveDocx->retrieveDocument('pdf'); file_put_contents('document.pdf', $document); ?> I get the error : I am sure I am missing something but the tutorial did not say anything else. I am using apache and the server is running fine. I have tried running the check environment script in the demos/service/livedocx folder but that shows the following error: Any help would be appreciated, thanks, i have come across a few tutorials and they all seem to be different so i'm a little confused on where to go from here.
  19. Hi all, just signed up and this forum looks like a pretty good source of information. I am a beginner to PHP and would like help in relation to reloading of a php page. I have two text boxes in which a user can specify the name of a product and the quantity they would like. They have the option to add more products so when they click on the Add Product button the page reloads and the selection they made is added to an associative array which can on submission of the complete form be used in an sql query to retrieve price etc. The problem is every time the page reloads the array needs to be redefined so the previous product information is lost. Is there a way to reload the page but not having to redefine the array? Only one person is going to be using this application hence not using cookies. Thanks <?php $products=array(); if(isset($_POST['product'])){ $products +=array($_POST['product']=>$_POST['quantity']); } else { } foreach($products as $ind=>$val) echo "$val : $ind" ."<br>" ?> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method='POST'> <input type="text" name="product"/> <input type="text" name="quantity"/> <input type="submit" value="Add Product"/> </form>
×
×
  • 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.