Jump to content

Andrew R

Members
  • Posts

    158
  • Joined

  • Last visited

    Never

Everything posted by Andrew R

  1. Thanks a million I have tried using the php cPanel API - http://www.phpclasses.org/browse/package/3534.html I entered in my cPanel user details and the results displayed are all zero, for example Disk Space Used: 0 MB MySQL Space Used: 0 MB etc. The script is obviously connecting to my cPanel, just not displaying the results because when I change my password, username, host details connection errors come up. Anybody used the php cPanel API before?
  2. Sorry if this is wrong forum I wonder if it was possible to take the account summary information from cpanel and display it on separate page via php. For example a client site separate from cpanel. I know you can access the cpanel xml account summmary via http://cpanel-link-here/xml-api/accountsummary&user=sam but I was wondering if it were possible to take this xml data and display it on another page via php considering the directory is password protected. The directory is pasword protected. I wonder if it would be possible to run a cron job and take the xml and update a SQL database every 12 hours? Is there any scripts that would do this or has anybody had experience doing this before? Thanks a million
  3. Thanks for the reply I would like a Javascript variable with the 4 option values from the form in it. I have to pass the variable onto a php file. Hope this makes sense. Cheers
  4. Hi there I was wondering how I could get the following form array ( option[] ) into 1 JavaScript variable? <input name="option[]" type="checkbox" id="option[]" value="Hosting"/> <input name="option[]" type="checkbox" id="option[]" value="Support"/> <input name="option[]" type="checkbox" id="option[]" value="Training"/> <input name="option[]" type="checkbox" id="option[]" value="Design"/> Many thanks
  5. I have the following query… How would I reuse/repeat the above loop so I could use it on different parts of my pages, instead of having to write a new query for every one? Would I use mysql_data_seek somewhere in the script above? Thanks
  6. How would I output specific fields inside each foreach statement? For example if I wanted output duration. Would I create another array for that?
  7. Thanks for a million for the help . One thing when I try to output anything I get ArrayArray...... etc? Any ideas?
  8. Hi there I have a table called routes. In this table I have a column called days which is in the format, MON-TUES-WED-THU-FRI-SAT-SUN. In my html I have 7 html boxes for the results to go into. The query I am using to search the table is SELECT * FROM routes where departure = '$a' && arrival = '$b' What I want to do is sort the results into the correct box. For example all the Mon routes would go into the Monday html box. How would I go about doing this? Would I create a number of arrays? I guess an inefficient way would be to create 7 queries but surely there’s a more dynamic way? Many thanks
  9. Sorry for the obscure title. I've got a database that has a column name frequency. The format of the frequency column is MTWTFSS (Monday, Tuesday, Wednesday etc). What I want to do is to display results based on the current date. The hard bit is the database contains all different variations for example, MTWT---, --W---- etc. $date = date("d"); SELECT * FROM freq WHERE frequency = '$date' Obviously the above won't work because of the format of the frequency column. Any help or advice on this would be much appreciated. Thanks
  10. Thanks a million. I couldn't get "\n" to take a new line for some reason so I added in <br> Thanks
  11. Probably a really easy one. In a database I have the following: How in php would I take a new line after the * (asterix)? What function would I use? Many thanks
  12. I am using the following code in my index.php to paginate my site…. if (!isset($_GET["page"])) { header("Location: ?page=home"); } else { $include = "$_GET .php"; } The variable $include is then placed somewhere else in index.php to include home.php or whatever $_GET["page"] equals (contact.php, users.php etc). Further on in the index script I have the user area protection script. (Below) if ($_GET["page"] == 'users') { USER SCRIPT HERE, VAILDATES THE USER, CHECKS IF THEY ARE LOGGED IN ETC } The problem I am having is there's nothing to stop somebody typing in users.php and having access to the users area, bypassing the index.php file which includes the validation for the users area. How could I protect users.php to stop people from doing this? Many thanks
  13. Thanks Although what if I had this? $message = " Name: $name Email: $age Age: if (empty($age)) { echo “No age submitted”; } else { $age ";
  14. Hi there. How would I put if/else statements inside an php mail. For example how would I put the following inside the message variable? – if (empty($age)) { echo “No age submitted”; } $to = "$addy"; $subject ="Title"; $message = " "; $headers = "From: $forname <$email>"; mail($to, $subject, $message, $headers); Thank you
  15. Hi there, I have following form fields. All the fields contain the same name, activity. How would I post all these fields and then display them/email them? I understand you do something like activity[] put I am not sure how you process them once posted? Any help would be much appreciated. Thanks
  16. Can anybody tell me why the 'bottom_right' div tag is not slotting into the layout as shown in the screenshot below... CSS .left_side { background-image: url(images/left_side.png); float: left; height: 679px; width: 86px; } .right_side { background-image: url(images/right_side.png); background-repeat: repeat-y; float: right; height: 679px; width: 87px; clear: right; } .bottom_bottom { background-image: url(images/bottom.png); height: 81px; width: 581px; float: left; clear: none; } .bottom_left { background-image: url(images/bottom_left.png); background-repeat: repeat; height: 184px; width: 206px; float: left; clear: both; } .left_image { background-image: url(images/left_image.jpg); background-repeat: no-repeat; height: 454px; width: 327px; } .bottom { height: 93px; width: 580px; float: left; background-color: #EEEEEE; border-bottom-width: 10px; border-bottom-style: solid; border-bottom-color: #FFFFFF; clear: none; } .bottom_right { background-image: url(images/bottom_right.png); background-repeat: no-repeat; height: 184px; width: 214px; float: right; } .overall { width: 1000px; } .centre { background-color: #FFFFFF; float: left; padding-right: 10px; padding-left: 10px; clear: none; } .top_grad { background-image: url(images/top_grad.jpg); background-repeat: repeat-x; height: 59px; width: 807px; } .logo { background-image: url(images/top_image.jpg); background-repeat: no-repeat; height: 166px; width: 807px; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #0066CC; } DIV tags <div class="overall"> <div class="left_side"></div> <div class="right_side"></div> <div class="centre"> <div class="logo"></div> <div class="top_grad"></div> <div class="left_image"></div> </div> <div class="bottom_left"></div> <div class="bottom"></div> <div class="bottom_bottom"></div> <div class="bottom_right"></div> </div> I have been trying for hours to get this working with no luck. Any help would be much appreciated Thanks
  17. When I try I get this error: Warning: mysql_pconnect() [function.mysql-pconnect]: Host 'sitenamehere' is not allowed to connect to this MySQL server in /linktofile/ on line 50
  18. Is it possible to connect to another phpMyAdmin database running on another server to the one that the script is on?
  19. Does anybody know any scripts or functions that would allow me to create a folder on my web space in php. Is there a php function that allows you to create a folder? Any help would be much appreciated Thanks
  20. Thanks very much The thing is I only need to remove the very last comma. So basically I want to select everything before the very last comma. Thanks
  21. Thanks Tryed this, doesn't seem to work though: <?php $total = "-5.717979 54.728432,-5.672246 54.757900,-5.621388 54.786976,-5.564545 54.816902,-5.502621 54.848289,-5.436880 54.881577,-5.370000 54.915535,-5.302828 54.949612,-5.234945 54.984013,-5.166701 55.018578,"; $result = explode("$total,", $total); echo $result[0]; php?> It should select all values excluding the last comma?
  22. Sorry for the badly described topic, don't know how else to explain it For example. If had the following coordinates in the database: -5.717979 54.728432,-5.672246 54.757900,-5.621388 54.786976, If I then echo them how would I remove the , (comma) at the end? As I will echoing multiple coordinates from the database, some longer than others I can't simply remove the comma after a certin about numbers. Any help would be appreciated. Cheers
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.