Jump to content

rootKID

Members
  • Posts

    467
  • Joined

  • Last visited

Everything posted by rootKID

  1. not sure what you mean, but this is a picture of the form and what i mean by form section: http://www.mediafire.com/view/p45ra2mzedtp221/sec.PNG The idea is that for each section in the form, i will have one table.. that is how i designed the database so far, if i didn't do like that then it would be toooo complicated later on since the customer wants ALOT of functions later on added to this script. Anyways, check-boxes is a good idea, but how should i add them? Could you give me an example etc? Would help ALOT! x) And ohh... one thing more, in case you wish to checkout the website to see which one i'm currently working on, this is the one: (http : // www . rightmatch . dk) and in case you wonder, this is how my current form looks like: // Skema Form - Normal echo "<form method='post' enctype='multipart/form-data' autocomplete='off' action=''>"; // Form ID & Saved Secret echo "<input type='hidden' name='customer_form_id' value='".$row['dsg_id_runner']."' />"; echo "<input type='hidden' name='customer_form_saved_secret' value='".$row['dsg_saved_secret_id']."' />"; // Titel echo "<fieldset>"; echo "<legend><u>Data Skema Til Ny Kunde</u></legend>"; echo "</fieldset>"; // Information echo "<fieldset>"; echo "<legend><u>INFO</u></legend>"; echo "Vi anbefaler meget at du som kunde eller ledig person hos os udfylder alle felterne nedenfor i formularen, også selvom du ikke har de forskellige datater vi skal have. Dette vil hjælpe os meget såvel som dig, så tænk dig om."; echo "<br /><br />"; echo "Husk at denne form låses så snart du sender den afsted i bunden af siden her."; echo "<br /><br />"; echo "Der vil være mulighed for at 'Gemme' alle dine handlinger og du vil få genereret en kode som du skal bruge næste gang du kommer på siden her for at fortsætte hvor du slap."; echo "<br /><br />"; echo "Mange hilsner, RightMatch."; echo "</fieldset>"; // Navn echo "<fieldset>"; echo "<legend>Navn</legend>"; echo "<input type='text' name='fornavn' placeholder='Fornavn' />"; echo "<input type='text' name='mellemnavn' placeholder='Mellemnavn' />"; echo "<input type='text' name='efternavn' placeholder='Efternavn' />"; echo "</fieldset>"; // Adresse og Kontaktoplysninger echo "<fieldset>"; echo "<legend>Kontaktoplysninger</legend>"; echo "<input type='text' name='info_gadenavn' placeholder='Gadenavn' />"; echo "<input type='text' name='info_nr' placeholder='Nr' />"; echo "<input type='text' name='info_etage' placeholder='Etage' />"; echo "<select name='info_side'>"; echo "<option value='0'>Vælg Side</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 1"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "<input type='text' name='info_postnr' placeholder='Post-nr' />"; echo "<input type='text' name='info_by' placeholder='By' />"; echo "<input type='text' name='info_land' placeholder='Land' />"; echo "<input type='email' name='info_email' placeholder='Email' />"; echo "<input type='tel' name='info_telefon' placeholder='Telefon' />"; echo "<input type='tel' name='info_mobil' placeholder='Mobil' />"; echo "</fieldset>"; // Fødselsdato echo "<fieldset>"; echo "<legend>Fødselsdato</legend>"; echo "<input type='date' name='foedsel_dato' placeholder='Dato (000-00-00 / År-Måned-Dag)' />"; echo "</fieldset>"; // Nuværende Stilling echo "<fieldset>"; echo "<legend>Nuværende Stilling</legend>"; echo "<input type='text' name='stilling_titel' placeholder='Stillingens Titel' />"; echo "<input type='text' name='stilling_virksomhed' placeholder='Virksomhedens Navn' />"; echo "<select name='stilling_job'>"; echo "<option value='0'>Søgende eller Ledig?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 2"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "</fieldset>"; // Civiltilstand echo "<fieldset>"; echo "<legend>Din Civiltilstand</legend>"; echo "<select name='civil_tilstand'>"; echo "<option value='0'>Civil Status</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 3"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "<input type='text' name='civil_drengehjemme' placeholder='Drenge Hjemmeboende' />"; echo "<input type='text' name='civil_drengesalder' placeholder='Deres Aldre (10,21,22,33)' />"; echo "<input type='text' name='civil_pigerhjemme' placeholder='Piger Hjemmeboende' />"; echo "<input type='text' name='civil_pigersalder' placeholder='Deres Aldre (10,21,22,33)' />"; echo "<select name='civil_hvordan'>"; echo "<option value='0'>Hvordan Kom De Til?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 4"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "</fieldset>"; // Kundens Billede echo "<fieldset>"; echo "<legend>Upload Billede</legend>"; echo "<input type='file' name='billede' />"; echo "</fieldset>"; // Beskrivelse af en selv echo "<fieldset>"; echo "<legend>Beskrivelse Af Dig Selv Via Egne Ord</legend>"; echo "<textarea name='beskriv_dig_selv' rows='15' style='width: 100% !important;' placeholder='Beskriv dig selv med dine egne ord i denne tekst boks.'>"."</textarea>"; echo "</fieldset>"; // Nøgleord echo "<fieldset>"; echo "<legend>Giv 5 Nøgleord Om Dig Selv</legend>"; echo "<input type='text' name='noegleord_et' placeholder='Nøgleord 1' />"; echo "<input type='text' name='noegleord_to' placeholder='Nøgleord 2' />"; echo "<input type='text' name='noegleord_tre' placeholder='Nøgleord 3' />"; echo "<input type='text' name='noegleord_fire' placeholder='Nøgleord 4' />"; echo "<input type='text' name='noegleord_fem' placeholder='Nøgleord 5' />"; echo "</fieldset>"; // Egen Karakterisering echo "<fieldset>"; echo "<legend>Karakteriser Dig Selv</legend>"; echo "<textarea name='karakterisering' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Tilføjelser echo "<fieldset>"; echo "<legend>Tilføjelser Til Din Ansøgning</legend>"; echo "<textarea name='tilfoejelser' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // 1) Styrke echo "<fieldset>"; echo "<legend>Styrke I Det Faglige Såvel Som Personligt?</legend>"; echo "<textarea name='styrke' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // 2) Største Succes echo "<fieldset>"; echo "<legend>Nævn Største Succes?</legend>"; echo "<textarea name='stoerste_success' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Svaghed echo "<fieldset>"; echo "<legend>Har Du Nogle Svagheder?</legend>"; echo "<textarea name='svaghed' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Under Pres echo "<fieldset>"; echo "<legend>Hvordan Er Du Under Pres?</legend>"; echo "<textarea name='under_pres' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Konfliktsituation Takling echo "<fieldset>"; echo "<legend>Hvordan Tackler Du En Konfliktsituation?</legend>"; echo "<textarea name='konflikt_takling' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Motiv echo "<fieldset>"; echo "<legend>Hvad Er Dit Motiv For At Søge Ind I Stillingen?</legend>"; echo "<textarea name='motiv' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Karriereønsker echo "<fieldset>"; echo "<legend>Karriereønsker På 5-10 Plan?</legend>"; echo "<textarea name='karriere_oensker' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Ryger echo "<fieldset>"; echo "<legend>Ryger Du?</legend>"; echo "<select name='ryger'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 5"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "</fieldset>"; // Sygdomme echo "<fieldset>"; echo "<legend>Lider Du Af Nævnværdige Kroniske Sygdomme?</legend>"; echo "<textarea name='sygdomme' rows='15' style='width: 100% !important;' placeholder='TEKST'>"."</textarea>"; echo "</fieldset>"; // Opsigelsesvarsel echo "<fieldset>"; echo "<legend>Opsigelsesvarsel</legend>"; echo "OBS: skriv (KUN) i tal ved måneder og særligt felterne og normal tekst under klausuler boksen."; echo "<input type='text' name='varsel_antal_mdr' placeholder='Antal Måneder' />"; echo "<input type='text' name='varsel_saerligt_mdr' placeholder='Særligt' />"; echo "<textarea name='klausuler' rows='15' style='width: 100% !important;' placeholder='Relevante Klausuler'>"."</textarea>"; echo "</fieldset>"; // Gageforventninger echo "<fieldset>"; echo "<legend>Gageforventninger</legend>"; // Ønskede Månedsløn echo "Hvad er din ønskede månedsløn (inkl. pension, bonus, m.m)? Valuta"; echo "<input type='text' name='gage_oenskede_maaneds_loen' placeholder='Månedsløn Ønske' />"; // Smærtegrænse echo "Hvad er din smærtegrænse for månedsløn (inkl. pension)? Valute *"; echo "<input type='text' name='gage_smaertegraense' placeholder='Smærtegrænse' />"; // Nuværende Månedsløn echo "Nuværende Månedsløn"; echo "<input type='text' name='gage_nuvaerende_maaneds_loen' placeholder='VALUTA' />"; // Pension echo "Hvad er din pension på?"; echo "<input type='text' name='gage_pension_valuta' placeholder='VALUTA' />"; // Bonus echo "Har du bonus?"; echo "<select name='gage_bonus_spoergsmaal'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 6"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "<input type='text' name='gage_bonus_valuta' placeholder='VALUTA' />"; // Har du PC/ADSL? echo "Har du PC/ADSL?"; echo "<select name='gage_pcadsl'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 7"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; // Har du bil? echo "Har du bil?"; echo "<select name='gage_bil'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 8"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; // Har du Telefon? echo "Har du Telefon?"; echo "<select name='gage_telefon'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 9"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; // Har du Mobil? echo "Har du Mobil?"; echo "<select name='gage_mobil'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 10"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; // Andet? echo "Andet?"; echo "<textarea name='gage_andet' rows='15' style='width: 100% !important;' placeholder='Andet?'>"."</textarea>"; echo "</fieldset>"; // Eksamensbeviser o.a echo "<fieldset>"; echo "<legend>Vil Du Kunne Fremskaffe Eksamensbeviser o.a.?</legend>"; echo "Ja / Nej -> Hvis nej er valgt så skal en dybere forklaring skrives i tekstfeltet nedenunder."; echo "<select name='eksamen_ja_nej'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 11"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "<textarea name='eksamen_forklaring' rows='15' style='width: 100% !important;' placeholder='Forklaring'>"."</textarea>"; echo "</fieldset>"; // Lønnet Beskæftigelse echo "<fieldset>"; echo "<legend>Andet Lønnet Beskæftigelse?</legend>"; echo "<textarea name='anden beskaeftigelses_loen' rows='15' style='width: 100% !important;' placeholder='Anden lønnet ydelse? Skriv da her, gerne så detaljeret som muligt.'>"."</textarea>"; echo "</fieldset>"; // Referencer echo "<fieldset>"; echo "<legend>Har Du Nogle Referencer?</legend>"; echo "Reference: 1,2,3"; echo "<br /><br />"; echo "<u>Reference 1</u>"; echo "<input type='text' name='ref_one' placeholder='Reference 1' />"; echo "Navn 1"; echo "<input type='text' name='ref_one_navn' placeholder='Navn' />"; echo "Titel 1"; echo "<input type='text' name='ref_one_titel' placeholder='Titel' />"; echo "Virksomhed 1"; echo "<input type='text' name='ref_one_virksomhed' placeholder='Virksomhed' />"; echo "Relation 1"; echo "<input type='text' name='ref_one_relation' placeholder='Relation' />"; echo "Telefon 1"; echo "<input type='tel' name='ref_one_tlf' placeholder='Telefon' />"; echo "Mobil 1"; echo "<input type='tel' name='ref_one_mobil' placeholder='Mobil' />"; echo "Mail 1"; echo "<input type='email' name='ref_one_mail' placeholder='Mail' />"; echo "<u>Reference 2</u>"; echo "<input type='text' name='ref_two' placeholder='Reference 2' />"; echo "Navn 2"; echo "<input type='text' name='ref_two_navn' placeholder='Navn' />"; echo "Titel 2"; echo "<input type='text' name='ref_two_titel' placeholder='Titel' />"; echo "Virksomhed 2"; echo "<input type='text' name='ref_two_virksomhed' placeholder='Virksomhed' />"; echo "Relation 2"; echo "<input type='text' name='ref_two_relation' placeholder='Relation' />"; echo "Telefon 2"; echo "<input type='tel' name='ref_two_tlf' placeholder='Telefon' />"; echo "Mobil 2"; echo "<input type='tel' name='ref_two_mobil' placeholder='Mobil' />"; echo "Mail 2"; echo "<input type='email' name='ref_two_mail' placeholder='Mail' />"; echo "<u>Reference 3</u>"; echo "<input type='text' name='ref_three' placeholder='Reference 3' />"; echo "Navn 3"; echo "<input type='text' name='ref_three_navn' placeholder='Navn' />"; echo "Titel 3"; echo "<input type='text' name='ref_three_titel' placeholder='Titel' />"; echo "Virksomhed 3"; echo "<input type='text' name='ref_three_virksomhed' placeholder='Virksomhed' />"; echo "Relation 3"; echo "<input type='text' name='ref_three_relation' placeholder='Relation' />"; echo "Telefon 3"; echo "<input type='tel' name='ref_three_tlf' placeholder='Telefon' />"; echo "Mobil 3"; echo "<input type='tel' name='ref_three_mobil' placeholder='Mobil' />"; echo "Mail 3"; echo "<input type='email' name='ref_three_mail' placeholder='Mail' />"; echo "</fieldset>"; // Relevant Om Dig echo "<fieldset>"; echo "<legend>Vil Der Være Noget Relevant Om Dig Hvis Man Søger Via google Som Eksempel?</legend>"; echo "<textarea name='relevant' rows='15' style='width: 100% !important;' placeholder='Efterlad denne blank hvis der intet er.'>"."</textarea>"; echo "</fieldset>"; // Fritid echo "<fieldset>"; echo "<legend>Hvad Bruger Du Din Fritid På?</legend>"; echo "<textarea name='fritid' rows='15' style='width: 100% !important;' placeholder='Skriv hvad din fritid går på.'>"."</textarea>"; echo "</fieldset>"; // Jobsøgende, Jobsamtale, Har været til jobsamtale? echo "<fieldset>"; echo "<legend>Jobsøgende, Jobsamtale, Har Du Været Til Jobsamtale?</legend>"; echo "Jobsøgende?"; echo "<select name='jobsoende_ja_nej'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 12"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "Har du en Jobsamtale?"; echo "<select name='jobsamtale_ja_nej'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 13"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "Virksomhed"; echo "<input type='text' name='jobsamtale_virksomhed' placeholder='Virksomhed' />"; echo "Dato"; echo "<br />"; echo "<input type='date' name='jobsamtale_dato' />"; echo "<br />"; echo "<br />"; echo "Har du været til jobsamtale?"; echo "<select name='jobsamtale_vaeret_ja_nej'>"; echo "<option value='0'>Ja / Nej?</option>"; $info_side_query = "SELECT dsgfs_id, dsgfs_name FROM dataskema_generator_forms_select WHERE dsgfs_identifiers = 14"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsgfs_id']."'>" .$row['dsgfs_name']."</option>"; } echo "</select>"; echo "Virksomhed"; echo "<input type='text' name='jobsamtale_vaeret_virksomhed' placeholder='Virksomhed' />"; echo "Dato"; echo "<br />"; echo "<input type='date' name='jobsamtale_vaeret_dato' />"; echo "</fieldset>"; // GEM eller AFSLUT echo "<fieldset>"; echo "<legend>Gem eller Afslut!</legend>"; //echo "<input type='submit' name='submit_gem' style='float: left;' value='Gem' />"; //echo "<input type='submit' name='submit_afslut' style='float: left;' value='Afslut' />"; echo "<button type='submit' name='submit_gem' formaction='skema_update.php?save=1' style='float: left;'>Gem</button>"; echo "<button type='submit' name='submit_afslut' formaction='skema_update.php' style='float: left;'>Afslut</button>"; echo "</fieldset>"; // GEM OG BILLEDE NOTE! echo "<fieldset>"; echo "<legend>VIGTIG!</legend>"; echo "Når du <u>GEMMER</u> istedet for at afslutte så gemmes dit billede ikke! Dette skal vælges og uploades <u>IGEN!</u> når du skal fortsætte via den gemte form når du vælger at gøre dette på et senere tidspunkt!"; echo "</fieldset>"; echo "</form>"; Tell me what you think etc? I also need to make a picture upload.. i did try taking a look at the one W3S provided at their website as an example, but having trouble adding it to the system for some reason :/ Hoping you got an idea? Would help alot Thanks!
  2. Actually no, i know how to put the radio button on... what i'm asking is if there's another & better way? My plans are to make a seperate table in the database called "candidate_form_settings" or something similar, and via there make some sort of "INT" system... not sure yet, but what i basically need is later on when i make the form, i have to make "if" statements of each individual form items, for instance if the number is 1 etc, then show this part of the form, else show nothing... The main idea is that the customer of my can controle which parts inside the formular he is giving to the candidate so he/she can get the right items showed instead of... well... the whole form, i mean, take a look at the list... not a form i would be having fun with filling out... So i'm asking if there is an easy way to make this "enable/disable" system etc? If you had any idea? Would help alot.. right now i have an idea about the radio "Enable / Disable" system... Now we are at the radio system, whenever i submit a form, this is my code right now: <?php// Data Skema -> Add New Data Skema Item// =======================================if ( !defined("dataskema") ){ die("Error on loading!");}else{ if( isset($_POST) && !empty($_POST) ) { if( isset($_POST['submit']) ) { // Setup $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $middlename = $_POST['middlename']; $virksomhed_one = $_POST['virksomhed_one']; $virksomhed_two = $_POST['virksomhed_two']; $virksomhed_three = $_POST['virksomhed_three']; $virksomhed_four = $_POST['virksomhed_four']; $date = $_POST['date']; // ----------------------------------- $secret = mksecret(); $unique = make_unique($secret, md5("RightMatch1!MakesYourDreamTrue1!")); $dsg_saved_secret_id = 0 + $unique; $dsg_id_runner = 0 + microtime(true); $ds_FK_dsg_id_runner = 0 + microtime(true); // ----------------------------------- // Dataskema (DS) Query $query_ds = " INSERT INTO dataskema ( ds_fornavn, ds_efternavn, ds_mellemnavn, ds_company_one, ds_company_two, ds_company_three, ds_company_four, ds_dato, ds_FK_dsg_id_runner ) VALUES ( '$firstname', '$lastname', '$middlename', '$virksomhed_one', '$virksomhed_two', '$virksomhed_three', '$virksomhed_four', '$date', '$ds_FK_dsg_id_runner' )"; $mysqli->query($query_ds); // Dataskema Generator (DSG) Query $query_dsg = " INSERT INTO dataskema_generator ( dsg_id_runner, dsg_saved_secret_id ) VALUES ( '$dsg_id_runner', '$dsg_saved_secret_id' )"; $mysqli->query($query_dsg); echo "Oprettelse af nyt skema er nu fuldført!"; echo "<br />"; echo "Vent 5-10 sekunder for at blive diregeret videre!"; echo "<br />"; echo "Hvis du stadig ser denne besked efter 5-10 sekunder, klik på linket under her!"; echo "<br />"; echo "<br />"; echo "<a href='dataskema.php'>-> VIDERE <-</a>"; header( "refresh:5; url = dataskema.php" ); } else { echo "Ingen ''POST[SUBMIT]'' data modtaget!"; echo "<br />"; echo "Returner til forrige side og prøv igen!"; echo "<br />"; echo "Tilkald en koder hvis dette problem ikke løses anden eller tredje gang ved opdateringen!"; echo "<br />"; echo "<a href='dataskema.php?dataskema_action=new_data'>-> TILBAGE <-</a>"; } } else { echo "No (POST) data!"; echo "<br />"; echo "<a href='dataskema.php?dataskema_action=edit&id_run=$id_run'>-> TILBAGE <-</a>"; }}?> Now, if i am going to add radio buttons in the system, how do i do that? Kinda first time i use radio buttons in my system actually -.-'... Ideas? Thanks!
  3. Hi W3S! So my customer at rightmatch.dk want's me to make this formular of a sort, since this is a "Recruiting" company. Anyways the idea was whenever he finds a "Candidate" to give this new formular to, he could from behind in the ACP (Administrative Controle Panel) control to make a new form link to the user to follow. Now whenever the user is using the form there has to be 2 options: 1: Save 2: End Save mode will make a simple query with the changes to the database. End will make a query to the database, again an update, except this time it will be adding a tag to the formular inside the database called "Closed"... it is working so far, or so i think, i am at the testing phase and could use some help if possible? What i am struggling with right now is the "Enable/Disable" parts of a formular whenever a new candidate is being created. Now i'm now sure, but the main idea is to make radio buttons on the same page where the new candidate formular is being made. However not sure how to do this the easiest way? Any ideas if possible? This is my code for the "New Candidate Formular" page: <?php// Data Skema -> Add New Data Skema Item// =======================================if ( !defined("dataskema") ){ die("Error on loading!");}else{ echo "<form method='post' action='dataskema.php?dataskema_action=add_data'>"; echo "<div>"; echo "Dato Oprettet: "; echo "<u>".date("d / m - Y")."</u>"; echo "</div>"; echo "<br />"; // Appropriate way to insert data is to fill out EVERY aspect of the datetime-stamp! echo " <input type='hidden' name='date' value='".date("Y-m-d H:i:s")."' style='width: 100%;' />"; echo "<input type='text' name='firstname' placeholder='Kandidatens Fornavn' style='width: 100%;' />"; echo "<input type='text' name='lastname' placeholder='Kandidatens Efternavn' style='width: 100%;' />"; echo "<input type='text' name='middlename' placeholder='Kandidatens Mellemnavn (Valgfrit)' style='width: 100%;' />"; echo "<input type='text' name='virksomhed_one' placeholder='Kandidatens Virksomhed' style='width: 100%;' />"; echo "Hvis du har flere kandidater på samme tid kan du tilføje deres navne herunder!"; echo "<input type='text' name='virksomhed_two' placeholder='Kandidatens Virksomhed (Valgfrit)' style='width: 100%;' />"; echo "<input type='text' name='virksomhed_three' placeholder='Kandidatens Virksomhed (Valgfrit)' style='width: 100%;' />"; echo "<input type='text' name='virksomhed_four' placeholder='Kandidatens Virksomhed (Valgfrit)' style='width: 100%;' />"; echo "<input type='submit' name='submit' id='submit' value='Tilføj Nyt Skema' />"; echo "<p>"; echo "OBS! Når du har oprettet det nye dataskema til Kandidaten vil linket til kandidaten fremgå ved data skemaernes forside!"; echo "</p>"; echo "</form>";}?> And yes, some of it is in Danish language, it's a Danish company x) In anyways the main idea is to put the radio button list right before the end of the form (echo "</form>";). And if you wonder why i am asking for the "easiest" way, then this is the list of items IN the formular: // Navn* fornavn -> INPUT (TEXT) mellemnavn -> INPUT (TEXT)* efternavn -> INPUT (TEXT)// Adresse og Kontaktoplysninger* info_gadenavn -> INPUT (TEXT)* info_nr -> INPUT (TEXT) info_etage -> INPUT (TEXT / TAL!) info_side -> SELECT (TAL SOM VÆRDI!)* info_postnr -> INPUT (TEXT / TAL!)* info_by -> INPUT (TEXT) info_land -> INPUT (TEXT)* info_email -> INPUT (TEXT) info_telefon -> INPUT (TEXT / TAL!)* info_mobil -> INPUT (TEXT / TAL!)// Fødselsdato* foedsel_dato -> INPUT (DATE)// Nuværende Stilling* stilling_titel -> INPUT (TEXT) stilling_virksomhed -> INPUT (TEXT) stilling_job -> SELECT (TAL SOM VÆRDI!)// Civiltilstand* civil_tilstand -> SELECT (TAL SOM VÆRDI!) civil_drengehjemme -> INPUT (TEXT) civil_drengesalder -> INPUT (TEXT / TAL MED DECIMAL!) civil_pigerhjemme -> INPUT (TEXT) civil_pigersalder -> INPUT (TEXT / TAL MED DECIMAL!) civil_hvordan -> SELECT (TAL SOM VÆRDI!)// Kundens Billede* billede -> INPUT (FILE)// Beskrivelse af en selv beskriv_dig_selv -> TEXTAREA// Nøgleord* noegleord_et -> INPUT (TEXT)* noegleord_to -> INPUT (TEXT)* noegleord_tre -> INPUT (TEXT)* noegleord_fire -> INPUT (TEXT)* noegleord_fem -> INPUT (TEXT)// Egen Karakterisering* karakterisering -> TEXTAREA// Tilføjelser* tilfoejelser -> TEXTAREA// 1) Styrke* styrke -> TEXTAREA// 2) Største Succes* stoerste_success -> TEXTAREA// Svaghed* svaghed -> TEXTAREA// Under Pres* under_pres -> TEXTAREA// Konfliktsituation Takling* konflikt_takling -> TEXTAREA// Motiv* motiv -> TEXTAREA// Karriere Ønsker* karriere_oensker -> TEXTAREA// Ryger* ryger -> SELECT (TAL SOM VÆRDI!)// Sygdomme sygdomme -> TEXTAREA// Opsigelsesvarsel* varsel_antal_mdr -> INPUT (TEXT / TAL!)* varsel_saerligt_mdr -> INPUT (TEXT / TAL!)* klausuler -> TEXTAREA// Gageforventninger* gage_oenskede_maaneds_loen -> INPUT (TEXT / TAL!)* gage_smaertegraense -> INPUT (TEXT / TAL!)* gage_nuvaerende_maaneds_loen -> INPUT (TEXT / TAL!)* gage_pension_valuta -> INPUT (TEXT / TAL!)* gage_bonus_spoergsmaal -> SELECT (TAL SOM VÆRDI!)* gage_bonus_valuta -> INPUT (TEXT / TAL eller PROCENT!)* gage_pcadsl -> SELECT (TAL SOM VÆRDI!)* gage_bil -> SELECT (TAL SOM VÆRDI!)* gage_telefon -> SELECT (TAL SOM VÆRDI!)* gage_mobil -> SELECT (TAL SOM VÆRDI!)* gage_andet -> TEXTAREA// Eksamensbeviser o.a* eksamen_ja_nej -> SELECT (TAL SOM VÆRDI!)* eksamen_forklaring -> TEXTAREA// Lønnet Beskæftigelse anden_beskaeftigelses_loen -> TEXTAREA// Referencer ref_one -> INPUT (TEXT) ref_one_navn -> INPUT (TEXT) ref_one_titel -> INPUT (TEXT) ref_one_virksomhed -> INPUT (TEXT) ref_one_relation -> INPUT (TEXT) ref_one_tlf -> INPUT (TEXT / TAL!) ref_one_mobil -> INPUT (TEXT / TAL!) ref_one_mail -> INPUT (TEXT / TAL!) ref_two -> INPUT (TEXT) ref_two_navn -> INPUT (TEXT) ref_two_titel -> INPUT (TEXT) ref_two_virksomhed -> INPUT (TEXT) ref_two_relation -> INPUT (TEXT) ref_two_tlf -> INPUT (TEXT / TAL!) ref_two_mobil -> INPUT (TEXT / TAL!) ref_two_mail -> INPUT (TEXT / TAL!) ref_three -> INPUT (TEXT) ref_three_navn -> INPUT (TEXT) ref_three_titel -> INPUT (TEXT) ref_three_virksomhed -> INPUT (TEXT) ref_three_relation -> INPUT (TEXT) ref_three_tlf -> INPUT (TEXT / TAL!) ref_three_mobil -> INPUT (TEXT / TAL!) ref_three_mail -> INPUT (TEXT / TAL!)// Relevant Om Dig relevant -> TEXTAREA// Fritid fritid -> TEXTAREA// Jobsøgende, Jobsamtale, Har været til jobsamtale? jobsoende_ja_nej -> SELECT (TAL SOM VÆRDI!) jobsamtale_ja_nej -> SELECT (TAL SOM VÆRDI!) jobsamtale_virksomhed -> INPUT (TEXT) jobsamtale_dato -> INPUT (DATE) jobsamtale_vaeret_ja_nej -> SELECT (TAL SOM VÆRDI!) jobsamtale_vaeret_virksomhed -> INPUT (TEXT) jobsamtale_vaeret_dato -> INPUT (DATE) so as you see, it's a LONG list of different values. In some cases i have numbers (tal) as value, text, dates, ###### even a picture i want to upload later on when everything is ready. So in case i didn't lose you just yet, this is my main question: How and What is the easiest way to aproach this "Enable / Disable" form parts? If you need a more detailed explanation, do tell, i am more than willing to give one if needed! Just hope you can give me some sort of suggestion, would hate to struggle with this one alone (rofl) Mr H
  4. Hmm... thanks i guess.. but i have gone ahead to another temporary solution. Like before i'm going with a while loop inside a while loop to make the forums inside overforums. However the main idea WAS originally to only show the overforums that was going by ID in the database.. hence the tabs... not sure you understand what i'm trying to do Oo? In anyways, thanks! Will see if i can find a solution myself, else i will try to contact you again Thanks!
  5. so you are saying i need to "unset" the $result before using it again? Just to see if i understand what you are saying x) Thanks!
  6. Hello! Been a while, but need help yet again I have started to use something called "Bootstrap Version 3" on my projects, going very good actually! Only problem whenever i get to my forum project, i get in trouble! They have this included "tab & pane" in the "Bootstrap V3", meaning like this W3Schools forum in the top-menu, they have links for forums, members, calender and so on... i wonna use something similar on my forum, only thing is that one HAS to be active, that i have understood in the Bootstrap project, whenever you arrive at the forum main-page? My idea is whenever a user has clicked on a tab, the forums related to that tab with the same ID will be shown right under there, this is my example: (PICTURES ATTACHED WITH DB TABLE INFORMATION & FORUM PRE-VIEW ETC IF NEEDED!) My code: $query = "SELECT * FROM mod_forums_forums_tabs";$result = $dbconn->query($query);if($result->num_rows > 0){ // TABS $HTMLOUT .= "<ul class='nav nav-tabs' role='tablist'>"; while($row = $result->fetch_assoc()) { //$HTMLOUT .= "<li role='presentation' class='active'><a href='#ACTIVE' role='tab' data-toggle='tab'>TAB TITLE</a></li>"; // Active //$HTMLOUT .= "<li role='presentation'><a href='#INACTIVE' role='tab' data-toggle='tab'>TAB TITLE</a></li>"; // Inactive $HTMLOUT .= "<li role='presentation'><a href='".$row['mfft_id']."' role='tab' data-toggle='tab'>".$row['mfft_name']."</a></li>"; } $HTMLOUT .= "</ul>"; // End "Tabs" // Break for space. $HTMLOUT .= "<br />"; $HTMLOUT .= "<div class='tab-content'>"; // PANES while($row = $result->fetch_assoc()) { //$HTMLOUT .= "<div role='tabpanel' class='tab-pane fade in active' id='ACTIVE'>Active</div>"; // Active //$HTMLOUT .= "<div role='tabpanel' class='tab-pane fade' id='INACTIVE'>Inactive</div>"; // Inactive $HTMLOUT .= "<div role='tabpanel' class='tab-pane fade' id='".$row['mfft_id']."'>Inactive</div>"; } $HTMLOUT .= "</div>"; // End "Panes"}else{ $HTMLOUT .= "<center>No forum-tabs made yet!</center>";} And yes! I am still working on it Not sure if you can see what i am trying to do here, but if you could give me some idea or tip that would be great! And ohh, about the active/inactive thing. My idea is to get the very FIRST tab that is inside the database to be active, and then WITH that id given from there show the panes down below as a start for until another tab has been clicked at, this is where my problem arrives? Hope you understood my ideas x) Hoping some sort of answers soon! Thanks alot in advance! PICTURE URL: http://www.mediafire.com/view/hru1obybjd06m0d/Overforums_DB.PNG http://www.mediafire.com/view/umh75if20a22lnb/Forums.PNG http://www.mediafire.com/view/04mbcwwwzhvz2vc/Tab_DB.PNG Thanks alot! Again!
  7. Hi, whenever my friend/customer is trying to add in a table/tr/td to he's website, i get ALOT of "<br>" for some random reason, you can see the same as i can here: http://www.rightmatch.dk/referencer.php My question, what am i doing wrong here Oo? This is my form text-area code: <script type='text/javascript'> CKEDITOR.replace( 'editor', { on : { instanceReady : function( ev ) { // Output paragraphs as <p>Text</p>. this.dataProcessor.writer.setRules( 'p', { indent : false, breakBeforeOpen : true, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false }); } }, on : { instanceReady : function( ev ) { this.dataProcessor.writer.setRules( 'br', { indent: false, breakBeforeOpen: false, breakAfterOpen: false, breakBeforeClose: false, breakAfterClose: false }); } } });</script> And this is my SQL add code: $body = $_POST['editor']; $query = " UPDATE page_generator SET pg_body = '$body' WHERE pg_id_runner = $id_run "; $mysqli->query($query); And this is my config.js file from the CKEditor project, i've tried some codes i found online to try to see if i was able to fix my "<br>" problem myself: /** * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; // Custom Added - to prevent annoying auto adding <p> - Working Oo? //CKEDITOR.config.autoParagraph = false; CKEDITOR.on('instanceReady', function (ev) { var writer = ev.editor.dataProcessor.writer; // The character sequence to use for every indentation step. writer.indentationChars = ' '; var dtd = CKEDITOR.dtd; // Elements taken as an example are: block-level elements (div or p), list items (li, dd), and table elements (td, tbody). for (var e in CKEDITOR.tools.extend({}, dtd.$block, dtd.$listItem, dtd.$tableContent)) { ev.editor.dataProcessor.writer.setRules(e, { // Indicates that an element creates indentation on line breaks that it contains. indent: false, // Inserts a line break before a tag. breakBeforeOpen: false, // Inserts a line break after a tag. breakAfterOpen: false, // Inserts a line break before the closing tag. breakBeforeClose: false, // Inserts a line break after the closing tag. breakAfterClose: false }); } for (var e in CKEDITOR.tools.extend({}, dtd.$list, dtd.$listItem, dtd.$tableContent)) { ev.editor.dataProcessor.writer.setRules(e, { indent: true, }); } });}; The thing is i'm using the CSS-Framework called "GetSkeleton", and the CKEditor is destroying the design (only a little bit). In the beginning the editor just added "<p></p>" around my text, and that was good, really good actually... but it also added "<br><br>" between each damn "<p>" tag... which means the damn space between words became... long.. VERY long... and i only wanted the P tags to show up instead of adding the damn breaks after and "maybe" before the P tag... Is there any way you can help me out? Not sure if i'm doing this correctly. I'm using latest version of the CKE online. Thanks for your help if possible!
  8. I believe it's the CKEditor that's making the mistake? Because i just added in an "iFrame" with a youtube link in it. It's working... but the mobile-menu dosen't work for some reason :/... again? this is my code for index.php (Home / Forside) <?php/*THIS PROJECT USES 960GRID SYSTEM!==================================*/# Database Settings & Setuprequire_once("database/db.core.php");# Functions Libraryrequire_once("includes/functions_all.php");ob_start();session_start();# Static Error Checkerrequire_once("includes/static.error.check.php");?><!DOCTYPE html><!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--><!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--><!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--><!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /><title>Forside</title><link rel="stylesheet" href="style/base.css"><link rel="stylesheet" href="style/skeleton.css"><link rel="stylesheet" href="style/main.css"><!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--><link rel="shortcut icon" href="style/images/favicon.ico"></head><body><?phpecho "<div class='container'>"; // Sixteen Columns (Logo, Menu) echo "<div class='sixteen columns top_block'>"; // Banner AND Logo echo "<div class='sixteen columns half-bottom banner'></div>"; // Menu require_once("generators/menu.php"); // Menu echo "</div>"; // Sixteen Columns echo "<div class='sixteen columns half-bottom'>"; $query = "SELECT * FROM page_generator WHERE pg_id_runner = 1"; $result = $mysqli->query($query); while($row = $result->fetch_assoc()) { if($row['pg_body'] == "") { echo "Ingenting tilføjet til denne side i nu! Kom venligst tilbage på et senere tidspunkt!"; } else { echo nl2br($row['pg_body']); } } echo "</div>"; // Sixteen Columns (Footer) echo "<div class='sixteen columns foot_block'>"; require_once("generators/footer.php"); echo "</div>"; echo "</div>";// Space in the end of the websiteecho "<br />";?><!-- =============================================== --><!-- ============ JavaScript Loaded Here============ --><!-- =============================================== --><script type="text/javascript" src="js/jquery.js"></script><script type="text/javascript" src="js/smoothmenu.js"></script></body></html> Ideas?
  9. Hi W3S You helped me earlier with a responsive accordian menu. The website is now online and whenever i test it with with my smartphone (samsung) or just another smartphone based system, the accordian menu wont work for some reason? This is my customers website: www.rightmatch.dk and yes, i'm still working on it. It's a recruiting website and also based in Danish/Dane language Is it possible for someone to tell me where my error is Oo? I'm using CSS, HTML and jQuery for it to work... or so i did anyways... ideas Oo?
  10. Thanks everyone! I found a solution
  11. Well i think the title should say it all to be honest, i have a database with a table and a coble of rows in there. There is one of the rows that has "ENUM" as type and this "Højre" is default on the "ENUM" and has following options in it "Højre, Venstre". Now my question is, what shall i do to make this enum work in a "<select>" html? This is my code atm: echo "<select name='info_side'>"; echo "<option value='0'>Vælg Genre</option>"; $info_side_query = "SELECT dsg_id_runner, dsg_info_side FROM dataskema_generator WHERE dsg_id_runner = $caller"; $info_side_result = $mysqli->query($info_side_query); while ($row = $info_side_result->fetch_assoc()) { echo "<option value='" .$row['dsg_info_side']."'>" .$row['dsg_info_side']."</option>"; }echo "</select>"; And yes i know the value in there should be numeric, but the insert HAS to be a "Højre, Venstre" string? Right Oo? Hoping an answer soon ^^' Thanks!
  12. First of all, thanks for the answers, second of all regarding the "types", what i b and d? All it says are "blob and double"... not sure what those are? Third of all, i will test the thing you said SomeGuy when home, im out atm Will update you later and tell you all what i figure out Thanks
  13. sorry for late reply, this is the error URL it gives me: login.php?err=match ideas Oo? This is my code: // Query$query = "SELECT user_id, user_username, user_first_name, user_last_name, user_password FROM users WHERE user_username=? AND user_password=?";if ($stmt = $mysqli->prepare($query))//if ($stmt = $mysqli->prepare($query) && $mysqli->num_rows == 1){ // Catch user details! $username = $_POST['username']; $password = crypt( $_POST['password'], '$6$rounds=959000$SimpleSourceMadeReal$' ); // Make the salt unique for each password // Input parameters that are put into the query before you execute it $stmt->bind_param('ss', $username, $password); // execute statement $stmt->execute(); // Set output variables, these are the data from the database fields: // -> user_id, user_username, user_first_name, user_last_name and user_password $stmt->bind_result($user_id, $user_username, $user_firstname, $user_lastname, $user_password); // Fetch data from the query $stmt->fetch(); // Thats it, nothing more. //$count = $stmt->num_rows; if($stmt->num_rows == 1) { $_SESSION['admin'] = array(); $_SESSION['admin']['u_id'] = $user_id; $_SESSION['admin']['username'] = $user_username; $_SESSION['admin']['firstname'] = $user_firstname; $_SESSION['admin']['lastname'] = $user_lastname; $_SESSION['admin']['password'] = $user_password; // close statement $stmt->close(); // close connection $mysqli->close(); header("location: index.php"); } else { // Send user back to login page with error // ERR MSG: No match found in DB! Try again! header("location: login.php?err=match"); }}else{ // Send user back to login page with error // ERR MSG: We have a problem with our database! Try again later! header("location: login.php?err=dbsqlerr");}
  14. i dont get any errors, that is one of the problems actually. It's just sending me to the login page with the error without telling me if it's because of the details i was writing wrong? Or because the code was wrong :/ And yes, i have enabled ALL errors to report
  15. hmm, ok, not sure if i understood this one correct but this is my code: // Query$query = "SELECT user_id, user_username, user_first_name, user_last_name, user_password FROM users WHERE user_username=? AND user_password=?";if ($stmt = $mysqli->prepare($query))//if ($stmt = $mysqli->prepare($query) && $mysqli->num_rows == 1){ // Catch user details! $username = $_POST['username']; $password = crypt( $_POST['password'], '$6$rounds=959000$SimpleSourceMadeReal$' ); // Make the salt unique for each password // Input parameters that are put into the query before you execute it $stmt->bind_param('ss', $username, $password); // execute statement $stmt->execute(); // Set output variables, these are the data from the database fields: // -> user_id, user_username, user_first_name, user_last_name and user_password $stmt->bind_result($user_id, $user_username, $user_firstname, $user_lastname, $user_password); // Fetch data from the query $stmt->fetch(); // Thats it, nothing more. //$count = $stmt->num_rows; if($stmt->num_rows == 1) { $_SESSION['admin'] = array(); $_SESSION['admin']['u_id'] = $user_id; $_SESSION['admin']['username'] = $user_username; $_SESSION['admin']['firstname'] = $user_firstname; $_SESSION['admin']['lastname'] = $user_lastname; $_SESSION['admin']['password'] = $user_password; // close statement $stmt->close(); // close connection $mysqli->close(); header("location: index.php"); } else { // Send user back to login page with error // ERR MSG: No match found in DB! Try again! header("location: login.php?err=match"); }}else{ // Send user back to login page with error // ERR MSG: We have a problem with our database! Try again later! header("location: login.php?err=dbsqlerr");} I execute like you say, i even make the "fetch" part... however, i still get back to the login page for some reason, did i get this wrong Oo?
  16. hmm... ok, thanks alot! I might just do that, i just wish to have the "option" to add the watermarks via my website whenever i upload or make a new blog ... in case i make a blog while im at a friends house x) Thanks for the info tho! .P
  17. Okay, my title should say it all, just not sure if this is possible, nothing i have been making for a while now. Here is an example of what happens with my code at the moment: As you see, i have tried adding an image as my watermark INSIDE the image itself at the blog i'm about to code/finish. My ideas is to get the watermark image inside all images posted on my website later on in the bottom/right corner, as you see in the image also. Any suggestions? Because the images i'm generating is coming from my database, so you should guess it would be pretty simple? This is my code for the generation at the moment: $blog_query = " SELECT blog_id, blog_picture_url, blog_title, blog_message, blog_created_date, blog_edited_date, blog_userid FROM blog ORDER BY blog_id DESC LIMIT 5 "; $blog_result = $mysqli->query($blog_query); // If bigger than 0 if ($blog_result->num_rows > 0) { echo "<div class='home_blog_wrapper'>"; // Wrapper echo "<div class='home_blog_wrapper_inner'>"; // Wrapper Inner echo "<hr />"; // output data of each row while($row = $blog_result->fetch_assoc()) { //echo ""; echo "<div class='home_blog_box_header'>"; // Blog Title echo "<div class='home_blog_box_header_title'>"; echo $row['blog_title']; echo "</div>"; // Blog Number (#) echo "<div class='home_blog_box_header_blog_post'>"; echo "Blog indlæg, #".$row['blog_id']; // Date echo "<div class='home_blog_box_header_blog_date'>"; echo date('d/m/Y H:i:s', strtotime($row['blog_created_date'])); echo "</div>"; echo "</div>"; echo "</div>"; echo "<img src='".$row['blog_picture_url']."' alt='Blog Billede' title='Blog Billede'>"; echo "<img class='watermark' src='style/images/img_watermark.png' alt='Vandmærke' title='Vandmærke'></img>"; echo "Derp"; echo "</img>"; /* echo "<div class='home_blog_image_div_sized'>"; echo "<img class='watermarked' src='".$row['blog_picture_url']."' /><br />"; echo "</div>"; echo nl2br($row['blog_message'])."<br />"; echo $row['blog_userid'].""; */ echo "<hr />"; } echo "</div>"; // Wrapper Inner echo "</div>"; // Wrapper } else { echo "Ingen blog-nyheder er tilføjet i nu!"; } $mysqli->close(); and this is my style as it is at the moment: /*# Global Design==================================================*/img.watermark { /*background-image: url(images/img_watermark.png);*/ height: 40px; width: 40px; position: absolute; bottom: 40px; right: 40px;}.home_news { border-radius: 5px; background-color: #C2C2C2;} .home_blog_wrapper { clear: both; width: 100%; } .home_blog_wrapper_inner { margin: 10px; } .home_blog_box_header { width: 100%; } .home_blog_box_header_title {width: 100%; font-style: normal; font-weight: bold;} .home_blog_box_header_blog_post {text-align: left;} .home_blog_box_header_blog_date {float: right;} .home_blog_wrapper_inner hr {margin-top: 5px; margin-bottom: 5px;} Any ideas about what i'm doing wrong? Any help would be greightly appreciated! Thanks!
  18. ok lol this explains alot... i double checked my SQL... forgot i changed the "usersname & password" to "user_username & user_password".... now i have another problem. Ok not a problem, more like a question. If i wanted to check INSIDE the if statement like before, if there was a user then run else send the user back to the login page with an error? Is there a way? I did try this one: //if ($stmt = $mysqli->prepare($query) && $mysqli->num_rows == 1) but since that was on the actual if statement line, i commented out. Besides, i had a feeling it would not work, that i'm aware off? Wrong? If anyone of you has any ideas that would be awsome! Thanks!
  19. ok this dosen't makes any sence to me... i litterally to created a new user in the database with the username "MA_01" and password "WebKode1234", crypt is $6$rounds=959000$SimpleSourceMade$rDHvP/nvcww3SlQcbaGZzeCHC74xpyRiY76eokE5CJEmn3DNZ.jcfzVo2C2wkYEJXbgp.6NiokqfA/vN7ts0i. I even tried the way you said Ingolme, the only problem is that whenever i tried to login with the password "WebKode1234", it only sends me back to the login screen with the error from the else statement i made on the login screen (No users were found in our database). So not sure because i can't select anything at the moment :/ Ideas? :/
  20. Ok i'm not sure but i was checking out what was avaiable of the "crypt" part and found the SHA-500 and tried to switch to that part, just to see if anything happened and how it looked. I made a simple "echo" with the crypt and got this: $6$rounds=5000$SimpleSourceMade$Df4j02HQ/jkXYqdaKIA6D7mAUhCfaZo9i0QnU4.vw5ELmARdYGRm6yVDrl8fYTPcZ4YcSdZyWRIVf4UqTooJl/ I then tried to copy/paste this code to my already pre-made user in the database, i could not login with this one. Then i tried to only take this part of the code: Df4j02HQ/jkXYqdaKIA6D7mAUhCfaZo9i0QnU4.vw5ELmARdYGRm6yVDrl8fYTPcZ4YcSdZyWRIVf4UqTooJl/ Still could not login. My question now is if i have something spelled out wrong in my code etc? This is my code right now: // Catch user details!$username = $_POST['username'];$password = crypt( $_POST['password'], '$6$rounds=5000$SimpleSourceMadeReal$' ); // Make the salt unique for each password// Statement - Prepare & Bindings$query = "SELECT user_id, user_username, user_first_name, user_last_name, user_password FROM users WHERE username=? AND password=?";if ($stmt = $mysqli->prepare($query))//if ($stmt = $mysqli->prepare($query) && $mysqli->num_rows == 1){ // Input parameters that are put into the query before you execute it $stmt->bind_param('ss', $username, $password); // execute statement $stmt->execute(); // Set output variables, these are the data from the database fields: // -> user_id, user_username, user_first_name, user_last_name and user_password $stmt->bind_result($id, $username, $firstname, $lastname, $password); // Fetch data from the query $stmt->fetch(); // That's it, nothing more. $_SESSION['admin'] = array(); $_SESSION['admin']['user_id'] = $id; $_SESSION['admin']['username'] = $username; $_SESSION['admin']['firstname'] = $firstname; $_SESSION['admin']['lastname'] = $lastname; $_SESSION['admin']['password'] = $password; // close statement $stmt->close(); // close connection $mysqli->close(); header("location: index.php");}else{ // Send user back to login page with error header("location: login.php?err=1");}//////////////////////////////////////////////////////// ONLY USE IF NOT USING//(&& $mysqli->num_rows == 1)// IN THE IF/ELSE STATEMENT ABOVE!// - REMEMBER TO COMMENT OUT THE ELSE STATEMENT// - IF I REMOVE THAT PART AND MOVE BACK TO THE OLD// - LOGIN METHOD!//////////////////////////////////////////////////////// close connection//$mysqli->close(); As you see i have "tried" to edit the script to return to the login page with an error like before, and if it got back with any users it should make the sessions and then return to the administrator page. Not sure if i made anything wrong or something, but the way i see it it should be working... any ideas Oo? Thanks!
  21. Ok, i think i almost understand what this is about. I have one more question, when you say in the bind result part, is this where that variable are being created all the time? I mean if i wanted to edit my query later on for other purposes, would i need to add those the the bind_result function but in an order of state? Meaning if the "id,username,password" came like that, it would HAVE to be "ID, NAME, PASS" for ordering the variables i can use? Thanks btw! Makes alot more sence now! And one last, is this the same method i use if i wish to upload a file to my server? In this case just take the file-name when i get that far and use that filename to insert to the DataBase? Thanks again!
  22. ok now im confuced, this was my code before: //$stmt->execute(); // This part was in the "if" statement below before...//$mysqli->prepare("SELECT u_id, username, password FROM users WHERE username=? AND password=?");//$stmt -> bind_param('ss', $username, $password);if ($result = $stmt->execute()){ $count = $result->num_rows; if($count == 1) { //$row = $result; $row = $stmt->fetch(); $_SESSION['admin'] = array(); $_SESSION['admin']['user_id'] = $row['user_id']; $_SESSION['admin']['user_username'] = $row['user_username']; $_SESSION['admin']['user_password'] = $row['user_password']; // free result set $result->close(); // Send user to ACP page header("location: index.php"); } else { // Send user back to login page with error header("location: login.php?err=1"); }}// Closing "statement" AND "DB connection"$stmt -> close(); This is my code now, the way i understand what you tell me anyways x) // Catch user details!$username = $_POST['username'];$password = crypt( $_POST['password'], '$2a$07$usesomesillystringforsalt$' );// Statement - Prepare & Bindings$query = "SELECT user_id, user_username, user_first_name, user_last_name, user_password FROM users WHERE username=? AND password=?";if ($stmt = $mysqli->prepare($query)){ // execute statement $stmt->execute(); // bind result variables $stmt->bind_result($username, $password); //$stmt -> bind_param('ss', $username, $password); // close statement $stmt->close();}// close connection$mysqli->close(); question, what is the difference between "bind_param" and "bind_result"? Just noticed it changed? Maybe just me but you just made me change the whole login script, or did i misunderstand you out from what you said again? If possible can you show me an example so i can understand you better? I understood the execute part, or so i think... but unsure about in which order i should code the login script our for what information i got so far :/ Ideas? xP
  23. Hi, sorry for late reply, bad food gave me food poison (crap :/)... but to keep to topic here, thanks for the reply! I think i'm getting there slowly, this is my code at the moment, not sure if i understood it correct, but how does it look now? CODE: # Database Settings & Setuprequire_once("../database/db.core.php");ob_start();session_start();# Functions (Login) Libraryrequire_once("functions/functions_login.php");// ======================================================// Catch user details!$username = $_POST['username'];$password = crypt( $_POST['password'], '$2a$07$usesomesillystringforsalt$' );// Statement - Prepare & Bindings$stmt = $mysqli->prepare("SELECT u_id, username, password FROM users WHERE username=? AND password=?");$stmt->bind_param('ss', $username, $password);if ($result = $stmt->execute()){ /* while ($row = $result->fetch_row()) { // Code goes here... } */ $count = $result->num_rows; if($count == 1) { $row = $result; $_SESSION['admin'] = array(); $_SESSION['admin']['user_id'] = $row['user_id']; $_SESSION['admin']['user_username'] = $row['user_username']; $_SESSION['admin']['user_password'] = $row['user_password']; // free result set $result->close(); // Send user to ACP page header("location: index.php"); } else { // Send user back to login page with error header("location: login.php?err=1"); }}// Closing "statement" AND "DB connection"$stmt -> close(); Is this correct understood? I will change the string in the crypt if this is correct understood... Another question. My administrator can't signup as a user, this means i have to pre-insert the user for the administrator in the database. My question is now this, what do i need to do to get the correct code to the database user? I'm using SHA1 atm from before. Ideas? And thanks for the help and understandment so far, still learning how to work out the MySQLI work x) Thanks, checking back later! Mr R
  24. i know that, i removed the id from the other div once i switched... i still dont understand why it wont allow me to fix the damn thing -.-' If i do change the HTML setup, which im not out from what i can read from the default, only the css ^^... then what jQuery part should i change?
  25. i know that it's much safer. But how to use? I'm not sure if i got this one correct, tell me if im wrong etc: On the example 1, it has a "if" statement where crypt is used. Now my question is, inside the hash_equals function, what does the "$user_input" stand for? Is that the password the user has entered inside the input field? Or is that the password that has been hashed already from the "$hashed_password"? And not sure but crypt is that not just another way of identifying passwords instead of encrypting them? Or am i wrong in the understandment? Possible you could give me a smaller example that i could follow? I better understand it the way you say it i think for some reason, lol hehe x) Thanks again!
×
×
  • Create New...