So I have the following line...
<?=$variable?>
Is there a way to change it to long tags without typing a full echo statement?
<?php=$variable?> doesn't work
I know that <?php echo $variable ?> will work, but is there a shorter way to do it?
...
I wrote this function to get a subset of an array. Does php have a built in function for this. I can't find one in the docs. Seems like a waste if I'm reinventing the wheel.
function array_subset($array, $keys) {
$result = array();
foreach($keys as $key){
$result[$key] = $array[$key];
}
return $result;
}
...
dear all.
i have a form that consist of two textfield and one combobox.
i want prevent the duplicate entry data from client side.
i get combobox data from DB, like:
<select id="line" name="faline" >
<?php
$sql="SELECT `Line_Name` FROM `prod_sch` WHERE `Line_Name` LIKE 'FA %' GROUP BY `Line_Name` ORDER BY `Line_Name`";
if ($sql) {
...
Hi All,
This should be simple but I cannot figure it out. I have this very simple mod_rewrite rule and it just doesn't want to work. This is the entire contents of the .htaccess file.
RewriteEngine On
RewriteRule ^([A-Za-z0-9-_/\.]+)/?$ index.php?page=$1 [L]
If I call the URL domain.com/foo it should rewrite it to index.php?page=foo....
Title says it all. I'm working on a mortgage application and we're supposed to use the FNM 3.2 file format but I can't find much in the way of applicable resources.
Hoping someone in the community has some experience.
...
Given a Controller class and a View class, is it better for the controller to directly assign values to view properties or, is it better to assign values to properties in the controller and then copy those properties to the view when ready to display it?
Example Model Class
class Model
{
public $propertyA;
public $propertyB;
}
Ex...
wordpress , plugins : hi , I want to create website by wordpress but I want to make speacial plugins .. and I made it but there are problem .. _
I have a website and I using it with wiki for contries in the world ..
I want from the plugins 'when the visitor open the page for example 'United State' , I want from the plugins to search ab...
Is there have some opensource dating site like plentyoffish.com?
only PHP, Ruby, Java or .Net source is OK.
...
Hi, so my code works fine by itself, but I'm trying to add some ajax into it. I'm using CI, to do some of the lifting. I don't understand why it's giving a 404 if the code works fine without ajax.
Here is the form:
<div class="divider" id="contact">
<p class = "header"><a id="contactheader" name="gocontact">Contact</a></p>
<...
I had the list of items. When the user clicks a item, a div is generated with a textbox <input type="text" name="(DYNAMICALLY ASSIGNED VALUE)" />
So user can select multiple items. For each item a textbox is generated dynamically inside the form. When the user clicks the submit button, i want to fetch the GET/POSTED elements. How can we...
I am setting out to do a side project that has the goal of translating code from one programming language to another. The languages I am starting with are PHP and Python (Python to PHP should be easier to start with), but ideally I would be able to add other languages with (relative) ease. The plan is:
This is geared towards web develo...
hi, i have a php project which has a configuration file config.php that stores config information like database info, directories, etc.
normally we would include this config file at the top of every php page like require_once(".../config.php); however, i have found a way to do this by creating a .htaccess file and include this:
php_va...
Possible Duplicates:
using mysql_close()
close mysql connection important?
What are the benefits of closing the connection using mysql_close() as the last line of your script compared to letting php close it for you?
...
This is stumping me.. I am writing components / library functions where it would be used for calling a lot of different functions, so I want it to make an array print out each variable to be passed into the function as an argument, like below but I am pretty sure that this isn't proper syntax.. thanks for any advice
$myfunction = functi...
I have the following site structure
Parent Site
-> blog (wordpress)
-> get-recent-posts.php
-> index.php
I want to display a list of recent posts in the index.php. I am trying to use wordpress api functions in index.php but it is not working. If i try to directly run get-recent-posts.php it shows the posts but if i include it in in...
I have a data like
93 i want if to become 90
95 i want to become 100
How can I do that in PHP?
Thanks!
...
Hi All,
So I'm using Wordpress' database object to store things into tables. One of the drawbacks (or advantages, depending on how you look at it) is that it escapes the single and double quote characters so that:
' --> \'
" ---> \"
What regex can I apply to the output to replace all \' with ' and \" with "?
...
I have this PHP file:
<?php
header('Content-type: text/xml; charset=UTF-8');
?><?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
I would expect it to return a Content-type:text/xml header.
What i...
I am new to web development and am used to extensive use of various data structures in getting things done. I've also heard that having lots of queries is worse than few queries (but that complex queries can be even slower).
I'm wondering whether lots of simple queries would perform better or worse than one complex query that is later p...
Hello, I'm trying to send an e-mail with ZendMail ( this simple script sums it up )
<?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$mail->setBodyText('My Nice Test Text');
$mail->setBodyHtml('My Nice Test Text');
$mail->setFrom('[email protected]', 'Mr Example');
$mail->addTo('[email protected]', 'Mr Test');
$mail->setSub...