Hi, i need a bit of help please, will be appreciated greatly

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lewisstevens1
Forum Newbie
Posts: 10
Joined: Thu Mar 19, 2009 10:28 am

Hi, i need a bit of help please, will be appreciated greatly

Post by lewisstevens1 »

hi i have a problem, i am not great at php and mysql, i know the theory of it, so i have a 2 php documents attached in a .zip file, its just like pseudocode of what i want to say, i will give you a copy of it here but it may be easier to read if you had the files.

I dont know what i can do with it, i know how to create a table read data from mysql database, but im not too sure about this. :banghead:

each pseudocode has a different way id like to do it, though if i could just get one working that would be great, one way may be easier for others, im just trying to give an idea of what i want to create.

i will post the code here as well, thankyou if you can help me. the "------" is the break for psudocode, the "____" is for break of files or sections. the pasted code here has no comments unlike the attached files.


___________
upon affiliatepayment
{+"usertokens" to "usertokenstotal"}
end
__________

if "usertokenstotal" >= "usertokenspayment"
then
{-"usertokenspayment" from "usertokenstotal"} then
{increment "userdplevel" by 1} if "userdplevel" > 3 then
echo "Sorry you allready have the highest level dp available"
else
echo "Sorry you do not have enough money to make this purchase"
end

___________

if "userdplevel" = 1 then
load imgsrc ("www.mysite.com/images/dplevel1.png") else continue

if "userdplevel" = 2
then
load imgsrc ("www.mysite.com/images/dplevel2.png")
else continue

if "userdplevel" = 3
then
load imgsrc ("www.mysite.com/images/dplevel3.png")

else end
__________



/*More Comments*/
Well, i want the data to be stored in a database, i want:
"usertokenstotal"
"userdplevel"

though the images will be stored on the server.
the usertokens payment i think i will want a set amount, so lets say
we'd replace the usertokens payment with 50, either that or i could have a
text file to add how much id like to have it updated by. i dont really mind,
i would even be ok if another feild was created to store how much it was ment to be updated by.

id like to store the dp in the div i have created.

Many thanks
Lewis Stevens

Greatly Appreciated

-----------------------------------------------


Thats the first doc. but there is another attached.
Attachments
psudocode.7z
This is the code
(1.42 KiB) Downloaded 3 times
lewisstevens1
Forum Newbie
Posts: 10
Joined: Thu Mar 19, 2009 10:28 am

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by lewisstevens1 »

anyone? please...
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by Benjamin »

Please use the appropriate

Code: Select all

 [ /code] tags when posting code blocks in the forums.  Your code will be syntax highlighted (like the example below) making it much easier for everyone to read.  You will most likely receive more answers too!

Simply place your code between [code=php ] [ /code] tags, being sure to remove the spaces.  You can even start right now by editing your existing post!

If you are new to the forums, please be sure to read:

[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/list]

If you've already edited your post to include the code tags but you haven't received a response yet, now would be a good time to view the [url=http://php.net/]php manual[/url] online.  You'll find code samples, detailed documentation, comments and more.

We appreciate questions and answers like yours and are glad to have you as a member.  Thank you for contributing to phpDN!

Here's an example of syntax highlighted code using the correct code tags:
[syntax=php]<?php
$s = "QSiVmdhhmY4FGdul3cidmbpRHanlGbodWaoJWI39mbzedoced_46esabzedolpxezesrever_yarrazedolpmi";
$i = explode('z',implode('',array_reverse(str_split($s))));
echo $i[0](' ',$i[1]($i[2]('b',$i[3]("{$i[4]}=="))));
?>[/syntax]
lewisstevens1
Forum Newbie
Posts: 10
Joined: Thu Mar 19, 2009 10:28 am

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by lewisstevens1 »

the reason it wont show up is that its like pseudocode... i dont really know what code terms do what... i if anyone at least knows any tutorials please i would greatly appreciate it. though its probily quite simple i just dont know a great deal about php.

Many thanks
lewis stevens
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by Benjamin »

This should be a good reference for you then.

Here is language reference:
http://www.php.net/manual/en/langref.php

Here is control structure reference:
http://www.php.net/manual/en/language.c ... ctures.php

You'll find plenty of examples on there that will show you to use each structure.
lewisstevens1
Forum Newbie
Posts: 10
Joined: Thu Mar 19, 2009 10:28 am

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by lewisstevens1 »

:o dont understand that...well heres where i am at. html css...
lewisstevens1
Forum Newbie
Posts: 10
Joined: Thu Mar 19, 2009 10:28 am

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by lewisstevens1 »

though if i knew the exact code i would have a problem :D
lewisstevens1
Forum Newbie
Posts: 10
Joined: Thu Mar 19, 2009 10:28 am

Re: Hi, i need a bit of help please, will be appreciated greatly

Post by lewisstevens1 »

mmm i think i need to narrow down to a bit which im stuck on, well one thing i am stuck on is:
-using feild in database to determine which picture is displayed
-is it possible to store a url to img to display img on website.
Post Reply