Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. definitely the array structure - you can access it without having to do any further processing...
  2. So I cannot edit the php.ini file post installation? where in the control panel is this magical UI of extension adding? I'm going through the add or remove programs thing but yet to find where I can change the extensions for php. Sorry but windows is gash - need a bit of hand holding on this one
  3. This was installed via the msi - I would have done manual but this was installed by another member of the team and assurances given that the msi was used...
  4. Hi guys n gals, I'm no win server 2008 guru so need a bit of help... I have PHP running on win server 2008 (that's what I have been dealt so no sniggering!)... getting the 'unable to load dynamic library for: php_curl.dll php_http.dll php_imap.dll php_mbstring.dll php_mcrypt.dll php_exif.dll php_sockets.dll uploadprogress.dll php_zip.dll (they are loaded in that order) other dlls load ok and these are: php_gd2.dll php_mysql.dll php_mysqli.dll php_pdo.dll php_pdo_mysql.dll the extension dir in php.ini is set (done it absolutely "D:\PHP\ext") and those dlls all exist within that directory. D:\PHP is definitely in the environemt PATH var... Only thing I have come across is a reference to msrvc70.dll is not present on the server but surely this should not prevent the libs being loaded! there is no reference to such a requirement in the docs. (found that on a thread so it could be irrelevant.) Any help/tips on resolving this would be VERY much appreciated.
  5. have a look at using define - constants are globally available, and much more efficient that variables. Set these as configuration settings in a global include or similar
  6. replace your jquery with this: $(document).ready(function(){ $("form#submit").submit(function() { // we want to store the values from the form input box, then send via ajax below var mssg = $('#Messages').val(); $.ajax({ type: "POST", url: "ajax2.php", data: "Messages="+ mssg, success: function(){ $('form#submit').hide(function(){$('div.success').fadeIn();}); } }); return false; }); });
  7. it wasn't a point it was a question - you are concatenating to variables (which will make them a string) and then trying to assign an object to them.. rather than going down the variable variable route I'd suggest an array... <?php require_once("../Person/Person.php"); $count = $_POST['count']; $people = array() while ($add++ < $count) { $people[] = new Person('laryy'); } ?> however as you pass larry to the constructor I don't think this is your intention.... Rather than guessing at what you are trying to achieve please tell us. posting code without any description of what it is meant to do is often pointless (unless your code is good enough to document itself).
  8. probably because you have the path to image wrong. the image tage takes the url (relative or absolute) to the actual image file - so unless you are using a dynamic image creation script the src attribute should contain the path and file name of the image. /picture/h - clearly this is is missing the extension!
  9. $str = preg_replace('/Where: ([^\n]*)/m','Where: <a href="http://maps.google.com?q=$1">$1</a>', $str ); that will leave spaces in the url. IF you need the + in there then: preg_match('/Where: ([^\n]*)/m', $str , $matches ); $term = str_replace(' ', '+', $matches[1]); $str = preg_replace('/Where: ([^\n]*)/m','Where: <a href="http://maps.google.com?q='.$term.'">$1</a>', $str );
  10. // Get all the data from the dogs table $result = mysql_query("SELECT * FROM dogs WHERE owner=".$_SESSION['id']) or die(mysql_error());
  11. have a look at this http://www.maxmind.com/app/geolitecountry.
  12. because it is easy to inadvertently change this value by giving a new variable the same name of the 'global' and most likely destroying the integrity of your application there after. If there are values you want to be globally available then perhaps look at using constants (define()) or creating a registry class so at the very least you can control the scope of what can amend the variable.
  13. No that is an effect controlled by the browser - more specifically it should be javascript driven.
  14. that would be because $itemarrayview[0] is only one record...
  15. then why didn't you say you wanted each element rather than just selecting a specified 'row'? you could use <?php $selectedRow = $array[2]; list($patientid, $forename, $surname], $dob) = $selectedRow; ?> [i don't like list() but thats just me... or <?php $selectedRow = $array[2]; foreach( $selectedRow as $key => $val) { $$key = $val; } ?> The latter will produce variables of whatever your array indexes are called (provided they are not numeric - in which case it will fail miserably) so is in that sense a bit more robust.
  16. <?php $selectedRow = $array[2]; var_dump($selectedRow); ?>
  17. why not check that it IS admin... <?php if ( $row['personale'] > 2 ) { // do admin stuff. } else { // do other stuff. } ?>
  18. all those cases will come to hurt you - build the array - hopefully programatically from some data source and you won't need to worry about it ever again
  19. it mat be more beneficial to create an array of these like so... $lenses = array('-4'=>'-4','-3.5'=>'-3.5' ..... 'Plano'=>0,'Balance'=>'+0.25' .... '+2.25'=>'+2.25' ...); creating this from a database record set or similar should be trivial... the advantage is then you can simply use: <select name="cstLeftcyl" type="text"> <?php foreach($lenses as $key => $value){ $selected = $value == $cstLeftcyl ? 'selected="selected"' : NULL; ?> <option value="<?php echo $value;?>" <?php echo $selected; ?>><?php echo $key; ?></option> <?php } ?> </select> this would mean that should any new type be developed then you only need add the data to the array - the rest will take care of itself.
  20. Actually - in this case you may find using the DOM and XPath a better method - preg_match is expensive and slow... something like: $doc = new DOMDocument(); $doc->loadHTMLFile("/path/to/your/file.html"); $xpath = new DOMXpath($doc); then you can grab all manner of info without having to run preg_match over and over again.. $title = $xpath->query("//title")->item( 0 )->nodeValue; $keywords = $xpath->query("//meta[@name='keywords']")->item(0)->getAttribute('content'); and so on and so forth... You should find this method a bit more efficient/quicker and a bit more fun
  21. As an appendage to that last post... Is it possible to get zend from to render array type elements alternating fasion? so in the case of $form->addElement('Checkbox', 'id', array('isArray' => true)); $form->addElement('Text', 'text', array('isArray' => true)); it could output <input type="checkbox" name="id[]" /><input type="text" name="text[]" /> <input type="checkbox" name="id[]" /><input type="text" name="text[]" /> <input type="checkbox" name="id[]" /><input type="text" name="text[]" /> <input type="checkbox" name="id[]" /><input type="text" name="text[]" />
  22. Thanks ignace... Yeah I can see how that is going to work... Any chance of an example of how you would get the form rendered like in my example? I need the text box to be implicitly associated with its corresponding checkbox within the markup.. Apologies for noobieness liking this framework a lot and picking bits up quickly but this one is a bit beyond me right now.
  23. Hi peeps. In need of a bit of assistance with zend form... I need to create a form with multicheckbox and have a text box associated with that checkbox. I can handle to output but its building the form itself - the mark up needed would be something like <form> <dl> <dt></dt> <dd> <label><input type="checkbox" name="id[]" id="id-1" value="1" />Text 1</label> <label for="text-1">Title:</label><input type="text" name="text[]" id="text-1" /> <br /> <label><input type="checkbox" name="id[]" id="id-2" value="2" />Text 2</label> <label for="text-2">Title:</label><input type="text" name="text[]" id="text-2" /> </dd> </dl> </form> I've not got to custom decorators or view helpers yet but suspect that this is a case where I'm gonna need it. ANy help would be very much appreciated...
  24. where id IN (" . explode(',',$array) . ") ...
  25. Hi peeps, I have two tables in a one-to-many relation ship. what I need is to concatenate all the rows of table 2 so a query will return one result. Some thing like: SELECT `users`.`user_id`, CONCAT_WS(',',SELECT `country_id` FROM `user_countries` WHERE `user_countries`.`user_id` = `users`.`user_id`) as `countries` FROM `users` If user 2 had been to countries 1,6,8 and 9 I want a reult of `user_id` => 2 `countries` => '1,6,8,9' ANY help would be VERY MUCH appreciated.
×
×
  • 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.