I am in the design stages of a new project which will take a data set and load it into a document, then render the document around a template. The rendered file could be a data set of CSV, a PDF marketing letter, an email, ... a lot of things. The data will not be math equations, I'm simply looking at an elegant way of connecting many da...
I need to loop through an array of data and print an 'incrementing' letter for each array value. I know I can do this:
$array = array(11, 33, 44, 98, 1, 3, 2, 9, 66, 21, 45); // array to loop through
$letters = array('a', 'b', 'c', ...); // array of letters to access
$i = 0;
foreach($array as $value) {
echo $letters[$i++] . " - $val...
All,
I make a JSON request to a web server using PHP and it returns me a JSON response in a variable. The JSON response will have lots of keys and values. The JSON response I get from the server has special characters in it. So, I use the following statement to convert it to UTF8,decode the JSON and use it as an array to display to the ...
$result = $mysql->callSP('STOREDPE1',$in);
$arr_tmp=array();
foreach ($result['record'] as $rows) {
echo "one value";
if(!empty($rows)){
echo "Two Value";
$arr_tmp[$rows['field1']] = $rows['field2'];
}
}
return $arr_tmp;
when i say var_dump($result)it has two values i...
I am running PHP5 on a free web server and I am trying to learn PHP reading a "for dummies" book...It gives me some code to run and for some infuriating reason I get errors on every line that echos HTML.
here is the code. specifics have been Xed out but they are accurate:
<?php
/* Program: mysql_up.php
* Desc: Connects to MySQL Server ...
I need to have a form execute two scripts so that means two different actions from the same form. I've tried some javascripts that use form.submit() from an onClick action on a submit button. But one of the two actions is an ASPX script that goes to Dynamics CRM. Any suggestions?
...
Hi, this has been asked before on WP forums, but none of the solutions worked for me, I've reset the permalinks, etc. to no avail. I hope you guys have the answer. This is my setup:
I have a custom post type called ted_venue, and two templates, single-ted_venue.php (single venue details) and page-venues.php (for displaying a list of ven...
I have a project that uses Zend Framework and Zend_Translate.
I had to alter the standard CSV Adapter to Zend_Translate slightly. Now I'm confronted with the question where to put this altered adapter.
By default, adapters are stored in
/Library/Zend/Translate/Adapter/Adaptername.php
This is where I've put the new adapter as well.
...
CCK is gone from Drupal7 and was replaced with the Fields API which is now part of core, but nodereference and userreference were not ported. This creates a problem for me because I use those 2 modules extensively.
There's an effort to work something out to replace these 2 modules with something more compatible with drupal7, but the so...
I'm using the content profile module. When a user is on their view profile page and press edit, they expect the profile edit page to show, not account settings as it is now. The path to content profile edit page is 'user/%/edit/uprofile'. Does anyone know how to set the 'user/%/edit/uprofile' to default tab for 'user/%/edit'?
...
Hi ,
how check if $_GET is empty ?
...
Hi everyone!
Sorry if this is a simple question, is it possible to load codeigniter without a db setup?
I have sess_use_db set to false in the config, I tried renaming database.php to something else but it still wants to load it, I turned active records off also.
I tried commenting everything out in the database.php and it said no da...
I'm trying to test the validity of a url entered with php5. I thought of using regex, but assuming that it works correctly all the time, it only solves the problem of the url being syntactically valid. It doesn't tell me anything about the url being correct or working.
I'm trying to find another solution to do both if possible. Or is i...
I've been scouring the Net for hours looking for a solution with with only partial and non-functioning solutions to show for my efforts.
The solution below seemed like a great fix at first but it also blocks my flash player from accessing the files. Could I only allow access from particular pages?:
< Files ~ "...">
order allow,deny
den...
Hello,
There's a form called discussion.php, in which a user will fill out his/her question/discussion and post it to savedisc.php. Some of the savedisc.php looks like this:
$message = $_POST['message'];
$title = $_POST['title'];
$represents = $_POST['represents'];
//connect to database
//save the content of discussion/question into ...
How can I select the string contents of the following nodes:
<span class="url">
word
<b class=" ">test</b>
</span>
<span class="url">
word
<b class=" ">test2</b>
more words
</span>
I have tried a few things
//span/text()
Doesn't get the bold tag
//span/string(.)
is invalid
string(//span)
only selects 1 node
I am using ...
I'm trying to display images in the reverse order of when they were last modified. Unfortunately, get_headers() seems to only work for urls, and both stat['mtime'] and filemtime() fail for me. Are there any other ways for me to get the last modified info for a file? Here's my code at the moment:
if (isset($_GET['start']) && "true" ==...
The problem
I want to delete a file with AJAX/PHP.
But the php says that the file name what I send with AJAX is not a file, but when I go directly to the link I can delete the files. Check out my current PHP, i've put in the IF/ELSE statement to check if the string is a file with: is_file, the result is false.
Without is_file says t...
Hello All
I am "attempting" to scrape a web page that has the following structures within the page:
<p class="row">
<span>stuff here</span>
<a href="http://www.host.tld/file.html">Descriptive Link Text</a>
<div>Link Description Here</div>
</p>
I am scraping the webpage using curl:
<?php
$handle = curl_init();
...
I have a PHP script that is using get_dns_record to retrieve and display specific DNS records for a domain, submitted via a form.
It's working really well, except that the section that handles MX records is a little unreliable. Sometimes no MX Records are displayed at all (on domains I know have them). If you refresh 2-3 times, someti...