Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-14-2013, 05:04 AM
sstoney200's Avatar
sstoney200 sstoney200 is offline
Contributing Member
 
Join Date: 12-03-10
Location: Essex, UK
Posts: 279
iTrader: 0 / 0%
A really simple one I think...

I want to copy the designer name from here http://www.coretiummedia.com/portfolio/logo-3/

so that when you click 'hire them', it prints or echos their name on

http://www.coretiummedia.com/hire-a-designer/

After the sentence: 'You are enquiring about: * '

I think that's probably really easy but not for those who don't get PHP

Cheers

Last edited by snakeair; 05-14-2013 at 06:34 AM.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 05-14-2013, 05:39 AM
RiptideTempora's Avatar
RiptideTempora RiptideTempora is offline
Contributing Member
 
Join Date: 11-30-11
Location: Orlando, FL
Posts: 235
iTrader: 0 / 0%
It doesn't work for me. The second form is blank when I click the link.
 
Reply With Quote
  #3  
Old 05-14-2013, 07:21 AM
sstoney200's Avatar
sstoney200 sstoney200 is offline
Contributing Member
 
Join Date: 12-03-10
Location: Essex, UK
Posts: 279
iTrader: 0 / 0%
Quote:
Originally Posted by RiptideTempora View Post
It doesn't work for me. The second form is blank when I click the link.
Hi buddy,

I know it doesn't work, that's what I'm trying to fix.
 
Reply With Quote
  #4  
Old 05-14-2013, 07:38 AM
RiptideTempora's Avatar
RiptideTempora RiptideTempora is offline
Contributing Member
 
Join Date: 11-30-11
Location: Orlando, FL
Posts: 235
iTrader: 0 / 0%
Oh. I see. I thought you were modelling your goal off that website.

Erm, what you want to do is at the top of the page (before any HTML or other output), add session_start();

Then on the profile page add $_SESSION['lastViewed'] = $artistName;

And on the form, print out $_SESSION['lastViewed'] inside of the value="" attribute of the relevant form element.
 
Reply With Quote
  #5  
Old 05-14-2013, 08:09 AM
sstoney200's Avatar
sstoney200 sstoney200 is offline
Contributing Member
 
Join Date: 12-03-10
Location: Essex, UK
Posts: 279
iTrader: 0 / 0%
Quote:
Originally Posted by RiptideTempora View Post
Oh. I see. I thought you were modelling your goal off that website.

Erm, what you want to do is at the top of the page (before any HTML or other output), add session_start();

Then on the profile page add $_SESSION['lastViewed'] = $artistName;

And on the form, print out $_SESSION['lastViewed'] inside of the value="" attribute of the relevant form element.
Thanks for getting back to me!

OK so I have the following in my header:

PHP Code:
<?php session_start(); $_SESSION['lastViewed'] = $artistName?>
Then I added designer in tags <artistName>here</artistName> ?

Then on next page form I have:
PHP Code:
<?php _e('You are enquiring about:'); ?> <input type="text" id="designer" name="designer" value="<?php echo $_SESSION['lastViewed']; ?>">
Have I interpreted that right?
 
Reply With Quote
  #6  
Old 05-14-2013, 08:16 AM
RiptideTempora's Avatar
RiptideTempora RiptideTempora is offline
Contributing Member
 
Join Date: 11-30-11
Location: Orlando, FL
Posts: 235
iTrader: 0 / 0%
Close. You don't need to add tags. You just say
PHP Code:
$_SESSION['lastViewed'] = "Someone's name here"
 
Reply With Quote
  #7  
Old 05-14-2013, 08:25 AM
sstoney200's Avatar
sstoney200 sstoney200 is offline
Contributing Member
 
Join Date: 12-03-10
Location: Essex, UK
Posts: 279
iTrader: 0 / 0%
Quote:
Originally Posted by RiptideTempora View Post
Close. You don't need to add tags. You just say
PHP Code:
$_SESSION['lastViewed'] = "Someone's name here"
Oh right, yeah I see what you mean. But the value is going to be different depending on different artists

If you go here: http://www.coretiummedia.com/graphic-designer-showcase/ you can see that the designers are all different.

That's why I thought we need to put in tags main page cause I want it to pick up the specific designer.

I hope that makes sense
 
Reply With Quote
  #8  
Old 05-16-2013, 06:12 AM
RiptideTempora's Avatar
RiptideTempora RiptideTempora is offline
Contributing Member
 
Join Date: 11-30-11
Location: Orlando, FL
Posts: 235
iTrader: 0 / 0%
The page that assigns a value to $_SESSION['lastViewed'] can be every individual artist's showcase gallery.

You could also just pass a parameter (/hire-a-designer/?id=1 or /hire-a-designer/?name=Name+here) and have PHP interpret that.

?id=1 is for databases, whereas ?name=Name+here is for autofilling the form. If you use the ?name=blah make sure you use the following:
PHP Code:
<a href="/hire-a-designer/?name=<?=urlencode("person's name here"); ?>Text</a>
And then:
PHP Code:
You are enquiring about: <? echo htmlentities($_GET['name'], ENT_QUOTES | ENT_HTML5); ?>
This will prevent encoding issues and then prevent your site from having a reflective cross-site scripting vulnerability and being used in drive-by malware attacks.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Web Design with Simple Rules webcosmo Web Design Lobby 3 10-19-2008 12:00 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:43 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC