basically i'd like to know if it's preferable to establish a database connection before each database query, and then use mysqli_close() immediately after the relevant section, for every spot in the layout where database information has to be pulled - or if it's better to just open the database connection at the start of the file, and th...
Hi, I have the following PHP object but I'm struggling to get the array item out of the object.
exampleBatch Object (
[file_path:protected] =>
[title:protected] =>
[description:protected] =>
[link:protected] =>
[items:protected] => Array ( )
[raw:protected] => data/example
[feed_nid:protected] =>
Array (
[0] => Array ( [path...
Hi there,
I have a simple PHP function on a friend server which I've checked and has PHP CURL enabled.
The function is:
function sw_fetch_code($apikey='',$email=''){
$url = "http://www.domain.com/xxx/api.php?getcode=1&apikey=".$apikey."&email=".$email."";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
c...
I have an in PHP 5.3 that is failing when something is its contents.
For context I do a XSL transformation on one DOMDocument and insert the results as a parameter into another DOMDocument that is then transformed. This has worked fine until now.
<h5>lets see: <xsl:value-of select="string-length($content)" /></h5>
returns 0.
$cont...
Hi all, How can write a regular expression to retrieve values from xml node.
Actually the node structure is very big so we can't traverse easly, so i want to read as normal text file and hop i can write a regx to findout the matching elements.
<node1>
<node2>str</node2>
<node3>Text</node3>
<myvalue>Here is the values string..</myvalu...
Hi,
I read this post after doing a search for related posts.
I have a slightly different, but related problem.
Is there a way WITHOUT EVAL() (because this is a bad idea - open for abuse if someone allows a user to supply the value that is used in eval, etc) such that you can define the structure of the class, for example:
if(!class_e...
Hey,
How do I get something in PHP/Curl to grab the IP of the URL for me? It's going to be a simple interface that fetches URL IP's back for me.
E.g. Enter "http://mysite.com" then I hit submit then I should get the IP of the mysite.com back.
Please show me how its done thanks.
...
I have a form where a user types paragraphs into a text area and then it takes them to another page after they submit. How can I pass whatever they typed to the page after they submit? The text area might have linebreaks and if I use a query string to pass the data, it gives me an error. This is my current code to pass the field:
<?php
...
I had php multi dimensional array
Array
(
[0] => Array
(
[WorkHrs] => 9826
[Focus_Date] => 2010-02-10
)
[1] => Array
(
[WorkHrs] => 9680
[Focus_Date] => 2010-02-11
)
)
and I want to convert it in Javascript to
myArray = [['2010-...
i am writing code of pagination & i got an error.
this is my code :
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("Admin") or die(mysql_error());
if (isset($_GET["page"]))
{
$page = $_GET["page"];
}
else
{
$page=1;
}
$start_from = ($page-1) * 2;
$sql = "SELECT * FROM events ORDER BY...
I am new to SOAP and have been trying to connect to Barnes and Noble SOAP API using the php5 built in soap functions.
http://www.php.net/manual/en/class.soapclient.php
My question is, does anyone have any documentation or experience using Barnes and Noble system? I have been going back and forth with the support person and I feel like ...
Can anybody tell me how we can delete browser cache using javascript. I want this because I am giving user, file for download with url ('http://www.example.com/docs/doc1.xlsx'). and this files are accessible for that specific user only.
I am checking with htaccess redirect to other action which redirect to that specific file url if user...
After working with a lot of GD recently (for some fairly large scale projects for work) I had been dealing with RGB codes that I am not so accustomed to.
My co-workers and I had been suffering some what to find a good method to do this without resorting to a makeshift 'hex to rgb' function with arrays for just a simple function.
There...
Hi Everyone,
I'm having a tough time with this one, I have a class which populates an array.
Sometimes the array will not be populated and I want make an edge-case for when this happens however I can't seem to tell when its null! Here's the code:
$results_dev = $class->get_data_nologin("4a9d-4f41-9566-7705",$key,"Sensors");
echo ...
Hi all,
I'm writing myself a script which basically lets me send a load of data in a single get request. I'm using base64 to encode it, but its pretty damn long and I'm concerned the URL may get too big.
Does anyone know an alternative, shorter method of doing this? It needs to be decodable when received in a get request, so md5/sha1 a...
Hi! You might have seen that MailChimp has new features to GeoTag users (mark their location) and send a newsletter to all users within 0-50 miles of a fixed point. Their system knows where users are located (via reverse IP lookup), and you can send a newsletter to all people within 50 miles of Downtown Los Angles (for example).
I'm int...
I have a Magento shop and we use Barclaycard ePDQ as our payment method. I recently created a new cart rule that gives you 10% off discount when using a coupon code. Everything goes well with Magento - the coupon applies - but after I press Checkout and it takes me to the Barclaycard ePDQ page, I notice that the total amount to pay is ac...
Hi All,
i have been looking for ages for a regular expression which will return all page titles. unfortuantley some have newline tags in them and other wiered stuff which is preventing me from finding a result.
here are some of the regex's i have tried
"/\<title.*\>(.+)\<\/title\>/"
"#\<title.*\>(.+)\<\/title\>#s"
but none of th...
Hallo All,
I would like to have the table content to go to the same position that it had before the page is refreshed rather than go to the top of the table content. In other words, if the user scrolls down, and a button triggers a page reload, I want table content to come back to the same position after the refresh.
CSS used for my t...
I have a date where I need to add months to, but somehow it returns the epoch date
$duration = 28;
$row['end_date'] = '2010-09-22 0000:00:00';
$newEndDate = date("Y-m-d", strtotime(" +".$duration." month",substr($row['end_date'],0,10)));
I have no idea what I'm doing wrong?
...