/    Sign up×
Community /Pin to ProfileBookmark

needing help and guidance from PHP gurus!

Here is what I need to do.

I need to make a web form that will allow me to enter:

image name, discription (potentially LONG), and other info.

into a MySql database.

Then, I need a web page that will populate a table with:

Image_thumbnail (*i’ll have thumbnail files), mouse-over text that has picture name.

When the visitor clicks the thumbnail, I want to spawn a page that has a bigger picture, the description text, and two buttons – one to inquire about the item, another to buy it.

Clicking the enquire button launches an email (I have the script for this). Clicking the Buy button will, for now, also launch an email – but should disable the item and remove it temporarily at least from the database.

Any clues? I can do all of this with static pages, but I figure a database is going to be easier in the long run… I won’t have to clone 1000 pages….

John

to post a comment
PHP

17 Comments(s)

Copy linkTweet thisAlerts:
@crh3675Feb 11.2004 — $45/hr to write your code for you
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 12.2004 — [i]Originally posted by crh3675 [/i]

[B]$45/hr to write your code for you [/B][/QUOTE]


wish I could, but I'm only getting 350 for the site (plus a commission on sales).

Any tips?

John
Copy linkTweet thisAlerts:
@clairec666Feb 12.2004 — Do you know any of the basics of PHP coding and MySQL, or do you want the entire code............?

Some starters for you:

If you want to clone 1000 pages, it's possible with PHP and no effort from yourself................. in your from where you insert the name, description etc., you would create a new file and write information to it based on the information entered in the form.

If you DID want to use a database, here are some starters on your thumbnail page:

I would suggest that one of the fields in the database would be 'file-name', and each of these would be unique. All your picture files would be kept in the same folder. Use PHP to read te content of that folder, and it would provide a list of all the files in the folder. Manipulate this list so that it prints an <img> tag for each of the files. and all of the pictures will be printed to the page.

For each of the images, you will want to retrieve the info about it from your database, and print an 'onmouseover' function for each picture, containing the picture name value for the database.

If this doesn't help much............ Sorry!
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 12.2004 — [i]Originally posted by clairec666 [/i]

[B]Do you know any of the basics of PHP coding and MySQL, or do you want the entire code............?



Some starters for you:

If you want to clone 1000 pages, it's possible with PHP and no effort from yourself................. in your from where you insert the name, description etc., you would create a new file and write information to it based on the information entered in the form.



If you DID want to use a database, here are some starters on your thumbnail page:

I would suggest that one of the fields in the database would be 'file-name', and each of these would be unique. All your picture files would be kept in the same folder. Use PHP to read te content of that folder, and it would provide a list of all the files in the folder. Manipulate this list so that it prints an <img> tag for each of the files. and all of the pictures will be printed to the page.

For each of the images, you will want to retrieve the info about it from your database, and print an 'onmouseover' function for each picture, containing the picture name value for the database.



If this doesn't help much............ Sorry! [/B]
[/QUOTE]


Actually helps a lot. Yes, my DB will have 2 file names - one for the thumb, one for full size pic. I have a javascript that I've used before to pop-up the full size image on click of thumbnail. And a description and other info.

so I want to output:

clickable thumb ...... description..... price.... button1 .... button2.

The buttons will feed another script.

I do understand programming... I was a BASIC and PL1/PLC (plus pascal and cobol...) programmer years ago... it's just a re-education due to the DOM stuff, and exactly how mySQL works...

Is there a limit to the amount of text that can be in a my SQL field? Any characters that I should avoid putting into the text so it does not make my code more complicated than it should be? like " or '?

John
Copy linkTweet thisAlerts:
@clairec666Feb 12.2004 — The limit of charcters in a field depends on what data-type you use: eg. char(50) will hold up to 50 chars, char(100) up to 100............ 'text' will hold a certain amount, but I haven't got the exact figure comitted to memory.......... try 'longtext' to be on the safe side.
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 12.2004 — i'm going to paste some html here for what IT would look like if I did it manually... maybe you can point me in the right direction for generating this via PHP so I can avoid a day of trial and (tons of) errors....
Copy linkTweet thisAlerts:
@clairec666Feb 12.2004 — Sure, go ahead................... I haven't got my v. useful PHP book with me at the moment, so I might not be able to help that much......
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 12.2004 — Here is the HTML I would use (no CSS included - no time to format it all... but perhaps I could generate this type of layout entirely with CSS and the PHP????)
[CODE]
<table border="2" cellpadding="0" cellspacing="0" width="540">
<tr>
<td><img border="0" src="../../../../Joes%20Pics/Modified/aud001_t.jpg" width="150" height="150"></td>
<td><b>Text Description:<br>
<font size="1">Dáig alta in mac sin i tig a athar &amp; a mathar icon
airdig i m-Maig Muirthemne, ocus adfeta dó scéla na maccaemi i n-Emain.
Dáig is amlaid domeill Conchobar in rigi, o ro gab rígi in rí, .i.
mar atraig fóchetóir césta &amp; cangni in choicid d'ordugud. </font></b></td>
<td>$575.00
<p><a href="javascript:sendAnnotatedMailTo('Info','mydomain','org','inquiry on AUD001')">Inquire</a>&nbsp;<a href="javascript:sendAnnotatedMailTo('buy','mydomain','org','PURCHASE AUD001')">BUY</a></p></td>
</tr>
<tr>
<td><img border="0" src="../../../../Joes%20Pics/Modified/aud002_t.jpg" width="150" height="150"></td>
<td><b>Text Description:<br>
<font size="1">Dáig alta in mac sin i tig a athar &amp; a mathar icon
airdig i m-Maig Muirthemne, ocus adfeta dó scéla na maccaemi i n-Emain.
Dáig is amlaid domeill Conchobar in rigi, o ro gab rígi in rí, .i.
mar atraig fóchetóir césta &amp; cangni in choicid d'ordugud. </font></b></td>
<td>$750.00
<p><a href="javascript:sendAnnotatedMailTo('Info','mydomain','org','inquiry on AUD002')">Inquire</a>&nbsp;<a href="javascript:sendAnnotatedMailTo('buy','mydomain','org','PURCHASE AUD002')">BUY</a></p></td>
</td>
</tr>
</table>
[/CODE]


your thoughts are more than welcome!

If you'd like to see it live, I can post it to a test web...

John
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 12.2004 — Any clues?

I've already set up my database... that was cool! Now I have to figure out how to get stuff out of it...

How do you hide PHP code from 'right-click/view source' ? because you have to have a password to access the db, right? and that password would be in plain sight in the standard php-mysql call $dbh=mysql_connect (localhost,dbname,password)...

John
Copy linkTweet thisAlerts:
@crh3675Feb 12.2004 — If your PHP code is appearing in the browser then you do not have PHP installed on the server you are working on. Or, you are accessing the file with a file path and not through a URL.

BTW, how can you afford to do that work for ony $350??
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 12.2004 — [i]Originally posted by crh3675 [/i]

[B]If your PHP code is appearing in the browser then you do not have PHP installed on the server you are working on. Or, you are accessing the file with a file path and not through a URL.



BTW, how can you afford to do that work for ony $350?? [/B]
[/QUOTE]



edit:

[u]Not sure yet.. .cause I've yet to write the php code.. i just set up the database today.[/u] Ahh I see... php pages don't let the code show through. Neet! Ok... time to do more learning. Thanks.

Umm, I'm hoping that the commission on sales from the site will benefit me in the long run, and doing a site for this guy can open doors to more business as well. Toping it all off, I'm unemployed at this time and so it's better to get paid to learn than nothing, eh?

John
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 13.2004 — bump for CLAIRE...

See the HTML above... i'm trying to make THIS HTML automatic with the script in the other post...

John
Copy linkTweet thisAlerts:
@clairec666Feb 13.2004 — I'll work on it....... thanks for the bump ?

I've got my 'big PHP' book with me today, so I should be a bit more help.......
Copy linkTweet thisAlerts:
@clairec666Feb 13.2004 — [i]Originally posted by Bigjohn [/i]

[B]Any clues?



I've already set up my database... that was cool! Now I have to figure out how to get stuff out of it...



How do you hide PHP code from 'right-click/view source' ? because you have to have a password to access the db, right? and that password would be in plain sight in the standard php-mysql call $dbh=mysql_connect (localhost,dbname,password)...



John [/B]
[/QUOTE]


In response to this part:

PHP code isn't shown to the user. When a user requests a PHP page, it works through the programming and all the if/else statements.... and it will output a page to the browser. Eg. <?php echo "<html"><head><body>...."; ?> This would output the <html> etc. tags to the page. So the rest of the coding wouldn't ben seen, and your password can't be seen.

I'm still working on the rest of the code, I'll have it done in a while.
Copy linkTweet thisAlerts:
@clairec666Feb 13.2004 — Sorry - I haven't had time to sort out your code....... and I won't be back on here for a few days. I'll try and post it tonight for you, if I can get online.
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 13.2004 — [i]Originally posted by clairec666 [/i]

[B]Sorry - I haven't had time to sort out your code....... and I won't be back on here for a few days. I'll try and post it tonight for you, if I can get online. [/B][/QUOTE]


THANKS! I'm working on it from my end too... this phpedit software seems to be a good guide.. it won't let you mis-pair quotes and brackets and such!

John
Copy linkTweet thisAlerts:
@BigjohnauthorFeb 17.2004 — [i]Originally posted by clairec666 [/i]

[B]Sorry - I haven't had time to sort out your code....... and I won't be back on here for a few days. I'll try and post it tonight for you, if I can get online. [/B][/QUOTE]


Claire -

hope you had a good weekend.

[URL=http://jtest.stegenga.net/querytest2.php]HERE [/URL] is what I've come up with so far....

The only thing is, the a:hover / a:active works in IE6, but not in firefox...

John
×

Success!

Help @Bigjohn spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...