2,113 Posted Topics

Member Avatar for urbanthistleuk

You could use `getmxrr()`: <?php $url = 'daniweb.com'; getmxrr($url, $matches, $weights); print_r($matches); print_r($weights); Docs: http://php.net/getmxrr Regarding `dns_get_record()` what kind of problem do you experience? Can you show your script? > I need to be able to display the srv record below the textbox, the srv record needs to start with …

Member Avatar for urbanthistleuk
0
243
Member Avatar for davy_yg

At line `10` there is an error: if (isset($searching) && $searching==yes) the value `yes` is a string not a constant, so change it to: if (isset($searching) && $searching=='yes') At line `82` you wrote: echo $recordObj->mycolumn; But you're retrieving `title`, `content` and `images` from the query, so it should be: echo …

Member Avatar for cereal
0
349
Member Avatar for Monica_1

Hi, `maximum_execution_time` referes to PHP, so can you paste here the script? Also did you enabled the slow query log in MySQL?

Member Avatar for gabrielcastillo
0
186
Member Avatar for archie.herbias

That's probably happens because you're trying to access the controller from the application directory instead of using the `index.php` file. If, for example you have a controller named Articles, then try: http://localhost/index.php/articles If this does not help then try to provide more information: * an example of url used to …

Member Avatar for gabrielcastillo
0
132
Member Avatar for mattyd

In addition, you could use a PHP array, for example create **fruits.php**: <?php return array( 'red' => array( 'Cherries', 'Cranberries', 'Pomegranate', ), 'green' => array( 'Avocados', 'Cucumbers', 'Honeydew', ), 'blue' => array( 'Blueberries', 'Fig', 'Plums' ) ); Then you can include it in your script as a configuration file: <?php …

Member Avatar for diafol
0
301
Member Avatar for hschillig

Hi, posting the structures of the tables would help to understand. Right now it seems you just need to select by `av.sku_id`: select av.value, av.id, av.sku_id from product_attr_vals where av.sku_id = '#3103513504350'; But I suppose the value you were referring, i.e. `12.7oz`, is saved somewhere, from the above I don't …

Member Avatar for hschillig
0
171
Member Avatar for cali_dotcom
Member Avatar for veedeoo

Yep: http://talks.php.net/show/phplondon13/ To browse through the slides use the keyboard arrows. **Note** I suggest Firefox to browse them, Chrome seems to not work fine.

Member Avatar for veedeoo
0
952
Member Avatar for mpc123

Hi, can you explain it a bit more? If I've understood you want to redirect only certain urls basing on regular expressions, correct? Are these slugs (`now-when`, `an-other`) saved into a database?

Member Avatar for cereal
0
182
Member Avatar for grafic.web

Something like this should work: <!DOCTYPE html> <html> <head> <title>Tabless</title> <style type="text/css"> *{margin:0;padding:0;} .table { display:table; margin:50px auto; width:960px; position:relative; } .tr { display:table-row; margin:10px 0; } .td { display:table-cell; height:30px; } .strong {font-weight:bold;} </style> </head> <body> <div class="table"> <ul class="tr strong"> <li class="td">TEXT</li> <li class="td">TEXT</li> <li class="td">TEXT</li> </ul> <ul …

Member Avatar for grafic.web
0
253
Member Avatar for saadi06

You can use a CSS to format the layout as you want, also read this article: * http://alistapart.com/article/goingtoprint/ it is a bit old but still useful.

Member Avatar for cereal
0
103
Member Avatar for johnef_sh

It seems your SSL domain is not well configured, if you browse to the root `https://nadim.org/` you get the default page. The `index.php` page is missing, the `new2` directory is missing as well. By the way, even switching from HTTPS to HTTP it does not work, you need to complete …

Member Avatar for johnef_sh
0
296
Member Avatar for mwenyenia07

Hi, It's normal because 0 equals to 01-01-1970 so, to get previous dates, you will receive negatives values. The problem is that, if you want to store it in MySQL, the `from_unixtimestamp()` function will not handle signed timestamps (i.e. negative values), if you want to display a *datetime* you will …

Member Avatar for cereal
0
467
Member Avatar for mbarandao

Yes, it can be done. Inside the loop that generates this array place this code: if($loopCount == 1) { if(preg_match("/[0-9]{5}/", $myValue, $match) == 1) { $array_two[$arrayIndex]['zip'] = $match[0]; } else { $array_two[$arrayIndex]['zip'] = 0; } } Full example: foreach ($result as $myValue) { $loopCount = ($loopCount<5) ? $loopCount : 0; …

Member Avatar for mbarandao
0
147
Member Avatar for Borzoi

I cannot test right now, but try: return 301 ^(.*)$ $1.php Note that `try_files` is important because it will check if the script exists and will avoid some security issues, for example if somebody uploads a text file `hell.txt` and submit a request like this: GET http://localhost/uploads/hell.txt/o.php If `o.php` does …

Member Avatar for Borzoi
0
866
Member Avatar for vishalonne

Hi, have you considered the DateTime library? <?php #$dob = $_GET['dob']; $dob = '29-06-2009'; $at_day = '31-03-'.date('Y'); $dt_dob = new DateTime($dob); $dt_now = new DateTime($at_day); echo "<pre>"; print_r($dt_now->diff($dt_dob)); echo "</pre>"; Outputs: DateInterval Object ( [y] => 4 [m] => 9 [d] => 2 [h] => 0 [i] => 0 [s] …

Member Avatar for diafol
0
201
Member Avatar for mbarandao

The loops seem to be fine, the error means that `$array_two` is served as a string not as an array. Check if there is an intermediate step that resets the variable.

Member Avatar for mbarandao
0
2K
Member Avatar for davy_yg

Add the `readonly` attribute: <input type="text" size="50px" name="page" value="<?php echo $page; ?>" readonly /> But remember that a client can always change the input, so if you do NOT expect changes, because for example you do not enable the editing through javascript, then you must ignore this field when you …

Member Avatar for cereal
0
149
Member Avatar for grafic.web

Hi, use `dateadd()`: dateadd(hour, 1, candidat_rendezvous_date) * http://technet.microsoft.com/en-us/library/ms186819.aspx

Member Avatar for grafic.web
0
159
Member Avatar for ebanbury

Hi, try to remove the white spaces between the addresses in the destination variables `$to` and `$to2`, so these: $to = "email@gmail.com, ".$reg_email; $to2 = "email@gmail.com, admin@xxxxxxx.com"; Should be: $to = "email@gmail.com,".$reg_email; $to2 = "email@gmail.com,admin@xxxxxxx.com";

Member Avatar for ebanbury
0
252
Member Avatar for flevasgr

Hi, this is probably caused by the `mysqli_fetch_array()` at line **16**, it will move the internal pointer to the following row, so the loop will display only the last four items. To include the first one remove line 16, i.e.: $card_data_result = mysqli_fetch_array($card_data); Otherwise simply use the variable: echo $card_data_result['build_name']; …

Member Avatar for cereal
0
147
Member Avatar for Pravesh_1

I'm not sure I've understood your request. But if you open the above stylesheet you will see: @font-face { font-family: 'Patua One'; font-style: normal; font-weight: 400; src: local('Patua One'), local('PatuaOne-Regular'), url(http://themes.googleusercontent.com/static/fonts/patuaone/v4/yAXhog6uK3bd3OwBILv_SD8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); } You can paste the above in your stylesheet and remove the `link` to Google. Then if you …

Member Avatar for cereal
0
126
Member Avatar for davy_yg

Set the **name** attribute to the input field, otherwise the POST array will not receive it and the if statement will fail. This: <input type="submit" value="Login"> Must be: <input type="submit" name="submit" value="Login">

Member Avatar for davy_yg
0
294
Member Avatar for SPRINGHEEL

Remove the semicolon preceding **extension** otherwise the line is considered a comment and remove also the double quotes, so: extension=php_com_dotnet.dll

Member Avatar for SPRINGHEEL
0
564
Member Avatar for shahbaz13
Member Avatar for VIJAY_13
0
5K
Member Avatar for HoverportMedia

> Or is it destined to default down to Arial a majority of the time (provided the user doesn't have Helvetica Neue or Helvetica installed on their machines)? Correct. But you can include a font from a remote server, check for example at Google Fonts: http://www.google.com/fonts

Member Avatar for HoverportMedia
0
886
Member Avatar for nazree.zeko

Hi, show the query generated by your script, i.e.: print_r($qry); Then try to run the same query through a mysql client, from shell or by PHPMyAdmin. And add: $res = mysql_query($qry) or die(mysql_error()); To be sure it runs fine.

Member Avatar for cereal
0
214
Member Avatar for sathish_nadu

Change it to: SET @date_start = DATE_FORMAT(STR_TO_DATE(@from_date,'%d/%m/%Y'), '%Y-%m-%d'); Full example: > SET @from_date = '29/11/2010'; SET @date_start = DATE_FORMAT(STR_TO_DATE(@from_date, '%d/%m/%Y'), '%Y-%m-%d'); show warnings; select @date_start; Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Empty set (0.00 sec) +-------------+ | @date_start | +-------------+ | 2010-11-29 …

Member Avatar for cereal
0
222
Member Avatar for joshl_1995

The problem is the scope of the function not the `include()`, a function will not consider an external variable unless this is global and you define it inside the function, for example: <?php include 'conn.php'; function q() { global $conn; $stmt = $conn->query("select * from users limit 1"); return $stmt->fetch(PDO::FETCH_ASSOC); …

Member Avatar for cereal
0
290
Member Avatar for squeak24
Member Avatar for squeak24
0
261
Member Avatar for toxicandy

Try with [`imagettfbbox()`](http://php.net/manual/en/function.imagettfbbox.php) as suggested in this comment: * http://php.net/imagettftext#83248 Also, consider to use `mb_strtolower()` and `mb_convert_case()` instead of `strtolower()` and `ucwords()` because the latters will not work correctly with special characters. In your case just use: $name = mb_convert_case($Name, MB_CASE_TITLE, "UTF-8"); Reference: http://php.net/mb_convert_case Bye!

Member Avatar for cereal
0
4K
Member Avatar for ashafaaiz
Member Avatar for agent21
0
668
Member Avatar for game4tress

Hi, It should not depend on CodeIgniter, this can relate to the system in which PHP is executed: in the case is not synchronized. Have you tried to display the date time from a CodeIgniter view? If you can, compare it with a simple script, for example: echo date('d-m-Y H:i:s'); …

Member Avatar for Tpojka
0
301
Member Avatar for davy_yg

You can use the **Open Graph protocol**: * http://ogp.me/ For example: <html prefix="og: http://ogp.me/ns#"> <head> ... <meta property="og:title" content="Title of this page" /> <meta property="od:description" content="Once upon a time..." />

Member Avatar for davy_yg
0
499
Member Avatar for fheppell

You're starting the class in `$chimp`, not in `$MailChimp`, so change this: $chimp = $MailChimp->call('lists/subscribe' To: $result = $chimp->call('lists/subscribe'

Member Avatar for cereal
0
248
Member Avatar for branding4you

You can use `attributes()`, for example: <?php $file = simplexml_load_file("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"); foreach($file as $key => $value) { echo "Time: ". $value->Cube->attributes()->time . "<br /><br />"; foreach($value->Cube->Cube as $key_1 => $value_1) { echo "Currency: ". $value_1->attributes()->currency . " Rate:". $value_1->attributes()->rate ."<br />"; } }

Member Avatar for branding4you
0
335
Member Avatar for Priti_P

Add the fourth parameter and it will cut the word: wordwrap($string, "80", "<br>", true); * http://php.net/wordwrap

Member Avatar for Priti_P
0
143
Member Avatar for nageshwar.ch

Mine is more an idea than a solution: you will probably need the position (in coordinates) inside the state, in order to evaluate the nearest border. For example, in MySQL, having the coordinates of each city, you can query and get the result for the cities in a defined range, …

Member Avatar for cereal
0
492
Member Avatar for diafol

Hi! It seems to work fine form me, but this: $stmt->$mysqli->bind_param("s", $dbname); $stmt->$mysqli->execute(); should be: $stmt->bind_param("s", $dbname); $stmt->execute(); My example: $stmt = $mysqli->prepare("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ?"); $stmt->bind_param("s", $dbname); $stmt->execute(); print_r($stmt); $result = $stmt->get_result(); while($r = $result->fetch_array(MYSQLI_BOTH)) { echo $r[0]; } And outputs: mysqli_stmt Object ( [affected_rows] …

Member Avatar for diafol
2
293
Member Avatar for RikTelner

Use a **foreach** loop to get the keys and the values: foreach($array as $key => $value) { echo "$key has variable $value"; } You can also use `array_keys()` and `array_values()`, for example: $akeys = array_keys($array); $avalues = array_values($array); for($i = 0; $i < count($array); $i++) { echo "{$akeys[$i]} has variable …

Member Avatar for RikTelner
0
238
Member Avatar for jazleeen

Hi, Your script is almost correct but the `session_start()` must be in the first line of the script. So, if for example you're doing everything in the same script, you can write it like this: <?php session_start(); $_SESSION['error'] = null; if (empty($_POST['emailid'])) { $emailid = "Please enter your email id"; …

Member Avatar for cereal
0
288
Member Avatar for accra

The pattern in the preg match is missing the dash `-`, it should be `[a-zA-Z0-9_-]`, so change the first to: '/(https|http):\/\/(.*?)\/([a-zA-Z0-9_-]{11})/i' And the second to: '/(https|http):\/\/(.*?)\/(embed\/|watch\?v=|(.*?)&v=|v\/|e\/|.+\/|watch.*v=|)([a-zA-Z0-9_-]{11})/i' Because in case of links as `$yt_url = "http://youtu.be/--9oAhOSwpg";` it will not work.

Member Avatar for OsaMasw
0
265
Member Avatar for ebanbury
Member Avatar for haymen.roth.3

This: CASE WHEN minpart=0 THEN CAST(hourpart as nvarchar(200))+':00' ELSE CAST((hourpart-1) as nvarchar(200))+':'+ CAST(minpart as nvarchar(200))END as 'total time' is a statement, like `if-then-else`: * http://technet.microsoft.com/en-us/library/ms181765.aspx if the **minpart** (stands for minute) column value is `0` then **total time** will be `hourpart:00`, if instead the **minpart** is not zero, then the …

Member Avatar for cereal
0
297
Member Avatar for ignnniter

**@matrixdevuk** be careful with this solution, because `strstr()` will check only for the first occurence of the searched pattern, so if I submit something like this: mydomain.net@evil.org it will pass this check. Docs: http://php.net/strstr

Member Avatar for Tpojka
0
5K
Member Avatar for spowel4

Have you defined the variable in the method of the controller? For example: public function getPage($guid) { $data['guid'] = $guid; return View::make('page.form', $data); }

Member Avatar for spowel4
0
5K
Member Avatar for RikTelner

Hi, you can do it on your own, read this: * http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html It explains all the steps to create your own certificates and CA.

Member Avatar for JorgeM
0
92
Member Avatar for shakti_1

In MySQL you can use a *fulltext search*. Create an index with `skill` column: alter table skills add fulltext skillindx(skill); then you can use queries like this: select * from skills where match(skill) against('mysql'); There are some limitations that can be bypassed if you properly configure the database server. The …

Member Avatar for pritaeas
0
105
Member Avatar for jacob21

I did not tested with Gmail but check the Mailparse library: * http://www.php.net/manual/en/book.mailparse.php

Member Avatar for cereal
0
286
Member Avatar for SevenKader

If these titles are in database table then you could run an update query to remove them, for example if you have a table like this: CREATE TABLE `lyrics` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=myisam DEFAULT CHARSET=utf8; insert into lyrics …

Member Avatar for cereal
0
168

The End.