PHP - Help Needed In Configuring Php To Call Sql Server Reports
Hello
I am using SQL Server 2008 and Xampp server for PHP. I am trying to call SQL Server reports from PHP and I am using the code from https://ssrsphp.code...ussions/577518# I can call the URL which connects to the Reports server from PHP but when I try to click the dropdown and run the reports I get an error. Fatal error: Class 'PReportException' not found in E:\PHP_SRS\ssrsphp\Factory\SSRSTypeFactory.php on line 75 Can someone please tell me how to fix this error ? Thanks Similar TutorialsHi all, I am a newbie to PHP. I'm trying to execute a program from my PHP script by calling the exec() function of PHP. It works fine when i try it from command line, or execute the script in command line. But when i call it from a php script in my apache, it does nothing. No errors are thrown. What i get in return is only an empty array. i'm using Ubuntu 11.10 and Apache 2.2 with PHP 5.3.3 thanks for helping me. Hi, I have a some online backup software call ahsay, I' am looing to create a API call with a form in PHP Please check out this link www.123-backup.com/obs-admin-guide.pdf this is the guide to create a api for the online backup (page 69) Would some be intrested in creating this api call and php form for me ? p.s please see attached image this is something i'am looking for. if so how much would it be please email me if you want more info! The information on the php.net documentation seems to be out of date.
http://php.net/manua...databases.mssql
as the link to the necessary libraries for Linux is broken.
Can you tell me, or point me to what is needed to connect to MSSQL with PHP 5.3.3/Apache on Red Hat Linux
If there is more than one option, we would like to know what they are and the installation details.
Thanks
Hi All, My goal is to process all redirects serverside and simply return the user to the 'final' URL. Here's my function to get the final URL: PHP Code: function get_final_url($url){ global $final_host; $redirects = get_all_redirects($url); if (count($redirects)>0){ $final_url = array_pop($redirects); if(substr($final_url,0,7) != 'http://' && !empty($final_host)) { $final_url = 'http://'.$final_host.$final_url; } return $final_url; } else { return $url; } Here's the cURL execution: $ch2 = curl_init(); curl_setopt($ch2,CURLOPT_URL,$url); curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch2,CURLOPT_POST,''); curl_setopt($ch2,CURLOPT_POSTFIELDS,''); curl_exec($ch2); curl_close($ch2); For some reason, this works no problem, posts any data over to the URLs serverside, redirects serverside, and passes the client to the final URL, with none of the redirection displayed via HTTPWatch or any similar debug utility. Sometimes, however, it does show phases of redirection. Any insight into what I might be doing incorrectly? Thanks SO much in advance. E I have used the XAMPP installer to install php and MySQL locall on my computer. I also succeeded in setting the security for XAMPP pages, the MySQL admin user root and phpMyAdmin login. When I enter phpMyAdmin via the link in the XAMPP initial page I do however receive a red notification: phpMyAdmin configuration storage is not fully configured; some extensions are not activated. To find out click here. I have attached a screenshot showing three items which are not OK, shown in red. I looked up in the documentation, but could not find out. I hope someone can help. I don't even know if it is important to fix this problem. Regards, Erik Attached Files XAMPP2.jpg 41.08KB 0 downloads Hey Guys. I am writing a function that will output to the user if a store is open or not.
I wrote a fucntions named is_store_open() with a variable called $day which will have the current day of the week assigned to it.
Lets say it is Saturday. it finds the case for "Saturday" and checks the opening time and closing time for Saturday.
The problem that I am facing, is when the store is open past midnight on Saturday. It then won't check the case for saturday.
Instead will check the case for Sunday. Which is not what I want, becuase it will show the store as closed when its open still open on "Saturday"
I wrote a function below that checks to see if the previous day closing hours are greater then the current time. If its true then return true and I guess that should fix the problem.
But when I wrote that it would give me an error saying that $saturday_close is undefined. I'm guessing its becuase its in a switch satement, and it does not equal to that day.
I'm a little bit confused on how to set this up. If anyone has a suggestion I would really apprecaite your help. Thanks!
function is_store_open(){ $set_time = strtotime("tomorrow"); // Lets just sat its Sunday for testing purposes $day = date("l", $set_time); $time_now = mktime("00", "00", "00"); // Now lets say the time now is 12:00am switch ($day) { case "Saturday": $open = "11:00"; $saturday_close = "1:00"; break; case "Sunday"; if($saturday_close > $time_now ){//If the $monday_close hours are greater then the current time return false the store is still open return true; } else { $open = "2:00"; $close = "22:00"; } break; } }// End of function if(is_store_open()) { echo "Oh no! There is still a glitch in the system the store needs to remain open"; } else { echo "The store is still open on Saturday"; } I came across this error when trying to learn how to send form data to my email address - Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Apache\htdocs\websites\php_learn\report.php on line 30 From what I have read so far I think I need to reconfig my php.ini file. So I looked into my php.ini file and found this - [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com I have a 64 bit system so do I need to download another version of php? Also when I do get to the point at where I can config the php.ini file how do I go about it? Any help would be greatly appreciated. A while back, I was showed how to authenticate to PostgreSQL using peer authentication over a socket for applications where PHP, FPM, and PostgreSQL are all on the same machine. All works. I could use native PHP as shown and it returns results without errors so I know that PHP, FPM, and PostgreSQL is setup correctly to establish a connection using peer authentication without a PostgreSQL username or password. $pdo = new PDO("pgsql:dbname=testing"); $rs = $pdo->query('SELECT * FROM company')->fetchAll(); I could also use Doctrine but not Symfony and get results without errors so I know that Doctrine is capable of establishing a connection using peer authentication without a PostgreSQL username or password. $pdo = EntityManager::create(['driver' => 'pdo_pgsql','dbname' => 'testing'], Setup::createAnnotationMetadataConfiguration([__DIR__."/../src"], true, null, null, false))->getConnection(); $rs = $pdo->query('SELECT * FROM company')->fetchAll(); Now I am trying to do the same but when using Symfony. I expected I could just edit config/packages/doctrine.yaml as follows, however, it results in An exception occurred in driver: SQLSTATE[08006] [7] fe_sendauth: no password supplied doctrine: dbal: driver: pdo_pgsql dbname: testing server_version: 13 Any thoughts how to do this? Thank you Have you guys ever build a smart queries for users too generate reports basically on anything they may want. I am looking on making something very user friendly. I do not have any ideas where to start
Hello guys. By the end of the day, my client wants the daily report sent to his email account in .xls format. how can i attain this? I know the php mail() function but i dont know how will php create an excel file and email it to my client automatically. Where should i start? Thanks guys! hi, i looking for a design report like crystal report or active reports but for php the objective is creat a report using mysql data and save the template and load that report in a pdf file for print or save any one know something like that? i already use classes like class.ezpdf.php but i spend many hours creating complex reports, all is created using a text editor.. thanks for your help Hi Guys My site has a shout box, now and again people post inappropriate content and if a moderator is not online to mute them it doesnt look good for other users. I have written a snippet of code to report an offender. My goal is that if 3 different people report an offender the site auto mutes them. (manual mute function already exists for moderators) I setup a table that records the reporters name the offenders name the post id the message content and the time stamp. I have never been good at counting num rows etc and need some help in what direction to go in. My current code that inserts the reported content. Code: [Select] mysql_query("INSERT INTO `chicka_pets`.`records_sbreports` (`id`, `offender`, `reporter`, `post_id`, `post_content`, `timestamp`) VALUES ('', '$offender', '$username', '$id', '$sbmessage', '$timestamp')"); I am guessing that somewhere after that I need some sort of count numrows on the post id where reporter is NOT the same and then an if numrows >2 set offender to mute my problem is how to do the num rows bit where the reporters are unique? Any help is much appreciated Hi guys, I want to generate reports and i want to use some fields of one table and other fields of another table. How can i use that? Ex. customer(customer_id, full_name,name_with_initials, address, contact_number,gender) transaction_table(tran_ID, account_number,account_type,transaction_type, amount, Date) If i want to use only customer_id, tran_ID, full_name and amount how can i use them to generate reports. I want them to be taken as fields of one table and use it.. Thanks, Heshan This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319682.0 OVERVIEW: The code is about making call to the escreen web service using SOAP and Curl with client authentication required. Currently I am not getting any result only HTTP 403 and 500 errors. The call requires client authenticate cert to be on the callng site. CODE: $content = "<TicketRequest> <Version>1.0</Version> <Mode>Test</Mode> <CommitAction></CommitAction> <PartnerInfo> <UserName>xxxxxxxxxx</UserName> <Password>xxxxxxxxxxx</Password> </ PartnerInfo> <RequestorOrderID></RequestorOrderID> <CustomerIdentification> <IPAddress></IPAddress> <ClientAccount>xxxxxxxxxx</ClientAccount> <ClientSubAccount>xxxxxxxxxx</ClientSubAccount> <InternalAccount></InternalAccount> <ElectronicClientID></ElectronicClientID> </CustomerIdentification> <TicketAction> <Type></Type> <Params> <Param> <ID>4646</ID> <Value></Value> </Param> </Params> </TicketAction> </TicketRequest>"; $wsdl = "https://services.escreen.com/SingleSignOnStage/SingleSignOn.asmx"; $headers = array( "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", // "SOAPAction: \"\"", "Content-length: ".strlen($content), ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $wsdl); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_VERBOSE, '1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $content); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '1'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, '1'); //curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml")); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('SOAPAction: ""')); curl_setopt($ch, CURLOPT_CAPATH, '/home/pps/'); curl_setopt($ch, CURLOPT_CAINFO, '/home/pps/authority.pem'); curl_setopt($ch, CURLOPT_SSLCERT, 'PROTPLUSSOL_SSO.pem'); curl_setopt($ch, CURLOPT_SSLCERTPASSWD, 'xxxxxxxxxxxx'); $output = curl_exec($ch); // Check if any error occured if(curl_errno($ch)) { echo 'Error no : '.curl_errno($ch).' Curl error: ' . curl_error($ch); } print_r($output); QUESTIONS: 1. I need to call the RequestTicket method and pass the XML string to it. I don't know how to do it here(pass the method name to call). 2. For client authentication they gave us three certs, one root cert, one intermediate cert and a client authentication cert PROTPLUSSOL_SSOpem(it was a .pfx file). Since we are on linux we converted them to pem . In curl calls I could not find way to how to include both the root cert and the intermediate cert ,so I combined them by making a new pem file and copying the intermediate cert and them the root cert and naming it authority.pem . I am not sure whether it works or not and would like your opinion. 3. For the current code Iam getting the error Error no : 77 Curl error: error setting certificate verify locations: CAfile: /home/pps/authority.pem CApath: /home/pps/ If I disable the curl error message,I am getting blank page with page title 403 - Forbidden. Access is denied. If I comment out the CURLOPT_CAPATH and CURLOPT_CAINFO lines it gives http 500 error page with the message as content and the following at the top. > HTTP/1.1 500 Internal Server Error. Cache-Control: private Content-Type: text/html Server: Microsoft-IIS/7.5 X-AspNet-Version: 1.1.4322 X-Powered-By: ASP.NET Date: Thu, 02 Sep 2010 14:46:38 GMT Content-Length: 1208 If I comment out as above and also CURLOPT_SSLCERT and CURLOPT_SSLCERTPASSWD it gives 403 error with the message as content. So I would request you to help me out by pointing out whats wrong with the current code. Thank you. I can call the following function successfully as a single php program // Acknowledge and clear the orders function ack($client, $merchant, $id) { $docs = array('string' => $id); $params = array('merchant' => $merchant, 'documentIdentifierArray' => $docs); $result = $client->call('postDocumentDownloadAck', $params); return $result; } with $result = ack($t, $merchant,'2779540483'); successful output [documentDownloadAckProcessingStatus] => _SUCCESSFUL_ [documentID] => 2779540483 I'm trying to figure out how to call this function as an object from another program. Trying the following gives error ***Call to a member function call() on a non-object*** function postDocumentDownloadAck($t, $merchant, $id) { $this->error = null; $docs = array('string' => $this->id); $params = array('merchant' => $this->merchant, 'documentIdentifierArray' => $docs); ** I've tried the following which does nothing $result = $this->soap->call('postDocumentDownloadAck', $params); ** I've tried the following - which gives error "Call to a member function call() on a non-object" $result = $this->t->soap->call('postDocumentDownloadAck', $params); if($this->soap->fault) { $this->error = $result; return false; } return $result; } *** calling program snippet for above function $merchant= array( "merchant"=> $merchantid, "merchantName" => $merchantname, "email"=> $login, "password"=> $password); $t = new AmazonMerchantAPI($merchantid, $merchantname, $login, $password); $documentlist= $t->GetAllPendingDocumentInfo('_GET_ORDERS_DATA_'); $docid = $documentlist['MerchantDocumentInfo'][$i]['documentID']; $docs = array('string' => $docid); $ackorders = $t->postDocumentDownloadAck($t, $merchant,$docs); Any ideas of what I'm doing wrong are greatly appreciated. I have a PHP web system that store in a windows server. In the system, there is a function for user to upload files to another server (Shared server in Unix). When i try to upload a file, it gives warning: Warning: move_uploaded_file(\\unixserver/sharedfolder/upload/test.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\wamp\www\upload\index.php on line 40 For your information, my username has been assigned in xxx's group that has access to read and write on that folder. Besides, i'm able to open,create and delete files on that folder's server manually (samba). The safe mode setting is off. Does anybody has any idea why this thing happen? I'm trying to make a simple website where people register to my website. When the user doesn't fill anything inside the boxes they get a message "Please fill all required fields" on the register.php page On my local host require_once works good. It shows up.
But when i upload the files to my sever the require_once does not show up on the register.php It just refreshes and i dont get the message "Please fill all required fields"
This is the code that works in local host but not in a live server <?php require_once 'messages.php'; ?>
Here is my full code
Register page: <html> <?php require_once 'messages.php'; ?> <br><br> <form action="register-clicked.php" method="POST"> Username:<br> <input type="text" name="usernamebox" placeholder="Enter Username Here"> <br><br> Email:<br> <input type="text" name="emailbox" placeholder="Enter email here"> <br><br> Password:<br> <input type="password" name="passwordbox" placeholder="Enter password here"> <br><br> Confirm Password:<br> <input type="password" name="passwordconfirmbox" placeholder="Re-enter password here"> <br><br> <input type="submit" name="submitbox" value="Press to submit"> <br><br> </form> </html>
Register clicked <?php session_start(); $data = $_POST; if( empty($data['usernamebox']) || empty($data['emailbox']) || empty($data['passwordbox']) || empty($data['passwordconfirmbox'])) { $_SESSION['messages'][] = 'Please fill all required fields'; header('Location: register.php'); exit; } if ($data['passwordbox'] !== $data['passwordconfirmbox']) { $_SESSION['messages'][] = 'Passwords do not match'; header('Location: register.php'); exit; } $dsn = 'mysql:dbname=mydatabase;host=localhost'; $dbUser='myuser'; $dbPassword= 'password'; try{ $connection = new PDO($dsn, $dbUser, $dbPassword); } catch (PDOException $exception){ $_SESSION['messages'][] = 'Connection failed: ' . $exception->getMessage(); header('Location: register.php'); exit; }
messages.php <?php session_start(); if (empty($_SESSION['messages'])){ return; } $messages = $_SESSION['messages']; unset($_SESSION['messages']); ?> <ul> <?php foreach ($messages as $message): ?> <li><?php echo $message; ?></li> <?php endforeach; ?> </ul> Edited Wednesday at 12:49 AM by bee65 Hi, I am not a PHP programmer. I took on a new client with a simple PHP site, without any databases. The site is up and running on the web. I would like to get it running on my local machine for further development. I have latest version of WAMP installed, running Apache version 2.2.11 and PHP version 5.3.0 I created a directory in the WAMP "www" project directory and it shows up there like it's supposed to when I browse to "localhost" Problem: The home page of website displays text but no, images, styles, footer, header, nav links, etc. Here is the code for the home page: <? define("NAV","home"); require_once('local/local.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>TITLE</title> <meta name="keywords" content=""> <meta name="Description" content=""> <? include("common/dochead.php"); ?> </head> <body onLoad="<? include('common/preloads.php'); ?>"> <!-- ============================ main ============================= --> <div id="main-frame"><div id="main" class="noCollapse"> <? include("common/sign.php"); ?> <div id="right-frame"> <? include("common/navigation.php"); ?> <div id="content-frame"> <div id="content"> <h1>Welcome</h1> <p>This is the content area. This is the content area. This is the content area. </p> </div><!-- end content --> </div><!-- end content-frame --> </div><!-- end right-frame --> <div class="clearFloats"></div> </div><!-- end main --></div><!-- end main-frame --> <? include("common/footer.php"); ?> </body> </html> Any help would be greatly appreciated. I have spent many hours on this. Regards Hi folks, I'm curious if I can for example, save a file from my server and it will save to all other servers - obviously if they accepted the connection first. It's for a software I developed and is almost complete and know there will be frequent updates to it. Instead of users downloading upates, I want the update files from my server to somehow synchronize to their server automatically? Anything called this?? Thanks for info. |