Jump to content
php.lv forumi

Shit Happens :(


CryRat

Recommended Posts

vakar pabeidzu savu saitu :ph34r: un pargaju uz normalu hostu bet saprotams nevareja jau viss but normali :angry: konstateju ka nezkapec shis tas nestrada :(

<code><font color="#000000">
<font color="#0000CC"><?
</font><font color="#006600">...
</font><font color="#0000CC">[url=http://lv.php.net/printf]printf[/url]</font><font color="#006600">(</font><font color="#CC0000">"<A href="</font><font color="#006600">%</font><font color="#0000CC">s</font><font color="#006600">?</font><font color="#0000CC">current</font><font color="#006600">=%</font><font color="#0000CC">s</font><font color="#CC0000">"> <<< </A>"</font><font color="#006600">, </font><font color="#0000CC">$PHP_SELF</font><font color="#006600">, </font><font color="#0000CC">$prev</font><font color="#006600">);
...
</font><font color="#0000CC">?></font>
</font>
</code>

links itek uztaisits pareizi bet izskatas ka tas *.php kas sanem pilnigi ignorets to $prev :unsure:

 

un vel

<code><font color="#000000">
...
<FORM method="post" action="<font color="#0000CC"><? </font><font color="#006600">echo </font><font color="#0000CC">$PHP_SELF</font><font color="#006600">; </font><font color="#0000CC">?></font>">
...</font>
</code>

ar nestrada :(

 

MySQL datu baze ir 99% tada pati ka uz ieprieksheja hosta un visi *.php ar tadi pashi tikai username, password un dbname nomainiti...

 

zinat ku sudiga sajuta ka viss ir pabeigts viss strada bet tomer... plz HELP

Link to comment
Share on other sites

vakar pabeidzu savu saitu :ph34r: un pargaju uz normalu hostu bet saprotams nevareja jau viss but normali :angry: konstateju ka nezkapec shis tas nestrada :(

<code><font color="#000000">
<code><font color="#000000">
<font color="#0000CC"><font color="#0000CC"><?</font><font color="#006600"><</font><font color="#0000CC">br </font><font color="#006600">/></</font><font color="#0000CC">font</font><font color="#006600">><</font><font color="#0000CC">font color</font><font color="#006600">=</font><font color="#CC0000">"#006600"</font><font color="#006600">>...<</font><font color="#0000CC">br </font><font color="#006600">/></</font><font color="#0000CC">font</font><font color="#006600">><</font><font color="#0000CC">font color</font><font color="#006600">=</font><font color="#CC0000">"#0000CC"</font><font color="#006600">>[</font><font color="#0000CC">URL</font><font color="#006600">=</font><font color="#0000CC">http</font><font color="#006600">:</font><font color="#FF9900">//lv.php.net/printf]printf[/URL]</font><font color="#006600">(</font><font color="#CC0000">"<A href="</font><font color="#006600">%</font><font color="#0000CC">s</font><font color="#006600">?</font><font color="#0000CC">current</font><font color="#006600">=%</font><font color="#0000CC">s</font><font color="#CC0000">"> <<< </A>"</font><font color="#006600">, </font><font color="#0000CC">$PHP_SELF</font><font color="#006600">, </font><font color="#0000CC">$prev</font><font color="#006600">);<br />...<br /></font><font color="#0000CC"></font><font color="#0000CC">?></font></font>
</font>
</code></font>
</code>

links itek uztaisits pareizi bet izskatas ka tas *.php kas sanem pilnigi ignorets to $prev :unsure:

 

un vel

<code><font color="#000000">
<code><font color="#000000">
...<br /><FORM method="post" action="<font color="#0000CC"><font color="#0000CC"><? </font><font color="#006600"></</font><font color="#0000CC">font</font><font color="#006600">><</font><font color="#0000CC">font color</font><font color="#006600">=</font><font color="#CC0000">"#006600"</font><font color="#006600">>echo </</font><font color="#0000CC">font</font><font color="#006600">><</font><font color="#0000CC">font color</font><font color="#006600">=</font><font color="#CC0000">"#0000CC"</font><font color="#006600">></font><font color="#0000CC">$PHP_SELF</font><font color="#006600"></</font><font color="#0000CC">font</font><font color="#006600">><</font><font color="#0000CC">font color</font><font color="#006600">=</font><font color="#CC0000">"#006600"</font><font color="#006600">>; </</font><font color="#0000CC">font</font><font color="#006600">><</font><font color="#0000CC">font color</font><font color="#006600">=</font><font color="#CC0000">"#0000CC"</font><font color="#006600">></font><font color="#0000CC">?></font></font>"><br />...</font>
</code></font>
</code>

ar nestrada :(

 

MySQL datu baze ir 99% tada pati ka uz ieprieksheja hosta un visi *.php ar tadi pashi tikai username, password un dbname nomainiti...

 

zinat ku sudiga sajuta ka viss ir pabeigts viss strada bet tomer... plz HELP

nevareetu buut taa ka uz savas kastes, kad testeeji global variables bija On, bet tur kur hosteejies tagad globaalji ir Off ? <_<

Link to comment
Share on other sites

:blink:

 

register_globals=Off

display_errors=Off

output_buffering=Off

allow_call_time_pass_reference=Off

magic_quotes_gpc=On

 

"global variables" = "register_globals" ?

ja ja tad... kas man jadara lai stradatu ?

Link to comment
Share on other sites

:blink:

 

register_globals=Off

display_errors=Off

output_buffering=Off

allow_call_time_pass_reference=Off

magic_quotes_gpc=On

 

"global variables" = "register_globals" ?

ja ja tad... kas man jadara lai stradatu ?

nu ja globaalji bija On, kad tu taisiiji savu saitu tad forma tev izskatiitos shaadi:

 

<code><font color="#000000">

<form method="post" action="edit_delete_post.php">
<textarea rows="1" name="diena" cols="10"></textarea>
<input type="submit" value="Ievietot!" name="submit">
</font>
</code>

 

un formas apstraade izksatiitos shaadi:

 

<code><font color="#000000">

<font color="#0000CC"><?
</font><font color="#006600">echo </font><font color="#0000CC">$diena</font><font color="#006600">;
</font><font color="#0000CC">?>
</font>
</font>
</code>

 

Bet kad globaalji ir Off, tad tie variablji pa formu tiek nodoti bishkji savaadaak, proti:

 

<code><font color="#000000">

<font color="#0000CC"><?
</font><font color="#006600">echo </font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#CC0000">"diena"</font><font color="#006600">];
</font><font color="#0000CC">?>
</font>
</font>
</code>

 

Izmeegjini sho variantu un visam vajadzeetu rulleet ;)

Link to comment
Share on other sites

STRADA ! :wacko:

tik daudz tagad japarraksta... un izskatas ta kods ta nesmuki...

bet thx izglabi mani :wub:

Link to comment
Share on other sites

oki tagad viss strad iznemot $REMOTE_ADDR un $HTTP_USER_AGENT :(

vai varetu but ka tadi ir atslegti ? vai ka lai vinus dabu ?

meginaju $_GET[HTTP_USER_AGENT] bet laikam jau ta vinus nevar dabut...

Link to comment
Share on other sites

  • 4 weeks later...
Man liidziiga probleema ar vienu balsoshanas scriptu. No galvas atcereejois ka $PHP_SELF var noaminiit ar $_SERVER vismaz man straadaaj bet ar ko var noaminiit $REMOTE_ADDR?

$HTTP_SERVER_VARS["REMOTE_ADDR"];

Vismaz man taa liekas.

Link to comment
Share on other sites

ko lietot ja man tagad $action neiet ko likt vietaa?

ja tu domaa action="kaukas.php" tad tur ir jaaliek php fails kas pastraadaas formu. vispaar tavs jautaajums ir pastulbs, jo $action ir vienkaarshi mainiigais. dod piemeeru, gabalu koda, mees tak nevaram nolasiit tev no paura kas ir $action, kaadu info vinjsh satur un kaa tu vinju pielietojis esi. <_<

Link to comment
Share on other sites

Jaa es saprotu ka izklausaas stulbi ka "ko var likt $action" vietaa bet shis mainiigais nekad negrib izpildiities saka ka nedefineets ir shis variaablis testeeju ari iuz jau gataviem scriptiem no hotscripts.com un arii visiem tiem scriptiem raada to pashu ar to pashu variaabli "$result" un tas pac ir ar "$action" neviens pat jau gatavs nopumpets ja godiigi nokopeets scripts arii neiet. nomainiiju $REMOTE_ADDR us $_SERVER tass dereeja vietaa bet talaak ar sitie mdiviem un veel kaut kadi bija neko nevar padariit mosh papildus moduliishus vajag?

Link to comment
Share on other sites

uztaisi pašā skripta augšā;

<?php

echo '<pre>';

print_r($_POST); //dati no formām

print_r($_GET); //dati no adreses ?var=value utt

print_r($_SERVER); //servera mainīgie

print_r($_ENV); // citi servera/lietotāja mainīgie

print_r($GLOBALS); //ja nekur citur nebija, te noteikti jābūt

echo '</pre>';

?>

 

palīdz

Link to comment
Share on other sites

btw me nau nekaads php xperts, bet shito gabalu:

<code><font color="#000000">
<FORM method="post" action="<font color="#0000CC"><? </font><font color="#006600">echo </font><font color="#0000CC">$PHP_SELF</font><font color="#006600">; </font><font color="#0000CC">?></font>"></font>
</code>

var (un vaig) sataisiit taa, lai no php nekas nebuutu atkariigs. taatad:

<code><font color="#000000">
<FORM method="post" action=""></font>
</code>

straadaas burviigi un postees datus pats uz sevi.

Link to comment
Share on other sites

×
×
  • Create New...