fashunphotog
05-14-2005, 12:57 PM
It's kinda long but here's the code for the form I'm using (a snippet from the included .php file is in the reply below this:
<form action="vbportfolio.php" method="post" enctype="multipart/form-data">
<p>
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="max_file_size" value="$vboptions[vbpmaxfilesize]">
</p>
<table width="40%" border="1" cellspacing="1" cellpadding="1" align="center" bordercolor="#ff893a">
<tr>
<td align="center" valign="top" height="2134">
<div align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
<tr bgcolor="ff893a">
<td colspan="4"><font size="2"><b>$user[username]'s $vbphrase[vbportfolio]-
Edit Mode</b></font></td>
</tr>
<tr>
<td colspan="4" bgcolor="#738FBF"><font size="2"><b><font color="#FFFFFF">Enter
personal information here:</font></b></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">First Name:</font></div>
</td>
<td width="19%">
<div align="left"><font size="2">
<input type="text" class="bginput" name="firstname" size="20" maxlength="30" />
</font></div>
</td>
<td width="27%">
<div align="right"><font size="2">Last Name: </font></div>
</td>
<td width="26%">
<div align="left"><font size="2">
<input type="text" class="bginput" name="lastname" size="20" maxlength="30" />
</font></div>
</td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Gender:</font></div>
</td>
<td width="19%">
<div align="left"> <font size="2">
<select name="gender">
<option value=" "></option>
<option value="Female">Female</option>
<option value="Male">Male</option>
</select>
</font> </div>
</td>
<td width="27%">
<div align="right"><font size="2">Talent Type: </font></div>
</td>
<td width="26%">
<div align="left">
<div align="left"> <font size="2">
<select name="talent">
<option value=" "></option>
<option value="Model">Model</option>
<option value="Actor">Actor</option>
<option value="Singer">Singer</option>
<option value="Musician">Musician</option>
<option value="Photographer">Photographer</option>
<option value="Make-up Artist">Make-up Artist</option>
<option value="Director">Director</option>
<option value="Casting Director">Casting Director</option>
<option value="Producer">Producer</option>
</select>
</font></div>
</div>
</td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Age:</font></div>
</td>
<td width="19%"> <font size="2">
<select name="age">
<option value=" "></option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
<option value="60">60</option>
<option value="61">61</option>
<option value="62">62</option>
<option value="63">63</option>
<option value="64">64</option>
<option value="65">65</option>
<option value="66">66</option>
<option value="67">67</option>
<option value="68">68</option>
<option value="69">69</option>
<option value="70">70</option>
</select>
</font></td>
<td width="27%">
<div align="right"><font size="2">eMail:</font></div>
</td>
<td width="26%"><b><font size="2">
<input type="text" name="email" size="20" maxlength="75">
</font></b></td>
</tr>
<tr>
<td width="28%">
<div align="right"></div>
</td>
<td width="19%"> </td>
<td width="27%"> </td>
<td width="26%"> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#738FBF"><font size="2" color="#FFFFFF"><b>Contact
Information:</b></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Address:</font></div>
</td>
<td width="19%"><b><font size="2">
<input type="text" name="address" size="20" maxlength="25">
</font></b></td>
<td width="27%">
<div align="right"><font size="2">Apartment:</font></div>
</td>
<td width="26%"><b><font size="2">
<input type="text" name="address2" size="20" maxlength="25">
</font></b></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">City:</font></div>
</td>
<td width="19%"><b><font size="2">
<input type="text" name="city" size="20" maxlength="25">
</font></b></td>
<td width="27%">
<div align="right"><font size="2">State/Province:</font></div>
</td>
<td width="26%"><font size="2">
<input type="text" name="state" size="20" maxlength="25">
</font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Country: </font></div>
</td>
<td width="19%"><font size="2"><b>
<input type="text" name="country" size="20" maxlength="25">
</b></font></td>
<td width="27%">
<div align="right"><font size="2">Postal Code:</font></div>
</td>
<td width="26%"><font size="2"><b>
<input type="text" name="postal2" size="10" maxlength="15">
</b></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Phone Number: </font></div>
</td>
<td width="19%"><b><font size="2">
<input type="text" name="phone" size="20" maxlength="20">
</font></b></td>
<td width="27%">
<div align="right"><font size="2">Fax Number: </font></div>
</td>
<td width="26%"><font size="2"><b>
<input type="text" name="phone2" size="20" maxlength="20">
</b></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Cell Phone: </font></div>
</td>
<td width="19%"><b><font size="2">
<input type="text" name="phone3" size="20" maxlength="20">
</font></b></td>
<td width="27%">
<div align="right"><font size="2">Pager:</font></div>
</td>
<td width="26%"><font size="2"><b>
<input type="text" name="phone4" size="20" maxlength="20">
</b></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Personal Website: </font></div>
</td>
<td colspan="2"><font size="2">
<input type="text" name="website" size="50" maxlength="75">
</font></td>
<td width="26%"> </td>
</tr>
<tr>
<td width="28%"> </td>
<td width="19%"> </td>
<td width="27%"> </td>
<td width="26%"> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#738FBF"><font size="2" color="#FFFFFF"><b>Personal
Statistics:</b></font></td>
</tr>
<tr>
<td colspan="4" bgcolor="#666666"><font size="2" color="#FFFFFF"><b>Women:</b></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Breast Size:</font></div>
</td>
<td width="19%"><b><font size="2">
<input type="text" name="breast" size="10" maxlength="10">
</font></b><font size="1">(inches)</font></td>
<td width="27%">
<div align="right"><font size="2">Cup Size:</font></div>
</td>
<td width="26%"><b><font size="2">
<input type="text" name="cup" size="5" maxlength="5">
</font></b></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Waist:</font></div>
</td>
<td width="19%"><font size="2"><b><font size="2">
<input type="text" name="waist" size="10" maxlength="10">
</font></b><font size="1">(inches)</font></font></td>
<td width="27%">
<div align="right"><font size="2"><font size="2">Hips:</font></font></div>
</td>
<td width="26%"><font size="2"><b><font size="2">
<input type="text" name="hips" size="5" maxlength="5">
</font></b><font size="1">(inches)</font></font></td>
</tr>
<tr>
<td width="28%">
<div align="right"><font size="2">Dress:</font></div>
</td>
<td width="19%"> <font size="2">
<select name="dress" size="1">
<option value=" "></option>
<option value="00"><b>00</b></option>
<option value="0"><b>0</b></option>
<option value="1"><b>1</b></option>
<option value="2"><b>2</b></option>
<option value="3"><b>3</b></option>
<option value="4"><b>4</b></option>
<option value="5"><b>5</b></option>
<option value="6"><b>6</b></option>
<option value="7"><b>7</b></option>
<option value="8"><b>8</b></option>
<option value="9"><b>9</b></option>
<option value="10"><b>10</b></option>
<option value="11"><b>11</b></option>
<option value="12"><b>12</b></option>
<option value="13"><b>13</b></option>
<option value="14"><b>14</b></option>
<option value="15"><b>15</b></option>
<option value="16"><b>16</b></option>
<option value="17"><b>17</b></option>
<option value="18"><b>18</b></option>
<option value="19"><b>19</b></option>
<option value="20"><b>20</b></option>
<option value="Boat Cover"><b>Boat Cover</b></option>
<option value="Small Tent"><b>Small Tent</b></option>
<option value="Circus Tent"><b>Circus Tent</b></option>
</select>
</font></td>
<td width="27%"> [I cut here]
</tr>
</table>
</form>
Thank you for whatever help you can provide.
Mike
And here's the code snippet from the included .php file:
// ################################################## ##########################
// ############################### EDIT PORTFOLIO ################################
// ################################################## ##########################
if ($_REQUEST['do'] == 'editportfolio')
{
if (can_administer() && $_REQUEST[id])
{
$id = $_REQUEST[id];
}
else
{
$id = $bbuserinfo['userid'];
}
$user = fetch_userinfo($id);
if (!$bbuserinfo['userid'])
{
print_no_permission();
}
if ($permissions['genericpermissions'] & CANVBPORTFOLIO) {
$result_data = $DB_site->query("
SELECT firstname,lastname,text,gender,age,email,bmonth,bd ay,byear,talent,address,address2,city,state,postal ,country,phone,phone2,phone3,phone4,website,inssta tus,aftra,sag,natas,experience,breast,cup,waist,he ight,weight,hips,dress,shoes,chest,inseam,ethnic,s tone,hcolor,ecolor,hstyle,piercings,glasses,braces ,handicap,hearing,marks,beard,moustache,tattoos,ru nway,fashion,printmedia,casual,commercial,editoria l,tradeshow,spokesmodel,sports,swimwear,artmodel,f ineartphoto,fineart,photomodel,perfart,internet,bo dyart,lingerie,glamour,acting,singing,dance,voiceo ver,stage,film,television,language,language2,flyin g,swimming,horse,skydiving,scuba,climbing,noagent, likeagent,agencyname,address3,address4,agentname,a gencycity,agencystate,agencypostal,agencycountry,p hone5,phone6,maillist,newsletter FROM " . TABLE_PREFIX . "vbportfolio_users WHERE userid = $id
");
$count = 0;
$data = $DB_site->fetch_Array($result_data);
$result_image = $DB_site->query("
SELECT vbportfolioid,name FROM " . TABLE_PREFIX . "vbportfolio_images WHERE userid = $id
");
while ($image = $DB_site->fetch_Array($result_image))
{
$count++;
eval('$editimagebits .= "' . fetch_template('vbportfolio_editimagebits') . '";');
}
$navbits = construct_navbits(array('' => 'vBPortfolio'));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('vbportfolio_editportfolio') . '");');
}
else
{
print_no_permission();
}
}
if ($_REQUEST['do'] == 'edit')
{
globalize($_POST, array('firstname','lastname','text','gender','age' ,'email','bmonth','bday','byear','talent','address ','address2','city','state','postal','country','ph one','phone2','phone3','phone4','website','insstat us','aftra','sag','natas','experience','breast','c up','waist','height','weight','hips','dress','shoe s','chest','inseam','ethnic','stone','hcolor','eco lor','hstyle','piercings','glasses','braces','hand icap','hearing','marks','beard','moustache','tatto os','runway','fashion','printmedia','casual','comm ercial','editorial','tradeshow','spokesmodel','spo rts','swimwear','artmodel','fineartphoto','fineart ','photomodel','perfart','internet','bodyart','lin gerie','glamour','acting','singing','dance','voice over','stage','film','television','language','lang uage2','flying','swimming','horse','skydiving','sc uba','climbing','noagent','likeagent','agencyname' ,'address3','address4','agentname','agencycity','a gencystate','agencypostal','agencycountry','phone5 ','phone6','maillist','newsletter'));
if (can_administer() && $_REQUEST[id])
{
$id = $_POST[id];
}
else
{
$id = $bbuserinfo['userid'];
}
if (!$bbuserinfo['userid'])
{
print_no_permission();
}
/*
if ($permissions['genericpermissions'] & CANVBPORTFOLIO) {
if (empty($firstname) OR empty($lastname) OR empty($id))
{
eval (print_standard_error('error_requiredfields'));
}
*/
if ($permissions['genericpermissions'] & CANVBPORTFOLIO) {
if (empty($id))
{
eval (print_standard_error('error_requiredfields'));
}
if (!empty($_FILES['src']['tmp_name'])) {
$name = $_FILES['src']['name'];
$data = addslashes(fread(fopen($_FILES['src']['tmp_name'], "r"), filesize($_FILES['src']['tmp_name'])));
$type = $_FILES['src']['type'];
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "vbportfolio_images (userid, name, data, type) VALUES ($id, '$name', '$data', '$type')
");
}
$result_user = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "vbportfolio_users WHERE userid = $id
");
$user = $DB_site->fetch_Array($result_user);
/*my hack
if ($firstname)
{
$nameupdate = "name = '" . addslashes($firstname) . "',"
}
else
{
$nameupdate = '';
}
*/
if (empty($user)) {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "vbportfolio_users (userid, firstname, lastname, text, gender, age, email, bmonth, bday, byear, talent, address, address2, city, state, postal, country, phone, phone2, phone3, phone4, website, insstatus, aftra, sag, natas, experience, breast, cup, waist, height, weight, hips, dress, shoes, chest, inseam, ethnic, stone, hcolor, ecolor, hstyle, piercings, glasses, braces, handicap, hearing, marks, beard, moustache, tattoos, runway, fashion, printmedia, casual, commercial, editorial, tradeshow, spokesmodel, sports, swimwear, artmodel, fineartphoto, fineart, photomodel, perfart, internet, bodyart, lingerie, glamour, acting, singing, dance, voiceover, stage, film, television, language, language2, flying, swimming, horse, skydiving, scuba, climbing, noagent, likeagent, agencyname, address3, address4, agentname, agencycity, agencystate, agencypostal, agencycountry, phone5, phone6, maillist, newsletter, lastactivity) VALUES ($id, '" . addslashes($firstname) . "', '" . addslashes($lastname) . "', '" . addslashes($text) . "', '" . addslashes($gender) . "', '" . addslashes($age) . "', '" . addslashes($email) . "', '" . addslashes($bmonth) . "', '" . addslashes($bday) . "', '" . addslashes($byear) . "', '" . addslashes($talent) . "', '" . addslashes($address) . "', '" . addslashes($address2) . "', '" . addslashes($city) . "', '" . addslashes($state) . "', '" . addslashes($postal) . "', '" . addslashes($country) . "', '" . addslashes($phone) . "', '" . addslashes($phone2) . "', '" . addslashes($phone3) . "', '" . addslashes($phone4) . "', '" . addslashes($website) . "', '" . addslashes($insstatus) . "', '" . addslashes($aftra) . "', '" . addslashes($sag) . "', '" . addslashes($natas) . "', '" . addslashes($experience) . "', '" . addslashes($breast) . "', '" . addslashes($cup) . "','" . addslashes($waist) . "', '" . addslashes($height) . "', '" . addslashes($weight) . "', '" . addslashes($hips) . "', '" . addslashes($dress) . "', '" . addslashes($shoes) . "', '" . addslashes($chest) . "', '" . addslashes($inseam) . "', '" . addslashes($ethnic) . "', '" . addslashes($stone) . "', '" . addslashes($hcolor) . "', '" . addslashes($ecolor) . "', '" . addslashes($hstyle) . "', '" . addslashes($piercings) . "', '" . addslashes($glasses) . "', '" . addslashes($braces) . "', '" . addslashes($handicap) . "', '" . addslashes($hearing) . "', '" . addslashes($marks) . "', '" . addslashes($beard) . "', '" . addslashes($moustache) . "', '" . addslashes($tattoos) . "', '" . addslashes($runway) . "', '" . addslashes($fashion) . "', '" . addslashes($printmedia) . "', '" . addslashes($casual) . "', '" . addslashes($commercial) . "', '" . addslashes($editorial) . "', '" . addslashes($tradeshow) . "', '" . addslashes($spokesmodel) . "', '" . addslashes($sports) . "', '" . addslashes($swimwear) . "', '" . addslashes($artmodel) . "', '" . addslashes($fineartphoto) . "', '" . addslashes($fineart) . "', '" . addslashes($photomodel) . "', '" . addslashes($perfart) . "', '" . addslashes($internet) . "', '" . addslashes($bodyart) . "', '" . addslashes($lingerie) . "', '" . addslashes($glamour) . "', '" . addslashes($acting) . "', '" . addslashes($singing) . "', '" . addslashes($dance) . "', '" . addslashes($voiceover) . "', '" . addslashes($stage) . "', '" . addslashes($film) . "', '" . addslashes($television) . "', '" . addslashes($language) . "', '" . addslashes($language2) . "', '" . addslashes($flying) . "', '" . addslashes($swimming) . "', '" . addslashes($horse) . "', '" . addslashes($skydiving) . "', '" . addslashes($scuba) . "', '" . addslashes($climbing) . "', '" . addslashes($noagent) . "', '" . addslashes($likeagent) . "', '" . addslashes($agencyname) . "', '" . addslashes($address3) . "', '" . addslashes($address4) . "', '" . addslashes($agentname) . "', '" . addslashes($agencycity) . "', '" . addslashes($agencystate) . "', '" . addslashes($agencypostal) . "', '" . addslashes($agencycountry) . "', '" . addslashes($phone5) . "', '" . addslashes($phone6) . "', '" . addslashes($maillist) . "', '" . addslashes($newsletter) . "', '" . time() . "')
");
}
else
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "vbportfolio_users SET firstname = '" . addslashes($firstname) . "', lastname = '" . addslashes($lastname) . "', text = '" . addslashes($text) . "', gender = '" . addslashes($gender) . "', age = '" . addslashes($age) . "', email = '" . addslashes($email) . "', bmonth = '" . addslashes($bmonth) . "', bday = '" . addslashes($bday) . "', byear = '" . addslashes($byear) . "', talent = '" . addslashes($talent) . "', address = '" . addslashes($address) . "', address2 = '" . addslashes($address2) . "', city = '" . addslashes($city) . "', state = '" . addslashes($state) . "', postal = '" . addslashes($postal) . "', country = '" . addslashes($country) . "', phone = '" . addslashes($phone) . "', phone2 = '" . addslashes($phone2) . "', phone3 = '" . addslashes($phone3) . "', phone4 = '" . addslashes($phone4) . "', website = '" . addslashes($website) . "', insstatus = '" . addslashes($insstatus) . "', aftra = '" . addslashes($aftra) . "', sag = '" . addslashes($sag) . "', natas = '" . addslashes($natas) . "', experience = '" . addslashes($experience) . "', breast = '" . addslashes($breast) . "', cup = '" . addslashes($cup) . "', waist = '" . addslashes($waist) . "', height = '" . addslashes($height) . "', weight = '" . addslashes($weight) . "', hips = '" . addslashes($hips) . "', dress = '" . addslashes($dress) . "', shoes = '" . addslashes($shoes) . "', chest = '" . addslashes($chest) . "', inseam = '" . addslashes($inseam) . "', ethnic = '" . addslashes($ethnic) . "', stone = '" . addslashes($stone) . "', hcolor = '" . addslashes($hcolor) . "', ecolor = '" . addslashes($ecolor) . "', hstyle = '" . addslashes($hstyle) . "', piercings = '" . addslashes($piercings) . "', glasses = '" . addslashes($glasses) . "', braces = '" . addslashes($braces) . "', handicap = '" . addslashes($handicap) . "', hearing = '" . addslashes($hearing) . "', marks = '" . addslashes($marks) . "', beard = '" . addslashes($beard) . "', moustache = '" . addslashes($moustache) . "', tattoos = '" . addslashes($tattoos) . "', runway = '" . addslashes($runway) . "', fashion = '" . addslashes($fashion) . "', printmedia = '" . addslashes($printmedia) . "', casual = '" . addslashes($casual) . "', commercial = '" . addslashes($commercial) . "', editorial = '" . addslashes($editorial) . "', tradeshow = '" . addslashes($tradeshow) . "', spokesmodel = '" . addslashes($spokesmodel) . "', sports = '" . addslashes($sports) . "', swimwear = '" . addslashes($swimwear) . "', artmodel = '" . addslashes($artmodel) . "', fineartphoto = '" . addslashes($fineartphoto) . "', fineart = '" . addslashes($fineart) . "', photomodel = '" . addslashes($photomodel) . "', perfart = '" . addslashes($perfart) . "', internet = '" . addslashes($internet) . "', bodyart = '" . addslashes($bodyart) . "', lingerie = '" . addslashes($lingerie) . "', glamour = '" . addslashes($glamour) . "', acting = '" . addslashes($acting) . "', singing = '" . addslashes($singing) . "', dance = '" . addslashes($dance) . "', voiceover = '" . addslashes($voiceover) . "', stage = '" . addslashes($stage) . "', film = '" . addslashes($film) . "', television = '" . addslashes($television) . "', language = '" . addslashes($language) . "', language2 = '" . addslashes($language2) . "', flying = '" . addslashes($flying) . "', swimming = '" . addslashes($swimming) . "', horse = '" . addslashes($horse) . "', skydiving = '" . addslashes($skydiving) . "', scuba = '" . addslashes($scuba) . "', climbing = '" . addslashes($climbing) . "', noagent = '" . addslashes($noagent) . "', likeagent = '" . addslashes($likeagent) . "', agencyname = '" . addslashes($agencyname) . "', address3 = '" . addslashes($address3) . "', address4 = '" . addslashes($address4) . "', agentname = '" . addslashes($agentname) . "', agencycity = '" . addslashes($agencycity) . "', agencystate = '" . addslashes($agencystate) . "', agencypostal = '" . addslashes($agencypostal) . "', agencycountry = '" . addslashes($agencycountry) . "', phone5 = '" . addslashes($phone5) . "', phone6 = '" . addslashes($phone6) . "', maillist = '" . addslashes($maillist) . "', newsletter = '" . addslashes($newsletter) . "', lastactivity = '" . time() . "' WHERE userid = $id
");
}
$result_image = $DB_site->query("
SELECT vbportfolioid,name FROM " . TABLE_PREFIX . "vbportfolio_images WHERE userid = $id
");
if (!empty($result_image))
{
while ($image = $DB_site->fetch_Array($result_image))
{
if ($_POST['delete'.$image['vbportfolioid']])
{
$DB_site->query("
DELETE FROM " . TABLE_PREFIX . "vbportfolio_images WHERE vbportfolioid = $image[vbportfolioid] LIMIT 1
");
}
}
}
Header("Location: $vboptions[bburl]/vbportfolio.php?do=editportfolio&id=$id");
}
else
{
print_no_permission();
}
}
if ($_REQUEST['do'] == 'delportfolio')
{
globalize($_REQUEST, array('id' => INT));
if (!$bbuserinfo['userid'] OR $bbuserinfo['usergroupid']!=6)
{
print_no_permission();
}
if (empty($id))
{
eval (print_standard_error('error_requiredfields'));
}
$DB_site->query("
DELETE FROM " . TABLE_PREFIX . "vbportfolio_users WHERE userid = $id
");
$DB_site->query("
DELETE FROM " . TABLE_PREFIX . "vbportfolio_images WHERE userid = $id
");
$DB_site->query("
DELETE FROM " . TABLE_PREFIX . "vbportfolio_comments WHERE vbportfolioid = $id
");
Header("Location: $vboptions[bburl]/vbportfolio.php?do=list");
}
Marco van Herwaarden
05-14-2005, 01:18 PM
This is gonna be very easy.
In your template you have already this line:
<input type="text" class="bginput" name="firstname" size="20" maxlength="30" />
Change that to:
<input type="text" class="bginput" name="firstname" size="20" maxlength="30" value="$data[firstname]"/>
You can just add the value statements for each field.
Some more, the following:
$result_data = $DB_site->query("
SELECT firstname,lastname,text,gender,age,email,bmonth,bd ay,byear,talent,address,addres s2,city,state,postal,country,phone,phone2,phone3,p hone4,website,insstatus,aftra, sag,natas,experience,breast,cup,waist,height,weigh t,hips,dress,shoes,chest,insea m,ethnic,stone,hcolor,ecolor,hstyle,piercings,glas ses,braces,handicap,hearing,ma rks,beard,moustache,tattoos,runway,fashion,printme dia,casual,commercial,editoria l,tradeshow,spokesmodel,sports,swimwear,artmodel,f ineartphoto,fineart,photomodel ,perfart,internet,bodyart,lingerie,glamour,acting, singing,dance,voiceover,stage, film,television,language,language2,flying,swimming ,horse,skydiving,scuba,climbin g,noagent,likeagent,agencyname,address3,address4,a gentname,agencycity,agencystat e,agencypostal,agencycountry,phone5,phone6,maillis t,newsletter FROM " . TABLE_PREFIX . "vbportfolio_users WHERE userid = $id
");
$count = 0;
$data = $DB_site->fetch_Array($result_data);
Can also be written like:
$data = $DB_site->query_first("
SELECT firstname,lastname,text,gender,age,email,bmonth,bd ay,byear,talent,address,addres s2,city,state,postal,country,phone,phone2,phone3,p hone4,website,insstatus,aftra, sag,natas,experience,breast,cup,waist,height,weigh t,hips,dress,shoes,chest,insea m,ethnic,stone,hcolor,ecolor,hstyle,piercings,glas ses,braces,handicap,hearing,ma rks,beard,moustache,tattoos,runway,fashion,printme dia,casual,commercial,editoria l,tradeshow,spokesmodel,sports,swimwear,artmodel,f ineartphoto,fineart,photomodel ,perfart,internet,bodyart,lingerie,glamour,acting, singing,dance,voiceover,stage, film,television,language,language2,flying,swimming ,horse,skydiving,scuba,climbin g,noagent,likeagent,agencyname,address3,address4,a gentname,agencycity,agencystat e,agencypostal,agencycountry,phone5,phone6,maillis t,newsletter FROM " . TABLE_PREFIX . "vbportfolio_users WHERE userid = $id
");
$count = 0;
And probably even better like:
$data = $DB_site->query_first("
SELECT * FROM " . TABLE_PREFIX . "vbportfolio_users WHERE userid = $id
");
$count = 0;
fashunphotog
05-14-2005, 01:42 PM
Would this work for the radio button inputs and menu/list input boxes as well?
M
Ok, I tried that and am getting these messages:
Database error in vBulletin 3.0.7:
Invalid SQL:
INSERT INTO vbportfolio_users (userid, firstname, lastname, text, gender, age, email, bmonth, bday, byear, talent, address, address2, city, state, postal, country, phone, phone2, phone3, phone4, website, insstatus, aftra, sag, natas, experience, breast, cup, waist, height, weight, hips, dress, shoes, chest, inseam, ethnic, stone, hcolor, ecolor, hstyle, piercings, glasses, braces, handicap, hearing, marks, beard, moustache, tattoos, runway, fashion, printmedia, casual, commercial, editorial, tradeshow, spokesmodel, sports, swimwear, artmodel, fineartphoto, fineart, photomodel, perfart, internet, bodyart, lingerie, glamour, acting, singing, dance, voiceover, stage, film, television, language, language2, flying, swimming, horse, skydiving, scuba, climbing, noagent, likeagent, agencyname, address3, address4, agentname, agencycity, agencystate, agencypostal, agencycountry, phone5, phone6, maillist, newsletter, lastactivity) VALUES (1, 'Michael', 'Commini', 'You may put anything here you\'d like. Build
a resume, list the models/photographers you\'ve
worked with, be creative.', ' ', ' ', '', '', '', '', ' ', '', '', '', '', '', '', '', '', '', '', '', ' ', ' ', ' ', ' ', '', '', '','', '', '', '', ' ', ' ', '', '', 'African', 'Fair', 'Blue', ' ', 'Bald', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ' ', ' ', '', '', '', '', '', '', '', '', '', '', ' ', ' ', '1116083892')
mysql error: Duplicate entry '1' for key 1
mysql error number: 1062
Date: Saturday 14th of May 2005 11:18:12 AM
Script: http://www.chicagotalentgroup.com/forums/vbportfolio.php
Referer: http://www.chicagotalentgroup.com/forums/vbportfolio.php?do=editportfolio
Username: mcommini
IP Address: 69.142.145.218
and when I tried to put the code back to the original I get the following parse error:
Parse error: parse error, unexpected T_STRING in /home/chicagot/public_html/forums/vbportfolio.php on line 177
I'm not sure why it tried to insert instead of updating....
Ok, I figured out what I did wrong - first, I modified the original code which already had what I needed built in! Talk about creating my own problem!
Next, I put the code you suggested in the wrong place! Once I realized that I was able to take care of the problems and get it working.
The only problems I'm having now is that I can no longer use checkboxes and radio buttons 'cause I can't figure out how to assign the variable value and the other is the pictures are expanding to the right. I don't know how to layer them in rows. Any suggestions?
Mike
PS - Give me the url you'd like me to use on my credits page and I'll be sure to give you the credit you deserve!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.