Jump to content

nadman123

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nadman123's Achievements

Member

Member (2/5)

0

Reputation

  1. hi guys, Recently i have assigned to a project where i have to create a web site to my client. He also wants to have a CMS with web site. My client hasn't got much computing skills..so he wants to use a very user friendly CMS...from the requirements of the CMS I just found out that there is only little amount of information needed to be managed. eg:- Add,update and delete items for an online shop(no money transaction involved), and a staff information page...and so on... Currently he is been using a CMS called "Silver stripe" which he has found out quite easy to use and he hates druple.... I've got fair bit of PHP/SQL skills...and I am capable of producing a very simple CMS for this web-site. And My problem is if I try to make my very own CMS to this client will he agree to use my CMS instead of "Silver Stripe" and how can I convince him to use My CMS instead of "Silver Stripe"?? Actually this is my first time in my whole life that I am working with a client ...and i am very nervous in doing that...obviously still being a student. I need your thoughts....If you want to check "Silver Stripe" here is the web site.... www.silverstripe.com they have a demo version of it. your comments much appreciated... Thanks
  2. Ok here you go its a bit long code man... <?php session_start(); if (!isset($_SESSION['basic_is_logged_in']) || $_SESSION['basic_is_logged_in'] !== true) { header('Location: login.php'); exit; } ?> <?php ob_start(); include("connection.php"); $conn = oci_connect($UName,$PWord,$DB) or die("Couldn't logon to the database."); ?> <html> <head><title>Property Details</title> <link rel="stylesheet" href="stylesheet.css" type = "text/css" /></head> <body> <center><h2>Property Details</h2></center> <form method="post" action="property.php?Action=Search"> <input type="text" name="search" size="50"/><input type="submit" value="Search"/></form> <a style="text-decoration:none" href="addProperty.php"><input type = "button" value="New Property"></a> <?php if(empty($_GET["Action"])) { $strAction = "Display"; } else { $strAction = $_GET["Action"]; } switch($strAction) { case "Display": $query="SELECT * FROM Property ORDER BY PROPERTY_ID"; $stmt = oci_parse($conn, $query); oci_execute($stmt); ?> <?php while ($row = oci_fetch_array ($stmt)) { ?> <table><tr><table width="50%"> <tr><td rowspan="8"width ="25%"><a href='uploads/<?php echo $row["PROPERTY_IMAGE"]; ?>'><img src="uploads/<?php echo $row["PROPERTY_IMAGE"]; ?>"width="200" height="150"/></a></td><td><b>Property ID</b></td><td><b><?php echo $row["PROPERTY_ID"]; ?></b></td></tr> <tr><td><b>Street</b></td><td><?php echo $row["PROPERTY_STREET"]; ?></td></tr> <tr><td><b>Suburb</b></td><td><?php echo $row["PROPERTY_SUBURB"]; ?></td></tr> <tr><td><b>State</b></td><td><?php echo $row["PROPERTY_STATE"]; ?></td></tr> <tr><td><b>Post Code</b></td><td><?php echo $row["PROPERTY_POSTCODE"]; ?></td></tr> <tr><td><b>Price</b></td><td>$<?php echo $row["PROPERTY_PRICE"]; ?></td></tr> <tr><td><b>Type of property</b></td><td><?php echo $row["PROPERTY_TYPE"]; ?></td></tr> <tr><td> <a style="text-decoration:none" href="PropertyModify.php?Property_id= <?php echo $row["PROPERTY_ID"]; ?> &Action=Update"><input type="button" value="Update"></a> <a style="text-decoration:none" href="PropertyModify.php?Property_id= <?php echo $row["PROPERTY_ID"]; ?> &Action=Delete"><input type="button" value="Delete"></a> </td> </tr><tr></tr></table></tr><tr></tr></table> <?php } ?> <form method="post" action="property.php?Action=CreateXML"> <input type="submit" value="Create XML Document"> </form> <?php if(isset($_GET["XML"])) { echo "<a href='customers.xml' target='_blank'> View XML Document</a>"; } oci_free_statement($stmt); break; case "CreateXML": $query="SELECT * FROM Property"; $stmt = oci_parse($conn,$query); oci_execute($stmt); $nrows = oci_fetch_all($stmt,$results); if ($nrows> 0) { $doc = new DOMDocument('1.0'); $doc->formatOutput = true; $properties = $doc->createElement('properties'); $doc->appendChild($properties); for ($i = 0; $i<$nrows; $i++) { $property_record = $doc->createElement('property_record'); $properties->appendChild($property_record); reset($results); while (list($column_name,$column_value) = each($results)) { $each_column_name = $doc->createElement(strtolower($column_name)); $property_record->appendChild($each_column_name); $each_column_value = $doc->createTextNode($column_value[$i]); $each_column_name->appendChild($each_column_value); } } $fp = @fopen('properties.xml','w'); if(!$fp) { die('Error cannot create XML file'); } else { $doc->save('customers.xml'); fclose($fp); header("Location: property.php?XML=OK"); } } else { echo "No Records found"; } oci_free_statement($stmt); break; case "Search": $query=SELECT * FROM Property ORDER BY PROPERTY_ID WHERE Property_suburb LIKE '%{$_POST['search']}%'"; $stmt = oci_parse($conn, $query); oci_execute($stmt); while ($row = oci_fetch_array ($stmt)) { ?> <table><tr><table width="50%"> <tr><td rowspan="8"width ="25%"><a href='uploads/<?php echo $row["PROPERTY_IMAGE"]; ?>'><img src="uploads/<?php echo $row["PROPERTY_IMAGE"]; ?>"width="200" height="150"/></a></td><td><b>Property ID</b></td><td><b><?php echo $row["PROPERTY_ID"]; ?></b></td></tr> <tr><td><b>Street</b></td><td><?php echo $row["PROPERTY_STREET"]; ?></td></tr> <tr><td><b>Suburb</b></td><td><?php echo $row["PROPERTY_SUBURB"]; ?></td></tr> <tr><td><b>State</b></td><td><?php echo $row["PROPERTY_STATE"]; ?></td></tr> <tr><td><b>Post Code</b></td><td><?php echo $row["PROPERTY_POSTCODE"]; ?></td></tr> <tr><td><b>Price</b></td><td>$<?php echo $row["PROPERTY_PRICE"]; ?></td></tr> <tr><td><b>Type of property</b></td><td><?php echo $row["PROPERTY_TYPE"]; ?></td></tr> <tr><td> <a style="text-decoration:none" href="PropertyModify.php?Property_id= <?php echo $row["PROPERTY_ID"]; ?> &Action=Update"><input type="button" value="Update"></a> <a style="text-decoration:none" href="PropertyModify.php?Property_id= <?php echo $row["PROPERTY_ID"]; ?> &Action=Delete"><input type="button" value="Delete"></a> </td> </tr><tr></tr></table></tr><tr></tr></table> <?php } break; ?> <?php } oci_close($conn); ?> <a href="DisplaySource.php?filename=property.php"><img src="images/codebuttonproperty.jpg"/></a> </body> </html> I guess the error comes at case: Search i.e as soon as I hit the button search....
  3. Maq was correct..but now I am getting another error...
  4. when i try this i get this error message
  5. so do ypu have any other alternative...
  6. Can any one correct this please!!!
  7. I used the oci_fetch_all($stmt, $rows, 0, 0,OCI_FETCHSTATEMENT_BY_ROW); function to return the row data but i m not sure whether the newer version of NuSOAP libraries supports this function..instead what should i use and what changes that I should make to the above code plz....??
  8. does it mean the problem is may be in the server file??
  9. yep when i tried that i get the message response is type html not xml.. ??? ??? ???
  10. this is the code... <?php require_once('lib/nusoap.php'); $client = new soapclient('http://localhost/TypeWS.php'); $result = $client->call('getTypes'); $err = $client->getError(); if ($err) { echo '<p><b>error: ' . $err . '</b></p>'; } else { print_r($result); echo "<p />"; ?> <table align="center"> <tr> <th>Type ID</th> <th>Type name</th> </tr> <?php foreach($result as $row) { echo "<tr>"; foreach($row as $Data) { echo "<td>" .$Data. "</td>"; } echo "</tr>"; } echo "</table>"; } and I get this error: what should i do now??? ??? ??? ??? ???
  11. hello guyz.. I m trying to get this webservice done but i cant do it can you please help me out.... here is the code of the CustomerServer.php <?php // Pull in the NuSOAP code require_once('lib/nusoap.php'); // create SOAP server object $server = new soap_server(); // Define the methods as a PHP functions function getCustomers() { include("connection.php"); $conn = oci_connect($UName, $PWord, $DB); $query="SELECT * FROM customer"; $stmt = oci_parse($conn, $query); oci_execute($stmt); oci_fetch_all($stmt, $rows, 0, 0,OCI_FETCHSTATEMENT_BY_ROW); oci_free_statement($stmt); oci_close($conn); return $rows; } function getCustomerByID($params) { include("connection.php"); $conn = oci_connect($UName, $PWord, $DB); $query="SELECT * FROM customer WHERE cust_no =".$params[0]; $stmt = oci_parse($conn, $query); oci_execute($stmt); $row = oci_fetch_array ($stmt); oci_free_statement($stmt); oci_close($conn); return $row; } function updateCustomer($params) { include("connection.php"); $conn = oci_connect($UName, $PWord, $DB); $query="UPDATE Customer set firstname='".$params[1]."',". "surname='".$params[2]."', address='".$params[3]."',". "contact='".$params[4]."' WHERE cust_no =".$params[0]; $stmt = oci_parse($conn, $query); oci_execute($stmt); oci_free_statement($stmt); oci_close($conn); } function deleteCustomer($params) { include("connection.php"); $conn = oci_connect($UName, $PWord, $DB); $query="DELETE FROM customer WHERE cust_no =".$params[0]; $stmt = oci_parse($conn, $query); oci_execute($stmt); oci_free_statement($stmt); oci_close($conn); } // Use the request to (try to) invoke the service $server->register('getCustomers'); $server->register('getCustomerByID'); $server->register('updateCustomer'); $server->register('deleteCustomer'); $server->service(file_get_contents("php://input")); ?> here is the code of the CustomerClient.php <?php require_once('lib/nusoap.php'); // Create the client instance $client = new soapclient('http://localhost/CustomerServer.php'); $result = $client->call('getCustomers'); // Check for an error $err = $client->getError(); if ($err) { echo '<p><b>error: ' . $err . '</b></p>'; } else { print_r($result); echo "<p />"; ?> <table border="1" align="center"> <tr> <th>Cust No</th> <th>Firstname</th> <th>Surname</th> <th>Address</th> <th>Contact</th> </tr> <?php foreach($result as $Row) { echo "<tr>"; foreach($Row as $Data) { echo "<td>".$Data."</td>"; } echo "</tr>"; } echo "</table>"; } ?> I m getting this error What should I do Please help all you PHP experts...
  12. How do you physically delete files from a ftp server using a php script?
  13. if you put headers before htmls how do you run the script ??? ??? ??? can you be more specify?
  14. The code is like this <?php session_start(); define("COMPANYX_DIR", "ldap.companyx.com"); define("COMPANYX_FILTER","o=Company x, c=au"); ?> <html> <head> <title>Login</title> </head> <body> <form method="post" action="login.php"> <center>Please log in using your Authcate Details </center><p /> <table border="0" align="center" cellspacing="5"> <tr> <td>Authcate Username</td> <td>Authcate Password</td> </tr> <tr> <td><input type="text" name="uname" size="15"></td> <td><input type="password" name="pword" size="15"></td> </tr> </table><p /> <center> <input type="submit" value="Log in"> <input type="reset" value="Reset"> </center> <?php if(!isset($_POST["uname"])) { header( "Location:login.php" ); } else { $LDAPconn=@ldap_connect(COMPANYX_DIR); if($LDAPconn) { $LDAPsearch=@ldap_search($LDAPconn,COMPANYX_FILTER, "uid=".$_POST["uname"]); if($LDAPsearch) { $LDAPinfo = @ldap_first_entry($LDAPconn,$LDAPsearch); if($LDAPinfo) { $LDAPresult=@ldap_bind($LDAPconn, ldap_get_dn($LDAPconn, $LDAPinfo), $_POST["pword"]); } else { $LDAPresult=0; } } else { $LDAPresult=0; } } else { $LDAPresult=0; } if($LDAPresult) { header( "Location: property.php" ); } else { echo "Invalid User"; } } ?> </body> </html> i get this error message I really dont get it how to do it...the header information??? ??? ??? ??? ??? ???
×
×
  • 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.