Jump to content

if statements problems


speedy_rudolf

Recommended Posts

Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't work. Basically, I'm trying to read from a file and then populate the form according to the file.

The link to the code is http://rudolf.uv.ro/php/eroare.php and the link to the file is http://rudolf.uv.ro/php/eroare.txt.

Any help is very much appreciated. Bye.

Link to comment
Share on other sites

Hi speedy_rudolf,

 

Post your actual code and someone will be able to give you an answer.

<?php
$timp=$_GET['timp'];
$eroare=fopen("eroare.txt", "r");
$layout=fgets($eroare, 102400);
$fis_lay=fgets($eroare, 102400);
$text_lay=fgets($eroare, 102400);
$text=fgets($eroare, 102400);
$fis_txt=fgets($eroare, 102400);
$text_txt=fgets($eroare, 102400);
$imagini=fgets($eroare, 102400);
for($i=1; $i<17; $i++)
{$text_img[$i]=fgets($eroare, 102400);}
$obs_img=fgets($eroare, 102400);
$fundal=fgets($eroare, 102400);
$back_col=fgets($eroare, 102400);
$back_img=fgets($eroare, 102400);
$site_font=fgets($eroare, 102400);
$s_f_t=fgets($eroare, 102400);
$s_f_f=fgets($eroare, 102400);
$s_f_c=fgets($eroare, 102400);
$s_f_c_t=fgets($eroare, 102400);
$obs_stl=fgets($eroare, 102400);
$bannere=fgets($eroare, 102400);
$banners=fgets($eroare, 102400);
$text_ban=fgets($eroare, 102400);
$b_c_pr=fgets($eroare, 102400);
$b_c_p=fgets($eroare, 102400);
$b_c_sec=fgets($eroare, 102400);
$b_c_s1=fgets($eroare, 102400);
$b_c_s2=fgets($eroare, 102400);
$b_c_s3=fgets($eroare, 102400);
$ban_font=fgets($eroare, 102400);
$b_f_t=fgets($eroare, 102400);
$b_f_f=fgets($eroare, 102400);
$b_f_c=fgets($eroare, 102400);
$b_f_c_t=fgets($eroare, 102400);
$obs_ban=fgets($eroare, 102400);
$nav_t_sel=fgets($eroare, 102400);
$nav_type=fgets($eroare, 102400);
$nav_sel=fgets($eroare, 102400);
$navs0=fgets($eroare, 102400);
$navs1=fgets($eroare, 102400);
$navs2=fgets($eroare, 102400);
$navs3=fgets($eroare, 102400);
$navs4=fgets($eroare, 102400);
$navs5=fgets($eroare, 102400);
$navs6=fgets($eroare, 102400);
$navs7=fgets($eroare, 102400);
$navs8=fgets($eroare, 102400);
$navs9=fgets($eroare, 102400);
$navs10=fgets($eroare, 102400);
$navs11=fgets($eroare, 102400);
$navs12=fgets($eroare, 102400);
$navs13=fgets($eroare, 102400);
$navs14=fgets($eroare, 102400);
$navs15=fgets($eroare, 102400);
$navs16=fgets($eroare, 102400);
$navs17=fgets($eroare, 102400);
$navs18=fgets($eroare, 102400);
$navs19=fgets($eroare, 102400);
$navs20=fgets($eroare, 102400);
$navs21=fgets($eroare, 102400);
$text_nav=fgets($eroare, 102400);
$bn_c_pr_n=fgets($eroare, 102400);
$bn_c_p_n=fgets($eroare, 102400);
$bn_c_sec_n=fgets($eroare, 102400);
$bn_c_s_n=fgets($eroare, 102400);
$bn_c_pr_mo=fgets($eroare, 102400);
$bn_c_p_mo=fgets($eroare, 102400);
$bn_c_sec_mo=fgets($eroare, 102400);
$bn_c_s_mo=fgets($eroare, 102400);
$bn_c_pr_md=fgets($eroare, 102400);
$bn_c_p_md=fgets($eroare, 102400);
$bn_c_sec_md=fgets($eroare, 102400);
$bn_c_s_md=fgets($eroare, 102400);
$bn_font=fgets($eroare, 102400);
$bn_f_t=fgets($eroare, 102400);
$bn_f_f=fgets($eroare, 102400);
$bn_f_c=fgets($eroare, 102400);
$bn_f_c_t=fgets($eroare, 102400);
$obs_bn=fgets($eroare, 102400);
$bnc_c_pr_n=fgets($eroare, 102400);
$bnc_c_p_n=fgets($eroare, 102400);
$bnc_c_pr_mo=fgets($eroare, 102400);
$bnc_c_p_mo=fgets($eroare, 102400);
$bnc_font=fgets($eroare, 102400);
$bnc_f_t=fgets($eroare, 102400);
$bnc_f_f=fgets($eroare, 102400);
$bnc_f_c=fgets($eroare, 102400);
$bnc_f_c_t=fgets($eroare, 102400);
$obs_bnc=fgets($eroare, 102400);
$nume=fgets($eroare, 102400);
$prenume=fgets($eroare, 102400);
$telefon=fgets($eroare, 102400);
$email=fgets($eroare, 102400);
$timp_c=fgets($eroare, 102400);
$obs_fin=fgets($eroare, 102400);
fclose($eroare);
?>


<input type="radio" name="Layout" checked="<?php if($layout=='Fisier'){echo 'checked';} ?>" value="Fisier" onClick="Val_layout();Cont_pag1();">Trimite fisier<br/>
<table id="Sl_f" style="display: none"><tr><td><input type="file" name="Fis_lay" size="100" value="<?php echo $fis_lay; ?>" onChange="Cont_pag1()"></td></tr></table>
<input type="radio" name="Layout" checked="<?php if($layout=='Text'){echo 'checked';} ?>" value="Text" onClick="Val_layout();Cont_pag1();">Scrie aici<br/>
<table id="Sl_t" style="display: none"><tr><td><textarea name="Text_lay" cols="80" rows="10" onKeyUp="Cont_pag1()"><?php echo $text_lay; ?></textarea></td></tr></table><br/><br/><br/>

<input type="radio" name="Text" value="Fisier" checked="<?php if($text=='Fisier'){echo 'checked';} ?>" onClick="Val_text();Cont_pag2();">Trimite fisier<br/>
<table id="St_f" style="display: none"><tr><td><input type="file" name="Fis_txt" value="<?php echo $fis_txt; ?>" size="100" onChange="Cont_pag2()"></td></tr></table>
<input type="radio" name="Text" value="Text" checked="<?php if($text=='Text'){echo 'checked';} ?>" onClick="Val_text();Cont_pag2();">Scrie aici<br/>
<table id="St_t" style="display: none"><tr><td><textarea name="Text_txt" cols="80" rows="10" onKeyUp="Cont_pag2()"><?php echo $text_txt; ?></textarea></td></tr></table><br/><br/><br/>

<input type="radio" name="Imagini" value="NuAm"  checked="<?php if($imagini=='NuAm'){echo 'checked';} ?>" onClick="Val_imag();Cont_pag3()">Site-ul nu are imagini<br/>
<input type="radio" name="Imagini" value="Fisier" checked="<?php if($imagini=='Fisier'){echo 'checked';} ?>" onClick="Val_imag();Cont_pag3()">Trimite fisier<br/>
<input type="radio" name="Imagini" value="Text" checked="<?php if($imagini=='Text'){echo 'checked';} ?>" onClick="Val_imag();Cont_pag3()">Scrie/copiaza link-ul<br/>
<table id="Txt_img0" style="display: none"><tr><td><input type="text" name="Text_img1" value="<?php echo $text_img[1]; ?>" size="80" onKeyUp="Cont_pag3()"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img1').style.display=''"></td></tr></table>
<table id="Txt_img1" style="display: none"><tr><td><input type="text" name="Text_img2" value="<?php echo $text_img[2]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img2').style.display=''"></td></tr></table>
<table id="Txt_img2" style="display: none"><tr><td><input type="text" name="Text_img3" value="<?php echo $text_img[3]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img3').style.display=''"></td></tr></table>
<table id="Txt_img3" style="display: none"><tr><td><input type="text" name="Text_img4" value="<?php echo $text_img[4]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img4').style.display=''"></td></tr></table>
<table id="Txt_img4" style="display: none"><tr><td><input type="text" name="Text_img5" value="<?php echo $text_img[5]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img5').style.display=''"></td></tr></table>
<table id="Txt_img5" style="display: none"><tr><td><input type="text" name="Text_img6" value="<?php echo $text_img[6]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img6').style.display=''"></td></tr></table>
<table id="Txt_img6" style="display: none"><tr><td><input type="text" name="Text_img7" value="<?php echo $text_img[7]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img7').style.display=''"></td></tr></table>
<table id="Txt_img7" style="display: none"><tr><td><input type="text" name="Text_img8" value="<?php echo $text_img[8]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img8').style.display=''"></td></tr></table>
<table id="Txt_img8" style="display: none"><tr><td><input type="text" name="Text_img9" value="<?php echo $text_img[9]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img9').style.display=''"></td></tr></table>
<table id="Txt_img9" style="display: none"><tr><td><input type="text" name="Text_img10" value="<?php echo $text_img[10]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img10').style.display=''"></td></tr></table>
<table id="Txt_img10" style="display: none"><tr><td><input type="text" name="Text_img11" value="<?php echo $text_img[11]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img11').style.display=''"></td></tr></table>
<table id="Txt_img11" style="display: none"><tr><td><input type="text" name="Text_img12" value="<?php echo $text_img[12]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img12').style.display=''"></td></tr></table>
<table id="Txt_img12" style="display: none"><tr><td><input type="text" name="Text_img13" value="<?php echo $text_img[13]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img13').style.display=''"></td></tr></table>
<table id="Txt_img13" style="display: none"><tr><td><input type="text" name="Text_img14" value="<?php echo $text_img[14]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img14').style.display=''"></td></tr></table>
<table id="Txt_img14" style="display: none"><tr><td><input type="text" name="Text_img15" value="<?php echo $text_img[15]; ?>" size="80"></td><td width="30"></td><td><input type="button" name="Add_img_txt" value="Adauga link" onClick="document.getElementById('Txt_img15').style.display=''"></td></tr></table>
<table id="Txt_img15" style="display: none"><tr><td><input type="text" name="Text_img16" value="<?php echo $text_img[16]; ?>" size="80"></td></tr></table><br/>

<input type="radio" name="Fundal" value="NuAm" checked="<?php if($fundal=='NuAm'){echo 'checked';} ?>" onclick="Val_back();Cont_pag3_5()">Pastreaza culoarea standard (alb)<br/>
<input type="radio" name="Fundal" value="Culoare" checked="<?php if($fundal=='Culoare'){echo 'checked';} ?>" onclick="Val_back();Cont_pag3_5()">Scrie culoarea/link-ul<br/>
<table id="Back_col_t" style="display: none"><tr><td><input type="text" name="Back_col" size="80" value="<?php echo $back_col; ?>" onKeyUp="Cont_pag3_5()"></td></tr></table>
<input type="radio" name="Fundal" value="Imagine" checked="<?php if($fundal=='Imagine'){echo 'checked';} ?>" onclick="Val_back();Cont_pag3_5()">Trimite o imagine<br/>
<table id="Back_img_t" style="display: none"><tr><td><input type="file" name="Back_img" size=100" value="<?php echo $back_img; ?>" onChange="Cont_pag3_5()"></td></tr></table><br/>

2) Font<br/>
Puteti scrie numele fontului sau linkul unde il putem gasi sau sa ne trimiteti un font personalizat.<br/>
<input type="radio" name="Site_font" value="NuAm" checked="<?php if($site_font=='NuAm'){echo 'checked';} ?>" onclick="Val_back();Cont_pag3_5()">Pastreaza fontul original<br/>
<input type="radio" name="Site_font" value="Text" checked="<?php if($site_font=='Text'){echo 'checked';} ?>" onclick="Val_back();Cont_pag3_5()">Scrie numele/link-ul font-ului<br/>
<table id="S_f_t_t" style="display: none"><tr><td><input type="text" name="S_f_t" size="80" value="<?php echo $s_f_t; ?>"  onKeyUp="Cont_pag3_5()"></td></tr></table>
<input type="radio" name="Site_font" value="Fisier" checked="<?php if($site_font=='Fisier'){echo 'checked';} ?>" onclick="Val_back();Cont_pag3_5()">Trimite font-ul<br/>
<table id="S_f_t_f" style="display: none"><tr><td><input type="file" name="S_f_f" value="<?php echo $s_f_f; ?>" size="100" onChange="Cont_pag3_5()"></td></tr></table><br/>

The rest is exactly the same...so I don't see any reason to copy all the code....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.