Jump to content
php.lv forumi

Mājaslapas tests ar php skriptiem uz PC


hokss

Recommended Posts

Gribēju patestēt dažus no saviem php skriptiem uz datora pirms publicēt. Vai kāds nezin programmu ar kuras palīdzību to varētu izdarīt uz datora nevis online? Pamēģināju XAMPP, bet tā īsti neizdevās panākt rezultātus.

 

P.S. man ir vista home premium.

Edited by hokss
Link to comment
Share on other sites

1000 rindiņas bez kļūdām, 4 no rīta pēc kara, darot to mežā, teltī pilnā ar odiem, codez - varēsi?

Kas skaitās "tā īsti nesanāca" ?

XAMPP, AppServ ir lietas, kas tev palīdzēs to visu izdarīt kā nākas, bonusā uzmet kādu YouTube klipu kā to visus sastellēt un vispār būs jauki.

Link to comment
Share on other sites

Viņš raksta bez testēšanas (un te nav runa par junit testiem vai xdebugu, bet gan par vienkāršu palaišanu).

 

tieshi ta. PHP skriptus pats neakstu bet salasu internetā. līdz ar to pirms ielādēt mājaslapu uz hostu gribētos pārbaudīt vai viss strādā takā tam vajadzētu. nekas jau tur nopietns nav. pāris hit counter un reitingi plus epasta formas, bet tomēr gribētos redzēt kā un kas strādā pirms publicēju. tātad ir kādi ieteikumi?

Link to comment
Share on other sites

XAMPP johaidī! Nekā VIENKĀRŠĀKA nav! :)

 

johaidii beidzot pieleca kaa visu pareizi uzstaadiit. tagad jautaajums mana epasta forma nesuta epastu uz web mail no lokalhost - vai tas ir norm?? vai jameklē cita?

 

 

<?php

/*

This first bit sets the email address that you want the form to be submitted to.

You will need to change this value to a valid email address that you can access.

*/

$webmaster_email = "[email protected]";

 

/*

This bit sets the URLs of the supporting pages.

If you change the names of any of the pages, you will need to change the values here.

*/

$feedback_page = "Rakstimums.html";

$error_page = "kluda.html";

$thankyou_page = "Paldies.html";

 

/*

This next bit loads the form field data into variables.

If you add a form field, you will need to add it here.

*/

$email_address = $_REQUEST['email_address'] ;

$comments = $_REQUEST['comments'] ;

 

/*

The following function checks for email injection.

Specifically, it checks for carriage returns - typically used by spammers to inject a CC list.

*/

function isInjected($str) {

$injections = array('(\n+)',

'(\r+)',

'(\t+)',

'(%0A+)',

'(%0D+)',

'(%08+)',

'(%09+)'

);

$inject = join('|', $injections);

$inject = "/$inject/i";

if(preg_match($inject,$str)) {

return true;

}

else {

return false;

}

}

 

// If the user tries to access this script directly, redirect them to the feedback form,

if (!isset($_REQUEST['email_address'])) {

header( "Location: $feedback_page" );

}

 

// If the form fields are empty, redirect to the error page.

elseif (empty($email_address) || empty($comments)) {

header( "Location: $error_page" );

}

 

// If email injection is detected, redirect to the error page.

elseif ( isInjected($email_address) ) {

header( "Location: $error_page" );

}

 

// If we passed all previous tests, send the email then redirect to the thank you page.

else {

mail( "$webmaster_email", "Feedback Form Results",

$comments, "From: $email_address" );

header( "Location: $thankyou_page" );

}

?>

 

$webmaster_email = "[email protected]";
biju nomainijis uz savu epasta adresi. Edited by hokss
Link to comment
Share on other sites

normaali provaideri shaadus "homemade smtp" serverus norauj uz /dev/null la ipeecatam nebuutu jaskaidrojas kapeec kautkas kaut kur spamo

nekas neko nenorauj ..

Vienkarshi normali japiekonfiguree PHP ( prieksh wina)

janorada Provaidera milserveris ..

tas daras pie PHP.INI

 

smekle, SMTP konfigurcijas liniju un nomaini uz sava provaidera milserveri ( balticomam ir shadi)

---

SMTP = mail.balticom.lv

smtp_port = 25

--

parstarte apachi un viss ies bez problemaam .

Edited by Grey_Wolf
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...