Jump to content

Ansego

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Ansego

  1. Please mark answered on one of the top two posts please.
  2. Hi, You could use cookies to keep the user logged in, you can see more descriptive information about cookies @ http://www.php.net/manual/en/function.setcookie.php Not sure what you mean by download a file every 24hrs? Are you downloading to client or to the server? What does this file contain and file type? If downloading to the user, the user needs to be connected to the webpage before anything will download.
  3. Um, not 100% sure on the question, sounds to me might be a DNS problem or web service that your using has not binded the subdomain. Also agree with Ch0cu3r in regards if they are all going to mydomain.com why not just make a wild card sub domain ( *.mydomain.com ).
  4. Might want to consider moving too 'mysqli' as the 'mysql' extension is deprecated as of PHP 5.5.0, read more...
  5. Normally when I see 'undefined index' I straight away look for isset(). Also remove; </form> <form id ="form1" action = "splitform.php" method="post"> No sense having two forms going to the same place and same collective data. Maybe let us know why your trying to split the form and we might have a better solution for you. As far as I can tell only reason to split a form is to have form steps, ie name / email : submit -> age / sport: submit -> Confirmation. (But seems pointless unless huge form)
  6. Thanks @Kicken for your quick and detailed reply, I've never used anything like 'composer' guess I should learn how to use it. (Tried to install it, but failed) Somewhat a novice with Object (OOP)... Example #1 Is this correct use of the code without the use of 'composer'? spl_autoload_register(function ($class) { include './inc/' . $class . '.inc'; }); $Object_name = spl_autoload_register(Class_name()) $Object_name->Methods_name($Paramater) == Boolean_Return; Example #2 OR do I just put this at top of every page: spl_autoload_register(function ($class) { include './inc/' . $class . '.inc'; }); Though how do I call my functions / methods? $class.METHOD_Name? Does this mean all my classes from the inc folder are loaded in that page? (Example #2)
  7. Thanks Jacques1 && trq, I am lost still, is my example above for the 'NEW WAY' correctly using SPL? @Jacquest1: You mentioned SPL can be used to register multiple functions unlike __AL, but are they both registering the class which has multiple functions/methods already? @trq: "I wouldn't bother creating your own autoloader" thought we had to create a autoloader to use the functions/methods from the class? @trq: 'composer' ?? did google and found: https://getcomposer.org/ @trq: Thought it was creating an object and from that object you use the functions/methods? are not all classes objects? Thanks guys ;-)
  8. Hi, I've just found that __autoload function is no longer the thing to use when creating an object from your class. Well thanks a lot!!! Now we have this spl_autoload_register AND spl_autoload. All the manuals I've read I am still lost... just a simple example would be great!!! THE OLD WAY function __autoload($classname) { $filename = "./inc/". $classname .".inc"; include_once($filename); } $Object_name = new Class_name(); $Object_name->Methods_name($Paramater) == Boolean_Return; QUESTION: WHATS THE NEW WAY??? spl_autoload_register(function ($class) { include './inc/' . $class . '.inc'; }); $Object_name = spl_autoload_register(Class_name()) $Object_name->Methods_name($Paramater) == Boolean_Return; Kind regards and thanks...
  9. Hi, First, please use Code Block for code in your posts. Little lost with the question... See if I can work it out. Your trying to get the name of the file FROM 'file_upload.php' TO 'compile.php' ??? I think the structure / process seems a little wrong... few ways you could do this: Use a (include) for 'file_upload.php' into the 'compile.php' or reverse. Run the form from one file to the next ie: Form.html -> file_upload.php -> compile.php. Put the code of the two files in one file and collect your variables that way. And I am sure there are many other ways. Hope this helps, or at least helps with the question. Good luck.
  10. Hi Mike2, I've not really used Swish, normally when I work with *.csv files I export the data to a MySQL database then use SQL to retrieve my data. And when I pull the records using SQL I use a SQL condition called LIMIT X Y (or) BETWEEN X Y. I'll have to pass you over to someone with more expertise with CSV. Think what your doing if I remember correctly is called 'Paging'. Re Ansego.
  11. Hi, Not to familiar with Swish, but research I have done found two prospects: SwishSearch::resetLimit — Reset the search limits SwishSearch::setLimit — Set the search limits Reference: http://www.php.net/manual/en/book.swish.php Hope this helps.
  12. You may want to add this to Job offering section: http://forums.phpfreaks.com/forum/77-job-offerings/
  13. um. have you done any code for it? This is two parts, login and edit page. Login will set a session and the edit page will check if that session has been set before it allows you to edit it, simple IF Statement. No one here will code it up for you, you will need to code it and if you get stuck as questions. You can also go to the hire part (job offerings) of this website and pay someone for the job. http://forums.phpfreaks.com/forum/77-job-offerings/ Hope this helps.
  14. @Ch0cu3r Your 100% right, I simply did not think of that I sometimes take the long winded way of doing things, my bad. I defiantly will remember this next time I am faced with similar problems in the future. Thanks heaps Ch0cu3r, appreciated. Short, sweet & effective code mate.
  15. Might need to change the SQL statement to be correct, Change the WHERE ID to WHERE serviceid. Same with Environmental part.
  16. Hi, Try this (CODE NOT TESTED) <?php include('dbcon.php'); ?> <form id="searchform" action="index.php" method="post"> <table> <tr> <td class="searchleftcol"><h3>Service:</h3></td> <td> <select id="service" name="service" class="searchoption"> <option value="">-- Select Service Name --</option> <?php if (isset($_POST['service'])) { $serviceID = $_POST['service']; $resultservice = mysqli_query($con,"Select * from services WHERE ID=$serviceID") ?> <?php while ($line = mysqli_fetch_array($resultservice)) { ?> <option value="<?php echo $line['serviceid']; ?>" selected="selected"> <?php echo $line['service'];?> </option> <?php } } ?> <?php $resultservice = mysqli_query($con,"Select * from services") ?> <?php while ($line = mysqli_fetch_array($resultservice)) { ?> <option value="<?php echo $line['serviceid']; ?>"> <?php echo $line['service'];?> </option> <?php } ?> </select> </td> </tr> <tr> <td> <h3>Environment:</h3> </td> <td> <select id="environment" name="environment" class="searchoption"> <option value="">-- Select Environment --</option> <?php if (isset($_POST['environment'])){ $eviID = $_POST['environment']; $resultdomain = mysqli_query($con,"Select * from evn WHERE ID=$eviID") ?> <?php while ($line = mysqli_fetch_array($resultdomain)) { ?> <option value="<?php echo $line['envid'];?>" selected="selected"> <?php echo $line['env'];?> </option> <?php }} ?> <?php $resultdomain = mysqli_query($con,"Select * from evn") ?> <?php while ($line = mysqli_fetch_array($resultdomain)) { ?> <option value="<?php echo $line['envid'];?>"> <?php echo $line['env'];?> </option> <?php } ?> </select> </td> </tr> <tr> <td> <h3>Status:</h3> </td> <td> <select name="status" class="searchoption"> <option value="Active">Active</option> <option value="Inactive">Inactive</option> </select> </td> </tr> </table> <input type="reset" name="reset"> <input type="submit" name="submit" value="Search"> </ul> </form> <?php if (isset($_POST['submit'])) { if (empty($_POST['service'])) { echo "Please select service in dropdown" . "</br>"; } else { $service = $_POST['service']; } if (empty($_POST['environment'])) { echo "Please select Environment in dropdown" . "</br>"; } else { $env = $_POST['environment']; } if ((!empty($service)) && (!empty($env))) { $sql="select * from TableName"; //Original Query removed if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } $mydata = mysqli_query($con,$sql); $rowcount = mysqli_num_rows($mydata); if ($rowcount >= 1) { echo "<table id='main-data-table' border=1> <tr> <th> + </th> <th>Server Name</th> <th>IP Address</th> <th>Service</th> <th>Tier</th> </tr>"; while ($record = mysqli_fetch_array($mydata)) { echo "<tr class='main mainrow'>"; echo "<td><a href='#' class='main'>+</a></td>"; echo "<td>" . $record['ServerName'] . "</td>"; echo "<td>" . $record['IPAddress'] . "</td>"; echo "<td>" . $record['service'] . "</td>"; echo "<td>" . $record['tier'] . "</td>"; echo "</tr>"; //echo "<table border=1>"; echo "<tr class='data showhide'>"; echo "<td>" . "</td>"; echo "<td class='innerleftcol'>" . Server . Name . "</td>"; echo "<td>" . $record['ServerName'] . "</td>"; echo "<td class='innerleftcol'>" . IP . Address . "</td>"; echo "<td>" . $record['IPAddress'] . "</td>"; echo "</tr>"; echo "<tr class='data showhide'>"; echo "<td>" . "</td>"; echo "<td class='innerleftcol'>" . Alias . "</td>"; echo "<td>" . $record['alias'] . "</td>"; echo "<td class='innerleftcol'>" . Environment . "</td>"; echo "<td>" . $record['env'] . "</td>"; echo "</tr>"; echo "<tr class='data showhide'>"; echo "<td>" . "</td>"; echo "<td class='innerleftcol'>" . VIP . Address . "</td>"; echo "<td>" . $record['vipaddress'] . "</td>"; echo "<td class='innerleftcol'>" . Domain . Name . "</td>"; echo "<td>" . $record['domainname'] . "</td>"; echo "</tr>"; echo "<tr class='data showhide'>"; echo "<td>" . "</td>"; echo "<td class='innerleftcol'>" . Service . "</td>"; echo "<td>" . $record['service'] . "</td>"; echo "<td class='innerleftcol'>" . Tier . "</td>"; echo "<td>" . $record['tier'] . "</td>"; echo "</tr>"; echo "<tr class='data showhide'>"; echo "<td>" . "</td>"; echo "<td class='innerleftcol'>" . OS . "</td>"; echo "<td>" . $record['os'] . "</td>"; echo "<td class='innerleftcol'>" . EndPoint . "</td>"; echo "<td>" . $record['url'] . "</td>"; echo "</tr>"; echo "<tr class='data showhide'>"; echo "<td>" . "</td>"; echo "<td class='innerleftcol'>" . Platform . "</td>"; echo "<td>" . $record['platform'] . "</td>"; echo "<td class='innerleftcol'>" . Virtual . "</td>"; echo "<td>" . $record['virtualenv'] . "</td>"; echo "</tr>"; } echo "</table>"; echo "$rowcount record/s found"; } else { echo "No records found"; } } else { exit(); } mysqli_close($con); } ?> </body> </html>
  17. Hi, I'd do something like: <select id="service" name="service" class="searchoption"> <option value="">-- Select Service Name --</option> <?php $resultservice = mysqli_query($con,"Select * from services") ?> <?php if (isset($_POST('service'))){ echo "<option value='" . $_POST('service') . "' selected='selected'>'" . $_POST('service') . "'</option>"; } while ($line = mysqli_fetch_array($resultservice)) { ?> <option value="<?php echo $line['serviceid'];?>"> <?php echo $line['service'];?> </option> <?php } ?> Hope this helps...
  18. Hi, @ DENNO020 : Feel honoured, he came here for help. Divide and conquer... Code looks fine, though I am tired and had a few to many drinks, lets assume all is ok, since no other errors came up... Give this a try: Check if your SMTP is setup (Reference: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true), Check Port 25 is open on the server, Check your php.ini is setup to these configurations: http://www.php.net/manual/en/mail.configuration.php. Note: If you are using a home computer for the server, beware that some ISP's block port 25, alternative ports can be used default ports: 25 or 587 (reference: http://www.arclab.com/en/amlc/list-of-smtp-and-pop3-servers-mailserver-list.html) See how you go, if none of above helps, please let us know, we are always happy to help.
  19. I would use php validate filters and sanitize: Reference: http://www.php.net/manual/en/book.filter.php Validate: http://www.php.net/manual/en/filter.filters.validate.php Sanitize: http://www.php.net/manual/en/filter.filters.sanitize.php
  20. Hi Guessing: I don't know much about FB API, think the logic is the problem here though. If it is returning a false then it seems to be is missing what you need to run through your methods correctly, returning a false, might want to do something like: If ($user == false){ //redirect to login } Suggest: comment out the redirection line and echo out the variables to see if they return correctly. Don't know if any of this will help, but worth a try.
  21. Hi, I've not worked with php sessions much, but I am assuming they would be all similar, Maybe something like this: <?php if ($_SESSION['mysession'] == 1){ // REDIRECT }else{ // REDIRECT } ?>
  22. Hi, isset is what is needed for that error, so you could do something like: if (isset($_POST['created'])){ $created = $_POST['created']; }else{ $created = ''; }
  23. Found this: http://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use--net-24059
×
×
  • 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.