SmartFeedSmartFeed          



WELCOME - YOU ARE CURRENTLY VIEWING 419EATER AS A GUEST

By joining our community you will have the ability to post topics and access other forums reserved for members. Registration is quick, simple and absolutely free. Join our community today by clicking here.

ScamWarners.com - Internet Anti-Fraud Center - now open!

These forums are READ ONLY. Click here to register on our new forums - aff.419eater.com


 PHP help wanted

View next topic
View previous topic
 
This forum is locked: you cannot post, reply to, or edit topics.This topic is locked: you cannot edit posts or make replies.
Author Message
D11
Elite Baiter


Joined: 02 Jul 2006
Posts: 1702


PostPosted: Tue Nov 27, 2007 1:46 pm Reply with quoteBack to top

Its driving me nuts.

im trying to create a php form, when the user selects an option the php changes dynamically and items on the form are changed.

the bits im not understanding is on some pages you click the page isnt refreshed, it will just change a portion of the code and thats what im trying to replicate, when a user says they would like information on 1 item there is no point asking do you want to know about all the other items, the form should change to item specific details.

I want it to leave the choices there, they might want to read about a different item, but from that point on it needs to dynamically change to different fields.

Any php people know how to do this properly? Also its using htmlspecialchars because that should stop people adding strange stuff and having the page do stuff its not supposed to do.

_________________
star
1x United Kingdom 0x
Click here to support 419Eater.com

I make software that drives lads crazy. Thats my revenge on lads. (it all helps)

this transaction is 100 percent risk/hitch free - bobo

why no pay me - abum bello
because the cops will know it was you - me
ok this is good - abum bello
View user's profileSend private message
Don
Baiting Guru


Joined: 25 May 2004
Posts: 3045
Location: Italy, 87.2.222.132


PostPosted: Tue Nov 27, 2007 2:19 pm Reply with quoteBack to top

php as such doesn't have an option for that, at least none that I'm aware of. It's usually implemented using JavaScript RPC (Remote Procedure Call) or AJAX.

_________________
Mortar x12
No sugar plum fairies have been hurt during the process of creating this message.

**"Freedom? There ain't no fuckin' Freedom!"**
View user's profileSend private messageYahoo MessengerSkype Name
Tae
** REMEMBERED **


Joined: 27 Apr 2004
Posts: 507
Location: Austria


PostPosted: Tue Nov 27, 2007 3:13 pm Reply with quoteBack to top

The only option I see is to have the fields on different sites. Depending on the user's choice call a different site, otherwise you have to use something like Javascript, like Don suggested.

_________________
Mortar x3

"DO YOU LOVE ME?IF YES THEN CALL ME LETS MAKE LOVE ON THE PHONE." DR.CLIFFORD ANDERSON


Kill a bank a day!
View user's profileSend private message
Rover
Site Admin


Joined: 13 Apr 2004
Posts: 16189
Location: North of the Limpopo


PostPosted: Tue Nov 27, 2007 3:49 pm Reply with quoteBack to top

I take it you are trying to do something like cars.com does http://www.cars.com - I.E as the user selects a Model - then the Make changes.

Your best bet for writing this would be in java script - you can incorporate it into your php script off course

_________________
Rover

Latest Anti Fraud News | Email Header Analysis | Help keep Eater running | Join 419Eater on Facebook Easter 2015
View user's profileSend private messageSend e-mailSkype Name
D11
Elite Baiter


Joined: 02 Jul 2006
Posts: 1702


PostPosted: Tue Nov 27, 2007 8:34 pm Reply with quoteBack to top

@ rover yea, but some scripts allow whole css changes too, im thinking that has to be javascript.

I think ill end up having to use javascript to change the form bit, im no good at javascript.

I had a look at dons suggestion of ajax too, I am surprised its not an ability of php itself.

_________________
star
1x United Kingdom 0x
Click here to support 419Eater.com

I make software that drives lads crazy. Thats my revenge on lads. (it all helps)

this transaction is 100 percent risk/hitch free - bobo

why no pay me - abum bello
because the cops will know it was you - me
ok this is good - abum bello
View user's profileSend private message
MrMe
Master of Master Baiters


Joined: 09 Aug 2007
Posts: 593


PostPosted: Thu Nov 29, 2007 1:10 am Reply with quoteBack to top

Php is purely a server side language, you can't run php within a browser, so there would be no way of php having that ability. All php does is output text. For all intents and purposes, the browser doesn't know or care whether it is receiving text outputted from a PHP script, or a static file.

You need to use Javascript. If you want to just update fields, so that for example with that car site, you chose Ford, then all the models will be Ford models - Javascript is all you need. If you want to be abit fancier, and get information from the server - say for example you wanted to do a postcode search, you would use AJAX to send the postcode to the server, and it would return the appropriate address. It all depends on what exactly you want to do.

Anyway, to change the stylesheet using Javascript:

In your HEAD section, put:
<link rel="stylesheet" href="css4.css"> // i=1
<link rel="stylesheet" href="css3.css"> // i=2
<link rel="stylesheet" href="css2.css"> // i=3
<link rel="stylesheet" href="css1.css"> // i=4
// Make sure the default one is last
<script language="JavaScript">
var doAlerts=true;
</script>

Then whenever you want to change, simple disable the current one:
document.styleSheets[i].disabled=true;
where i is the number of the spreadsheet you want to disable

and enable the other one using:
document.styleSheets[i].disabled=false;

_________________
<a href="?t=120541">GIT Form</a> - <a href="?t=130670">Send emails in the past</a> - <a href="?p=1002914">3-stern Union</a>

<a href="?t=125626">MTCN S3cur3</a> Endorsements:

I am almost having a bad sight as a result of click on the box

my eyes are paining me now cos i have been
looking at the computer for more than six hours

you cannot subject me to this suffering

i am sick and tired of this shit.

I don't go with this Idea at all, this is not how business is done

whenever i make mistake even at the peak of retrieving the numbers i would ask to go back to the begining and this has virtually consumed all my time by doing this

i cant stress my self any more..I now have a back pain cos of this

pony
View user's profileSend private message
leccy
Baiting Guru


Joined: 26 Sep 2004
Posts: 2036
Location: shithole in Scotland


PostPosted: Thu Nov 29, 2007 6:17 am Reply with quoteBack to top

digital-one wrote:
I had a look at dons suggestion of ajax too, I am surprised its not an ability of php itself.


AJAX is what you want. Theres good AJAX tool kits which has it's own set of pre-defined functions written in php. So you add this php which you refer to by the examples and it parses as forms so saves you doing all the js work.

If you write alot of forms and makes it a whole lot simpler.

http://wiki.bluga.net/HTML_AJAX/HomePage

_________________
Do not diss my jokes
Elton
View user's profileSend private message
Display posts from previous:      
This forum is locked: you cannot post, reply to, or edit topics.This topic is locked: you cannot edit posts or make replies.


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum





All Content © 2003 - 419Eater.com : SEO Company
Powered by phpBB © 2001, 2002 phpBB Group :S5: FI Theme :: All times are GMT