You can start with this:
http://www.victorchen.info/accessing-php-class-variables-and-functions/
Here is an example:
<?PHP
/*
Demo of sorting (associative) arrays
This version uses all 4 fields as a sort key and it uses
a Function to convert rows to columns
*/
// ====== The Setup =========================================================================
// Note: You can put the include routine anywhere you want.
// I use a global library in the root directory so I can find it
// from any application.
$path_global = $_SERVER['DOCUMENT_ROOT']."/_include_global";
include $path_global."/array_rows_to_columns.php";
$test = array();
// Note: key1, key2, key3 ... could just as well be an index number ( 0 - n).
// It doesn't matter.
$test['key1']['last_name'] = "Smith";
$test['key1']['first_name'] = "John";
$test['key1']['address'] = "123 Main";
$test['key1']['phone'] = "905-123-1111";
$test['key2']['last_name'] = "Smith";
$test['key2']['first_name'] = "Al";
$test['key2']['address'] = "555 Main";
$test['key2']['phone'] = "905-123-1111";
$test['key2a']['last_name'] = "Smith"; // same name as prev but with a different address and phone
$test['key2a']['first_name'] = "Al";
$test['key2a']['address'] = "111 Main";
$test['key2a']['phone'] = "905-123-1999";
$test['key3']['last_name'] = "Brown";
$test['key3']['first_name'] = "Bob";
$test['key3']['address'] = "234 Main";
$test['key3']['phone'] = "905-123-2222";
$test['key4']['last_name'] = "Jones";
$test['key4']['first_name'] = "Mary";
$test['key4']['address'] = "456 Main";
$test['key4']['phone'] = "905-123-3333";
$test['key5']['last_name'] = "Green";
$test['key5']['first_name'] = "Harry";
$test['key5']['address'] = "666 Main";
$test['key5']['phone'] = "905-123-4444";
$test['key6']['last_name'] = "Brown";
$test['key6']['first_name'] = "Maury";
$test['key6']['address'] = "234 Main";
$test['key6']['phone'] = "905-123-2222";
// ======== Now we can sort ================================================================
array_rows_to_columns ($test,"last_name","first_name","address","phone");
// this creates arrays called sort_field1, sort_field2...
// The working arrays are used in the multisort followed by the original array
$result = array_multisort($sort_field1,$sort_field2,$sort_field3,$sort_field4,$test); // the original array is included last
if ($result == false) {
echo "<br><b>Sort Error </b>";
} …
Your question isn't very clear. An answer could be as simple as:
$mth++;
What you need is probably more complicated but your question needs to be more specific (maybe with some code that you tried that didn't work).
There isn't one solution for all of the file types. What type of file do you want to upload?
I think that what you need is something to sort a 2 dimensional array. I don't think that the standard sort functions do that. I had the same need a couple of years ago so I read the documentation and came up with a function that does the job. It basically sets up the data for array_multisort. It handles up to 6 sort fields.
Function array_rows_to_columns (&$array_name, $field1="", $field2="", $field3="", $field4="", $field5="", $field6="") {
// this changes the rows to columns (ie as separate arrays) so that multisort can sort them
// This can be used when you have a multi-dimentsion array of the form:
// $test_array[key][field1], $test_array[key][field2] etc
// when you want to be able to do a multisort on field1, field2 and so forth.
// This can handle up to 6 fields that are to become new arrays and sort fields.
// When these are sorted, the association between the fields is retained even though they are
// in separate arrays.
/*
Example use:
array_rows_to_columns ($test,"last_name","first_name","address","phone");
$result = array_multisort($sort_field1,$sort_field2,$sort_field3,$sort_field4,$test);
where: $test is the original array
last_name, first_name etc are field names to sort by
It sorts the original array so you can access the results there.
You must use "foreach .. " to extract the data - see the examples
*/
global $sort_field1, $sort_field2, $sort_field3, $sort_field4, $sort_field5, $sort_field6;
// --- redefine the sort arrays to get rid of any previous content ---
$sort_field1 = array();
$sort_field2 = array();
$sort_field3 = array();
$sort_field4 = array();
$sort_field5 = array();
$sort_field6 …
Your If statements should be in the form:
if(isset($id) && $id == benelli){
Notice the == to test for equality. A single = in an IF will act the same as a statement like $a = $b;
You need a program that will do a PHP error check for you. There are many of them, Netbeans is one example.
When you get a blank screen it usually means that you have a PHP error (assuming the program is supposed to display something). In this case, when you error check it, you find that there is an error on Line 44. That is because you are using IF and ELSE without curly brackets. You can only put one statement between an IF and an ELSE if you don't use curly brackets. I think that it also makes the code harder to follow when you don't use the brackets.
It sounds as if you need to do some screen-scraping. See this previous post for some references.
If you have variables containing these values, then you need to include some hidden input variables (<input type=hidden ...) in your form and set the values to the variables with the email and userid. Your backend update will need to include these variables in the mysql insert.
Looking at your code, I would expect that it would put the last $ipath that you read in the while loop into the text field. The user chooses a link from the list to put the image into the iframe but you don't have the same dynamic action happening for the path.
if you are a computer science student then you need to learn to do research. The internet and sites like this make it so easy. If you do a Google search or search this site, you will find some pertinent references. This is a bit old but it sounds like the same question from a few years back.
http://www.daniweb.com/forums/thread33423.html
Once you do the initial work, if you run into a problem, then you can probably find someone here to help you.
HTML2PDF can do that. You may have to tweek your html a bit but it's a lot easier than adding custom pdf commands.
More Info Here:
http://innovationsdesign.net/wb_2.7/pages/tech-resources/downloads/html2pdf.php
I take it back. You can create html that will generate a header and footer in Word but it takes quite a bit of html code. If you want to see what is needed, create a small Word file that includes a header and footer then do a Save As as a web page. If you open the generated html page in Word, you will see that it still has the header and footer. If you look at the html you will see what it takes.
Creating a Word file isn't difficult but I don't think that you will be able to create a header and footer. To create the file try this:
http://innovationsdesign.net/wb_2.7/pages/tech-resources/downloads/desktop_write.php
The easiest starting point is to echo your select statement, copy it and try it in PHPMyAdmin. You may find that it needs a change and you can experiment in PHPMyAdmin then make the appropriate changes in your program.
You may have a cooling problem. When you run on the battery, it is no-doubt running on a lower power setting. You could try changing your power settings to run much leaner when on AC power. Then you can see if it still shuts down on AC. Obviously, cleaning the fan would be a good idea. You might want to get this fan utility:
http://www.diefer.de/i8kfan/
The site isn't working. Nothing to do with you.
You can put an IF ahead of the Function statement. You just need a parm somewhere to drive the IF. I don't think however; that will give you what you want. If you leave the calls to the Function in your code and it isn't defined, you'll get an error.
I have done something similar to what you want to do with my own debug routines. I leave the debug statements in the code and turn debugging off or on at the start of the module. At the start of each debug function, it checks the global parm to see if debugging is turned on. If not, it exits immediately. I think you need to do the same thing.
You don't have a loop so it makes sense that it would only execute once when $dice is equal to 6. If your intent is to keep generating random values and showing what was rolled, you need a While loop and you will need to change your code to put any one-time actions (like the mysqli) before you start the loop.
You don't provide much info so all we can do is speculate. You should echo your insert statements. For the one that is getting an error, check the key against what is already in the table and you will probably find that there is already a record with that key in the table. How to handle it is up to you. How did the situation happen? Did you run the update process twice in a row or do you possibly have a duplicate in the input? If you find the record is already in the table, do you want to replace it, skip the insert and try the next one or give up? The decision is your's based on your needs.
It displayed exactly as you defined it. If you want the data in columns, then don't use a <tr><td> before every field, just use <td>. Every time you echo a <tr> you get a new line.
I'm not going to write the code for you but it seems pretty straightforward:
Open the input file (fopen)
Open an output file
Read a record (fgets)
compare specified user name with the record content
if it's equal
skip it
read the next record and skip that too
else
write the record to the output file
loop through the input file until EOF
Close the files
rename the input file
rename the output file to the original input file name
delete the original input file or move it to an archive
You're done
You need to do a bit of debugging. You need to know what the value of $_POST[action] is when it goes to the ELSE. You can echo the value so you'll know.
If this is a fragment of your code and if you have a form that drives this code (in this same module) and sets the POST values and if you execute the code that you've shown above every time (ie before your Post values are set), then you will go to the Else routine the very first time and get your error message.
And your question is?
Seems simple enough. If you keep track of the name of the latest file (in a database or a flat file), then you get that name and insert it as an <img statement into the appropriate place on your home page (assuming that it's in PHP or that you can make it a PHP module). You could use a standard file name in the home page if you always copied the latest file to a standard name (over-writing the previous one). The problem with that is if you have different file types (jpg, png etc) then it is no longer standard and it would only work if you converted the format (which of course increases the complexity of the solution).
If you want information, you can get a bunch of references from a Google search
(for example this one: http://www.videowhisper.com/?p=PHP+Video+Conference)
What you might get here if anyone has done it, is a recommendation on what works and / or what doesn't.
I don't understand your statement because the only look that the CMS has, independent of the website look provided by the template is what you see in the back-end admin facilites. Some CMS's even have separate templates for that. You seem to have focussed on Joomla and that's ok if you know that Joomla is what you need / prefer. I don't have the impression that you've done enough research to reach that point.
You're right that the standard templates tend to be variations on some standard format formulas. You can build your own template to be almost anything that you want it to be if you have the knowledge of the CMS interface requirement, PHP, CSS and so forth. If you look at some of the galleries of sites developed using various CMS's you'll find some very customized formats. The user interface won't change regardless of the template layout (at least for text and picture content). If you want to get into introducing a lot of javascript / ajax features, then it will depend on the support provided by the CMS and how integrated it is with the other CMS capabilities.
I believe that you can do almost anything within reason using a CMS if you are able and prepared to do some customization. You get a lot for free using a CMS but if you are a skeptic or if you really like to do things from scratch then it may not work for you.
If someone here doesn't have an answer, I suggest that you call the PayPal support people. The most obvious reason would be that the amount is wrong and you are trying to refund a total that is more than the amount of the original transaction but it probably isn't that simple.
Normally, with pure PHP you will re-display the whole page with information changed where appropriate. This would normally be as a result of the user clicking on a button or link on the page. If you want to re-display just a section of the page without refreshing the whole page and/or without any user intervention, then you probably need some javascript / Ajax.
Have a look at this post. I provided some references.
I don't understand your wish to keep using Dreamweaver and avoid using the CMS templates. All of the CMS's that I am familiar with have templates that provide the front-end look and the interface to the rest of the system. The free ones generally use some combination of php, html and css. You may want / need to make modifications or build you own templates from scratch and that might be the only place where Dreamweaver might fit.
I have built web sites for people who aren't very high tech. They have been able to maintain them on their own with minimal help from me. I looked at all the best known CMS's and decided to stick with Website Baker because I find that it is simpler and more straight-forward then the others (to implement and to maintain). I suggest that you look at it and compare it with Joomla, Drupal, Wordpress and the rest. Each system has it's fans who will claim that their CMS is the best. There is no definitive answer. Most CMS's have some sort of e-commerce plug-in. That might become a key distinguishing factor as you will need to match up your e-commerce need with what the various systems provide.
Setting up a secure email server to send and receive isn't something for an amateur. A quote:
"If you know absolutely nothing of internet protocols like pop, smtp, imap, etc. do not host your own mail server. A newbie server, if you can get it up and running will be completely insecure. their are millions of spam bots out there troll the internet looking for insecure smtp servers they can use to send their spam from. you could get into some big problems if your isp finds that you are sending spam from your computer. so, unless you know how to secure your mail server dont even think of installing one. and dont think if you read "email servers for dummies' you will know anything about email server security. that is up to experienced system admins."
If you just want to send mail or test the output from a send, then there are a number of ways to do that. It is a more complicated task to install a mail server for two way traffic (and make it secure).
You'll need to use javascript and I suggest using jQuery which makes it easy.Here is an example. You can search and find others if you don't like this one.
If you are using a web hosting service(a virtual server) then everything should be set up and it will work if you code it correctly. If you are running on your own local server using WAMP or EASYPhp or another similar test environment, then you won't have a mail server and isn't simple to get that working.
It's possible that it has been disabled. There are two other approaches that you can use to make a local change without making it global:
You may be able to use a local php.ini file in the same directory as the program doing the upload (I can do this on my virtual server).
You can use a .htaccess file:
php_value post_max_size 7M
php_value upload_max_filesize 7M
That has been working for me every time I've tried it over many months now. I bought another laptop so I don't use it often anymore but when I need it, that 'trick' gets it started. You are the first person I have heard from who go this to work for them. I suspect that it would work for others as well but you must shut it down completely between tries and be prepared to try it a few times.
If you want to dump an online (html) report to excel it's pretty easy. My little utility module is set up to save to various formats. You can see the details and do a download here. It won't be totally automated as you will need to click on a link for each report to create the files but we're talking about minutes versus hours.
OK, so your MySQL Select should be ordering by country and then town and you probably need some while loops to detect when the town changes and when the country changes. You will have to get beyond just echoing what is in the database and write some code to determine when a break occurs and do the appropriate thing. You need to write the code and if you have difficulty making it work, someone here may be willing to help you. If you're lucky, someone may have a code snippet that does something similar that they can give you. If you don't have the PHP / programming knowledge to do it, then you have a problem and you need to do some learning or you need to find someone with the skills who can do it for you.
sounds like a job for Ajax.
This isn't an easy question to answer. In some ways using one of the frameworks might make the designing easier but you do need to spend some time learning how to use the framework. I learned PHP about 7 years ago. Previously to that, I did a lot of programming on mainframes and PC's. I think the knowledge about how to structure a system in PHP came from:
1. Many years of building and modifying systems of all sizes on a variety of hardware and operating systems. This built basic knowledge of how to design systems.
2. Building a knowledge of what facilities PHP provides and how to use them through trial and error, reading the documentation, reading forum posts and so forth.
3. Looking at, installing and modifying a large number of open-source PHP systems.
4. Building some of my own systems and going through a learning process where I discovered better / more flexible ways to implement features as I gained more experience.
I don't think there is any silver bullet for this but once your PHP knowledge is adequate, looking at how some of the larger open-source PHP systems (e.g. CMS Systems) have been structured will provide some examples of how to build sophisticated systems using PHP (and MySQL). I keep learning and finding better ways to do things. It takes a long time until you get to Guru level and have done it all. Not too much is really new. Once …
Have a look at:
Dapper: dapper
http://www.screen-scraper.com/
class_http: http://www.troywolf.com/articles/php/class_http/
You should look at using a CMS that has most of the work done for you.
It may be instructive for others if you post a progress report now and then.
Building a serious CMS is a pretty major task. If you are doing it for fun and as a learning exercise and you have a lot of time available then go for it. If you are aiming to have something that you can actually use in a reasonable period of time,then you will want more than basic php skills and you'll probably want a team of people (because that's how the other CMS's are done). I have been using a CMS for myself and for clients for quite a while and I find only positives not a lot of con's. It has a lot of features that I wouldn't get around to building myself, I can customize a template to give it almost any look that I want, they release new features and facilities on a fairly regular basis and if there is a capability that it doesn't have, I can find another open source system and use a wrapper to integrate it (loosely) into the system. It makes the maintenance dead simple for straightforward stuff so I wouldn't even consider trying the build something better. If my requirements went beyond the capabilities of any CMS that I could find, I'd find the one I like the best and then build or improve the pieces that are missing or not adequate.
I wish you good luck.
if you make it a small form then just include a "<input type=hidden ... for the id.
If you read the whole page, you would see a number of other suggestions as well.