PDA

View Full Version : More fun php hacks


Mike Armas
10-20-2005, 10:46 PM
Hi all i would like to edit my pgm-realtime_builder.php

and change line 412


$errordisplay .= "<img src=under_construction.gif width=273 height=74 border=0></td></tr></table><BR>&nbsp;<BR>\n";

thats the line where the under construction pic is when you have not add any content to a page.

I have a nice flash under construction i want to put on my pages when there is no content.

I put

$errordisplay .= "<embed src="underconstruct.swf" quality="high"></td></tr></table><BR>&nbsp;<BR>\n";

well that didn't work can anyone help out ?

Cameron Allen
10-21-2005, 01:20 PM
What directory is your flash file in? If you uploaded the .swf through Pro's file manager it is in the media directory. Also your code is not properly formatted and will result in a parse error.
Instead format that line like this:

$errordisplay .= "<embed src=\"http://cameronallen.com/pro.swf\" width=\"400\" height=\"400\" border=0></td></tr></table><BR>&nbsp;<BR>\n";

or If the swf is in the media folder...


$errordisplay .= "<embed src=\"http://cameronallen.com/media/pro.swf\" width=\"400\" height=\"400\" border=0></td></tr></table><BR>&nbsp;<BR>\n";

You obviously need to change the src, as well as the width and height. :cool:

Mike Armas
11-18-2005, 11:13 AM
Here is a link to a description of something very similar to what I want to do with php:





http://www.codingforums.com/archive/index.php?t-3210.html



What I want is to be able to provide a URL string that will pass the user name to be used to login to our site, bypassing the actual login screen. The password will always be cpotracker (or whatever we decide upon).



Currently, when I go to the login screen on our web site, the actual url string in the browser contains the following:



http://www.cpotracker.com/pgm-secure_login.php?notice=required&pa=User_Site&=SID





I think all you should have to do is duplicate the pgm-secure_login.php file and change the code in that file to accept the user name from the url string rather than showing the login screen. Take the user name from the url and attempt to login to the database using that string.





Here is a sample of the string I will pass using the username keyword:



http://www.cpotracker.com/pgm-secure_login.php?username=CC99999-05248-131439&notice=required&pa=User_Site&=SID



I am not even sure if we will need the notice=required and ps=User_Site&=SID parameters I would have to see the actual php file to see what these are being used for.

Cameron Allen
11-18-2005, 07:36 PM
create a custom include containing the following and drop it on the page that you want it to display on:


<?
$USERNAME = "cameron";
$PASSWORD = "password";
$pa = "Home_Page";
?>
<FORM NAME=LOGIN METHOD=POST ACTION="http://yourdomain.com/pgm-secure_login.php">
<INPUT TYPE=HIDDEN NAME=PROCESS VALUE=AUTHENTICATE>
<INPUT TYPE=HIDDEN NAME=pa VALUE="">
<INPUT TYPE=HIDDEN NAME=sc VALUE="">
<INPUT TYPE=HIDDEN NAME=customernumber VALUE=<? echo $PASSWORD; ?>>
<INPUT TYPE=HIDDEN NAME=SOHO_AUTH VALUE=<? echo $USERNAME; ?>>
<INPUT TYPE=HIDDEN NAME=SOHO_PW VALUE=<? echo $PASSWORD; ?>>
<a href="javascript:document.LOGIN.submit();">Login Now</a>
</FORM>

This creates a single link, that contains a username, password, and page to go to, that you can define with phpvariables. You would define the variables on the page that the link which determine what username, password, and page you wanted to logon with and to.
$USERNAME = "username"
$PASSWORD = "password"
$pa = "Secure Page to Login to"

I hope this helps.

Mike Armas
12-06-2005, 01:09 PM
thank you that did help.

I got something new for you.

I would like to edit the shopping cart layout.

1. Take out shipping options. The customer don't need to ship anything.


If you go here this will help understand what iam talking about.

http://www.georgiawellnessalliance.com/index.php?pr=Generator_Reg

2. I buy the attendess fee just 1 or how ever meany i need. I click add to my cart then i fill out a form and click coutinue.

The info you enter on that from shows up under the GWA Generator Attendee Fee under Product Name. it looks like this

-> (Item 1) Attendee_First_Name:: uhih
-> (Item 1) Attendee_Last_Name:: jubjb
-> (Item 1) Attendee_Phone_#:: 777-777-7777
-> (Item 1) Attendee_email:_:
-> (Item 1) Sponsor_/_Payee_Name::

Is there any way to have it show like

First Name: uhih
Last Name: jubjb
and so on.

Iam going to be changeing the form to just have Name and Phone #. Just i want to pick what shows and what doesn't. I just want the "Name: uhih jubjb" to show. How do i do this ?


What file do i need to edit ?

I looked in the pgm-add_cart.php but i don't think its in there.