SharePoint 2007 form, with data inserted into SQL - php

I'm setting up a form on an internal Sharepoint 2007 site, and the requestor would like the form data to emailed to them, and stored on a SQL Server table.
I have a good general knowledge of web development, but I am relatively new to developing for SharePoint, and it's not within budget for me to learn Visual Studio and C# and make a webpart.
So, I am attemping to do this with a basic HTML form within a Page Viewer webpart, posting to a PHP script & handling the email and SQL insert in PHP. The problem is that upon hitting submit, rather than executing the PHP script, it hides the form and displays the PHP code in plain text in the webpart.
Now, I know I'm not using PHP correctly for SharePoint, but I cannot find any information on how to run PHP within SharePoint, other than people using PHP on a seperate server to pull list data.
Anyone have any ideas on a fix, or an alternative method of achieving this kind of form?
I am open to trying new things, but I will NOT build a webpart, especially as this should be portable, as we're upgrading SP soon and moving to a new server.
Thank you!

you may be able to use InfoPath to accomplish this.
Please see the following link for an InfoPath introduction - http://office.microsoft.com/en-us/infopath-help/introduction-to-microsoft-office-infopath-2007-HA010163577.aspx

Related

Creating a small database of items, able to be checked out and returned from a web browser?

Sorry if this is formatted incorrectly, this is my first time posting here.
So I'm trying to have this database of items be able to be checked out and returned from a web browser.
I've written up a web page in html that would work, if not for me having no idea how to have user input save serverside.
Plus I have no idea where to host this. I'm kind of in over my head here, any tips on where to start?
If you want to do it all yourself, I'd check out some shared hosting services that offer a database + php.
Html itself can't interact with the server / store data like that. That's where PHP would come in to play, and then either MySQL/Postgres/etc would store the data.
You should have a read up on some basic PHP and learn how it interacts with databases, then you can have a form submit and store the data, then render it on another page.

Asp + vXML dynamic data

I have been put in charge of building an IVR using vXML and asp.net. For some reason the voice server we are using requires ASP.net and cannot use PHP in conjunction with vXML so I am stuck learning ASP.net. The application is pretty simple in that it runs an ASP.net file with vXML and should pull data from a database based on user input.
Example:
User enters customer ID "23313"
It should then pull data from our SQL2012 DB that corresponds to that ID and read it back via prompts. Simple enough I figured.
A have a couple questions regarding possible solutions to this -
Is it possible for ASP/vXML to pull data from PHP dynamically (post or get statements), and use the data in the current vXML document? or will I have to bite the bullet and figure out a second page?
if using PHP is not ideal or possible, would it be better or possible to add a db connection into the asp/vXML document and run the IVR that way?
I am not very familiar with ASP.net, and am trying to find out the most efficient way to accomplish my goal without having to have an additional vXML page to run.
Any help appreciated.
EDIT
After further investigation and help from Jim I was able to get inline PHP working. The server I was using was set to go specifically to this asp.net and did not have PHP installed on the server itself. After installing PHP, changing where the server was looking for the file, I am able to run the latest PHP version in my app.
Deleted code sample as it was completely irrelevant
The ASP requirement seems odd, unless you are leveraging some type of library within the ASP.net environment. VoiceXML browsers, are just that, a browser. It should be able to process VXML from the standard sources. I suspect you are working within a framework that requires the serverside ASP.
If your browser is VoiceXML 2.1 compliant, you should have access to the Data element. This element allows you to make Get and Post requests to a server, get back XML and parse the data within Javascript. Note, the return data must be valid XML.
Any database connection would have to be on the ASP.net side of the solution. VoiceXML gets data by transitioning to a new page (goto or subdialog element) or the Data element above.

Avaya CMS - how to get data with php?

Is it possible to get data from Avaya CMS (16.3) (for call centers) with PHP?
I want to create a real-time statistics with PHP but i don't know how to get data from database :/
If anyone is searching for an answer - yes, it is possible but partially.
You need to create a script from the CMS SuperVisor to export data to the TXT file. Next using PHP you need to load this file to the database.
I am using this solution without problems for last 3 years.
ODBC is of no use for real time data since there is no ODBC interface to Real Time Database (RTDB) in CMS. The only practical solution to get that data is to run terminal reports with CLINT, parse them and store that data in your database. See Tek-Tips thread that has some information on how to do this.
Another option is to use CMS Webdash, which a web interface for CMS but can be used as data source too.
Sound like an older Avaya-switch? In that case, the console based client (hopefully included) on the CMS-server - clint - could be used for screen scraping. It's quite a project writing custom reports from scratch and then make another application log on, start clint and begin scraping that report, but it works and may be an alternative if there is no database-access.
I don't know much about newer Avaya-switches, but they may have more features than this..
You can use clintSVR which is a high level tool based on CMS CLINT. By using clintSVR, you can use CGI, OCX and C++ interfaces to get the real time data from CMS. For PHP, you can use CGI interface to get the real time data.

New Web Developer- PHP or Javascript for user login

I am trying to create a website that will allow users to login with their email and password. To prepare for this I am attempting to learn the languages that will best help me. I have a knowledge of HTML/CSS and am wondering whether to learn PHP or Javascript first. I understand that PHP is server based, does this mean that I will need to provide a server that, for example, their user names/passwords will be stored on? Also, I have been told that Javascript will sometimes be used in PHP, is it necessary that I learn Javascript first?
The only way to secure a login is to have the server do the validation. If you do it on the client, anyone can view the page source and see the code. They can even execute arbitrary javascript code, bypassing any client-side validation.
You will need PHP & some database (MySQL is most common) to create a login system.
You will need to use forms, send the
username and password to a script.
Receive the data and compare the
username & password to the one in
the database
If the login credentials are valid,
create a session variable that keeps
them logged in.
It is worth noting that doing things with only HTTP instead of HTTPS allows hackers (read: Script Kiddies) to hijack your user's sessions if they are on an unsecured network such as open Wi-Fi in Starbucks.
As you say, PHP is server side (executed on a web server), whilst JavaScript is executed on the client side (in the web browser). JavaScript can't be used "in" PHP, but it's often used to improve the user experience on many web sites. However, for the majority of purposes, it can be considered as a separate concern to PHP.
However, let's take a step back. If you think about your problem, you'll probably come to the conclusion that you need to store the information about the users somewhere on the server side, so that you can check the information supplied in the form against the user data you have stored to see if the details are correct. (Once you learn more, you'll most likely decide to store the information in a database, such as the popular MySQL, which PHP can talk to and interrogate using the SQL language.)
However, at this stage of things I'd recommend getting hold of a good book on PHP, or perhaps having a look at the introduction section of the PHP manual, which contains some basic tutorials.
Yikes.
At the minimum you want some sort of server-side language. I'd also highly recommend using a pre-built system, depending upon needs, since security is not easy.
JavaScript is not required.
You will need a host to use for a webserver and for a DB, this can also be your pc check out wamp
Javascript is not required, but using jQuery can certainly help your UI look a lot better. There are a lot of very simple examples of forms (including a login form) inside the jquery site.
Javascript is client-side, it can't auth a user alone, that's were you need PHP. Usually web auth pages don't need javascript, only a client side language, like PHP.
Start with PHP. Javascript is occasionally used for working with PHP on the page (ie., get database info without having to click a "submit" button or navigate to another page.) It is used, for example, to make people's Facebook statuses appear on your homepage in real time. I programmed PHP for years and haven't learned any JS until just recently, so don't worry about it for now.
The posted tutorials (especially on w3) are excellent. There is an excellent tutorial that describes exactly what you are trying to do at devarticles, but it requires a VERY basic understanding of SQL. The example in the tutorial is also fairly unsecure, but it'll teach you the basics of working with MySQL and PHP sessions.
You'll need to run the scripts on a sever that has PHP and MySQL on it, so pay attention to these things when you're looking for hosting.

Connecting Php with javascript

I am trying to make a plugin that people can place on their site to generate a form. I dont want to use an iframe to display the form but use javascript to generate it.
The problem is how do i connect the javascript and php together. My site is programmed in PHP.
Your getting a liite mixed up, I think.
PHP runs on your server. This is the place where you fetch data from the database and create some form of html-response.
Javascript runs in the browser. It can't directly talk to your database.
iframe is a special html-element: Therfore it is passive and can't do anything like creating a form.
You have two ways:
Create a PHP script which handles everything through plain HTTP-Requests. This is the "old school" way and requires a lot of page-reloading.
Write most of the logic in javascript and let it communicate to PHP/your database through AJAX. In this case. Have a look at jQuery which makes AJAX-requests (and a lot of other things) very easy.
One issue you will be faced with is 'Cross site Scripting' with Javascript / AJAX.
You can read up on it a bit here:
http://snook.ca/archives/javascript/cross_domain_aj
Also, thinking your process through, you will need sufficient javascript code to create a 'widget' on any place, and have a way to communicate BACK to your server (keep in mind PHP only runs local on your machine, so it cannot be used remotely in your javascript).
You will probably need to build a JSON API (google / stack search this if needed).
And enable communication from your JAVASCRIPT to the API (don't think of it as to PHP, even tho php will be your API server side language).
Here is an example of a PHP JSON API (on youtube too):
http://www.youtube.com/watch?v=F5pXxS0y4bg
If you put PHP into JavaScript and someone implements this, PHP will compile on their server. So you just can't. You just need to put the form in your plugin.

Categories